Пример #1
0
        /// <summary>
        /// Return the angular difference between this and another angle
        /// </summary>
        /// <param name="value"></param>
        /// <param name="other"></param>
        /// <returns></returns>
        public static Double AngularDifference(this Double value, Double other, SpinDirection direction = SpinDirection.None)
        {
            Double diff = 0;

            if (direction == SpinDirection.None)
            {
                diff = Degrees.AngularDifference(value, other);
            }
            else if (direction == SpinDirection.Clockwise)
            {
                diff = other - value;
                if (diff < 0)
                {
                    diff += 360;
                }
            }
            else if (direction == SpinDirection.CounterClockwise)
            {
                diff = value - other;
                if (diff < 0)
                {
                    diff += 360;
                }
            }
            return(diff);
        }