Esempio n. 1
0
        public void AsCubic()
        {
            var p0 = new Vector2(-4, -4);
            var p1 = new Vector2(2, -4);
            var p2 = new Vector2(4, 4);

            var myCurve      = new QuadraticBezierCurve2D(p0, p1, p2);
            var myCubicCurve = myCurve.AsCubic();

            myCurve.Point(0f).Should().BeEquivalentTo(myCubicCurve.Point(0f));
            myCurve.Point(0.25f).Should().BeEquivalentTo(myCubicCurve.Point(0.25f));
            myCurve.Point(0.75f).Should().BeEquivalentTo(myCubicCurve.Point(0.75f));
            myCurve.Point(1f).Should().BeEquivalentTo(myCubicCurve.Point(1f));
        }