Пример #1
0
        public void GetTangent()
        {
            HermiteSegment3F s = new HermiteSegment3F
            {
                Point1   = new Vector3F(1, 2, 3),
                Tangent1 = (new Vector3F(10, 3, 6) - new Vector3F(1, 2, 3)) * 3,
                Tangent2 = (new Vector3F(10, 2, 12) - new Vector3F(7, 8, 19)) * 3,
                Point2   = new Vector3F(10, 2, 12),
            };

            BezierSegment3F b = new BezierSegment3F
            {
                Point1        = new Vector3F(1, 2, 3),
                ControlPoint1 = new Vector3F(10, 3, 6),
                ControlPoint2 = new Vector3F(7, 8, 19),
                Point2        = new Vector3F(10, 2, 12),
            };

            Assert.IsTrue(Vector3F.AreNumericallyEqual(s.Tangent1, s.GetTangent(0)));
            Assert.IsTrue(Vector3F.AreNumericallyEqual(s.Tangent2, s.GetTangent(1)));
            Assert.IsTrue(Vector3F.AreNumericallyEqual(b.GetTangent(0.7f), s.GetTangent(0.7f)));
        }
Пример #2
0
        public void GetTangent()
        {
            HermiteSegment3F s = new HermiteSegment3F
              {
            Point1 = new Vector3F(1, 2, 3),
            Tangent1 = (new Vector3F(10, 3, 6) - new Vector3F(1, 2, 3)) * 3,
            Tangent2 = (new Vector3F(10, 2, 12) - new Vector3F(7, 8, 19)) * 3,
            Point2 = new Vector3F(10, 2, 12),
              };

              BezierSegment3F b = new BezierSegment3F
              {
            Point1 = new Vector3F(1, 2, 3),
            ControlPoint1 = new Vector3F(10, 3, 6),
            ControlPoint2 = new Vector3F(7, 8, 19),
            Point2 = new Vector3F(10, 2, 12),
              };

              Assert.IsTrue(Vector3F.AreNumericallyEqual(s.Tangent1, s.GetTangent(0)));
              Assert.IsTrue(Vector3F.AreNumericallyEqual(s.Tangent2, s.GetTangent(1)));
              Assert.IsTrue(Vector3F.AreNumericallyEqual(b.GetTangent(0.7f), s.GetTangent(0.7f)));
        }
Пример #3
0
        public void GetTangent()
        {
            BezierSegment3F b = new BezierSegment3F
            {
                Point1        = new Vector3(1, 2, 3),
                ControlPoint1 = new Vector3(10, 3, 6),
                ControlPoint2 = new Vector3(7, 8, 19),
                Point2        = new Vector3(10, 2, 12),
            };

            Assert.IsTrue(Vector3.AreNumericallyEqual(3 * (b.ControlPoint1 - b.Point1), b.GetTangent(0)));
            Assert.IsTrue(Vector3.AreNumericallyEqual(3 * (b.Point2 - b.ControlPoint2), b.GetTangent(1)));
        }
Пример #4
0
        public void GetTangent()
        {
            BezierSegment3F b = new BezierSegment3F
              {
            Point1 = new Vector3F(1, 2, 3),
            ControlPoint1 = new Vector3F(10, 3, 6),
            ControlPoint2 = new Vector3F(7, 8, 19),
            Point2 = new Vector3F(10, 2, 12),
              };

              Assert.IsTrue(Vector3F.AreNumericallyEqual(3 * (b.ControlPoint1 - b.Point1), b.GetTangent(0)));
              Assert.IsTrue(Vector3F.AreNumericallyEqual(3 * (b.Point2 - b.ControlPoint2), b.GetTangent(1)));
        }