public SvgPoint lerp(SvgPoint that, double percent) { return(new SvgPoint( this.x + (that.x - this.x) * percent, this.y + (that.y - this.y) * percent )); }
internal SvgSvgElement(string prefix, string localname, string ns, SvgDocument doc) : base(prefix, localname, ns, doc) { svgExternalResourcesRequired = new SvgExternalResourcesRequired(this); svgFitToViewBox = new SvgFitToViewBox(this); svgTests = new SvgTests(this); currentTranslate = new SvgPoint(0, 0); }
public void TestLerp() { SvgPoint p2 = new SvgPoint(40,30); SvgPoint p3 = p.lerp(p2, 0.25); Assert.AreEqual(10, p.X); Assert.AreEqual(20, p.Y); Assert.AreEqual(40, p2.X); Assert.AreEqual(30, p2.Y); Assert.AreEqual(17.5, p3.X); Assert.AreEqual(22.5, p3.Y); }
public void TestAddition() { SvgPoint p2 = new SvgPoint(40,30); SvgPoint p3 = p + p2; Assert.AreEqual(10, p.X); Assert.AreEqual(20, p.Y); Assert.AreEqual(40, p2.X); Assert.AreEqual(30, p2.Y); Assert.AreEqual(50, p3.X); Assert.AreEqual(50, p3.Y); }
public SvgPoint lerp(SvgPoint that, double percent) { return(new SvgPoint(_x + (that._x - _x) * percent, _y + (that._y - _y) * percent)); }
public SvgPoint lerp(SvgPoint that, double percent) { return new SvgPoint( this.x + (that.x - this.x)*percent, this.y + (that.y - this.y)*percent ); }
public void SetUp() { p = new SvgPoint(10,20); }
public void TestSubtraction() { SvgPoint p2 = new SvgPoint(40,30); SvgPoint p3 = p2 - p; Assert.AreEqual(10, p.X); Assert.AreEqual(20, p.Y); Assert.AreEqual(40, p2.X); Assert.AreEqual(30, p2.Y); Assert.AreEqual(30, p3.X); Assert.AreEqual(10, p3.Y); }