// Returns the larger distance between the two values.
    public static float GetLargerDistance(float value1, float value2, IntervalFloat interval)
    {
        float distance = GetSomeDistance(value1, value2, interval);

        if (distance <= interval.GetCenter())
        {
            return(interval.GetDiameter() - distance);
        }
        else
        {
            return(distance);
        }
    }
    // Moves the given value into the range, preserving the value's position in the period.
    public static float MoveIntoInterval(float value, IntervalFloat interval)
    {
        float start    = interval.GetStart();
        float end      = interval.GetEnd();
        float diameter = interval.GetDiameter();

        while (value >= end)
        {
            value -= diameter;
        }
        while (value < start)
        {
            value += diameter;
        }
        return(value);
    }