예제 #1
0
        public void It_Returns_The_Point_On_The_Circle_At_The_Give_Length(double length, double[] pts)
        {
            // Arrange
            Point3 expectedPt = new Point3(pts[0], pts[1], pts[2]);

            // Act
            double normalizeLength = GSharkMath.RemapValue(length, new Interval(0.0, _circle2D.Length), new Interval(0.0, 1.0));
            Point3 pt = _circle2D.PointAtLength(length);
            Point3 ptNormalizedLength = _circle2D.PointAtNormalizedLength(normalizeLength);

            // Assert
            pt.EpsilonEquals(expectedPt, GSharkMath.MaxTolerance).Should().BeTrue();
            pt.EpsilonEquals(ptNormalizedLength, GSharkMath.MaxTolerance).Should().BeTrue();
        }
예제 #2
0
        /// <summary>
        /// Evaluates a point at the normalized length.
        /// </summary>
        /// <param name="normalizedLength">The length factor is normalized between 0.0 and 1.0.</param>
        /// <returns>The point at the length.</returns>
        public override Point3 PointAtNormalizedLength(double normalizedLength)
        {
            double length = GSharkMath.RemapValue(normalizedLength, new Interval(0.0, 1.0), new Interval(0.0, Length));

            return(PointAtLength(length));
        }