/// <summary>
        /// Clones the curve.
        /// </summary>
        /// <returns>LinearCurve.</returns>
        public CircularCurve CloneCurve()
        {
            CircularCurve curve = new CircularCurve(_vertexMajor, _focus, _tolerance);

            curve._range = Range.CloneRange();
            return(curve);
        }
        /// <summary>
        /// Coordinates of where a perpendicular projection intersects the provided coordinate.
        /// The first coordinate is of the closer intersection.
        /// Returns infinity if the point is coincident with the circular curve center.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <param name="referenceArc">The line to which a perpendicular projection is drawn.</param>
        /// <returns>CartesianCoordinate.</returns>
        /// <exception cref="NotImplementedException"></exception>
        public static Tuple <CartesianCoordinate, CartesianCoordinate> CoordinatesOfPerpendicularProjection(CartesianCoordinate point, CircularCurve referenceArc)
        {
            if (point == referenceArc.Center)
            {
                return(new Tuple <CartesianCoordinate, CartesianCoordinate>(
                           new CartesianCoordinate(double.PositiveInfinity, double.PositiveInfinity),
                           new CartesianCoordinate(double.PositiveInfinity, double.PositiveInfinity)
                           ));
            }

            LinearCurve ray = new LinearCurve(referenceArc.Center, point);

            CartesianCoordinate[] intersectionCoordinates = referenceArc.IntersectionCoordinate(ray);

            double distance1 = CartesianOffset.Separation(point, intersectionCoordinates[0]);
            double distance2 = CartesianOffset.Separation(point, intersectionCoordinates[1]);
            CartesianCoordinate intersectionClose = (distance1 < distance2) ? intersectionCoordinates[0] : intersectionCoordinates[1];
            CartesianCoordinate intersectionFar   = (distance1 < distance2) ? intersectionCoordinates[1] : intersectionCoordinates[0];

            return(new Tuple <CartesianCoordinate, CartesianCoordinate>(intersectionClose, intersectionFar));
        }
 /// <summary>
 /// Determines if the curves intersect each other.
 /// </summary>
 /// <param name="curve1">The curve1.</param>
 /// <param name="curve2">The curve2.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 /// <exception cref="NotImplementedException"></exception>
 public static bool AreIntersecting(CircularCurve curve1, CircularCurve curve2)
 {
     return(IntersectionCircularCircular.AreIntersecting(curve1, curve2));
 }
 /// <summary>
 /// Returns points where the circular curve intersects the provided circular curve.
 /// </summary>
 /// <param name="otherLine">Circular curve that intersects the current circular curve.</param>
 /// <returns>CartesianCoordinate.</returns>
 public CartesianCoordinate[] IntersectionCoordinate(CircularCurve otherLine)
 {
     return(IntersectionCircularCircular.IntersectionCoordinates(this, otherLine));
 }
 /// <summary>
 /// Determines whether the specified curve is tangent.
 /// </summary>
 /// <param name="curve">The curve.</param>
 /// <returns><c>true</c> if the specified curve is tangent; otherwise, <c>false</c>.</returns>
 public bool IsTangent(CircularCurve curve)
 {
     return(AreTangent(this, curve));
 }
 /// <summary>
 /// Determines whether the specified curve is intersecting.
 /// </summary>
 /// <param name="curve">The curve.</param>
 /// <returns><c>true</c> if the specified curve is intersecting; otherwise, <c>false</c>.</returns>
 public bool IsIntersecting(CircularCurve curve)
 {
     return(AreIntersecting(this, curve));
 }