/// <summary>
        /// Finds the point on this spline that minimises a given distance function
        /// </summary>
        /// <param name="distance"> Distance function </param>
        /// <param name="iterations"> Number of iterations (accuracy). 5 is pretty good. </param>
        /// <returns> Returns the time on the spline of the closest point </returns>
        public override float FindClosestPoint( DistanceToPointDelegate distance, int iterations )
        {
            DistanceCalculator calculator = new DistanceCalculator( distance );

            float closestFraction = 0;
            int numControlPoints = ControlPoints.Count;

            Evaluator eval = new Evaluator( );

            for ( int cpIndex = 0; cpIndex < numControlPoints; ++cpIndex )
            {
                MakeEvaluator( ref eval, this, cpIndex );
                closestFraction = calculator.GetClosestPointInInterval( eval, 1.0f, iterations );
            }

            return closestFraction;
        }