public void GetTangent()
        {
            HermiteSegment2F s = new HermiteSegment2F
            {
                Point1   = new Vector2F(1, 2),
                Tangent1 = (new Vector2F(10, 3) - new Vector2F(1, 2)) * 3,
                Tangent2 = (new Vector2F(10, 2) - new Vector2F(7, 8)) * 3,
                Point2   = new Vector2F(10, 2),
            };

            BezierSegment2F b = new BezierSegment2F
            {
                Point1        = new Vector2F(1, 2),
                ControlPoint1 = new Vector2F(10, 3),
                ControlPoint2 = new Vector2F(7, 8),
                Point2        = new Vector2F(10, 2),
            };

            Assert.IsTrue(Vector2F.AreNumericallyEqual(s.Tangent1, s.GetTangent(0)));
            Assert.IsTrue(Vector2F.AreNumericallyEqual(s.Tangent2, s.GetTangent(1)));
            Assert.IsTrue(Vector2F.AreNumericallyEqual(b.GetTangent(0.7f), s.GetTangent(0.7f)));
        }
Esempio n. 2
0
        public void GetTangent()
        {
            BezierSegment2F b = new BezierSegment2F
            {
                Point1        = new Vector2F(1, 2),
                ControlPoint1 = new Vector2F(10, 3),
                ControlPoint2 = new Vector2F(7, 8),
                Point2        = new Vector2F(10, 2),
            };

            Assert.IsTrue(Vector2F.AreNumericallyEqual(3 * (b.ControlPoint1 - b.Point1), b.GetTangent(0)));
            Assert.IsTrue(Vector2F.AreNumericallyEqual(3 * (b.Point2 - b.ControlPoint2), b.GetTangent(1)));
        }
Esempio n. 3
0
        public void GetTangent()
        {
            BezierSegment2F b = new BezierSegment2F
              {
            Point1 = new Vector2F(1, 2),
            ControlPoint1 = new Vector2F(10, 3),
            ControlPoint2 = new Vector2F(7, 8),
            Point2 = new Vector2F(10, 2),
              };

              Assert.IsTrue(Vector2F.AreNumericallyEqual(3 * (b.ControlPoint1 - b.Point1), b.GetTangent(0)));
              Assert.IsTrue(Vector2F.AreNumericallyEqual(3 * (b.Point2 - b.ControlPoint2), b.GetTangent(1)));
        }
Esempio n. 4
0
        public void GetTangent()
        {
            HermiteSegment2F s = new HermiteSegment2F
              {
            Point1 = new Vector2F(1, 2),
            Tangent1 = (new Vector2F(10, 3) - new Vector2F(1, 2)) * 3,
            Tangent2 = (new Vector2F(10, 2) - new Vector2F(7, 8)) * 3,
            Point2 = new Vector2F(10, 2),
              };

              BezierSegment2F b = new BezierSegment2F
              {
            Point1 = new Vector2F(1, 2),
            ControlPoint1 = new Vector2F(10, 3),
            ControlPoint2 = new Vector2F(7, 8),
            Point2 = new Vector2F(10, 2),
              };

              Assert.IsTrue(Vector2F.AreNumericallyEqual(s.Tangent1, s.GetTangent(0)));
              Assert.IsTrue(Vector2F.AreNumericallyEqual(s.Tangent2, s.GetTangent(1)));
              Assert.IsTrue(Vector2F.AreNumericallyEqual(b.GetTangent(0.7f), s.GetTangent(0.7f)));
        }