Nez.Portable/Math/Mathf.cs
/// <summary>
/// Calculates the shortest difference between two given angles in degrees
/// </summary>
/// <returns>The angle.</returns>
/// <param name="current">Current.</param>
/// <param name="target">Target.</param>
Calculates the shortest difference between two given angles in degrees
Calculates the shortest difference between two given angles in degrees
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static float deltaAngle(float current, float target)
        {
            var num = Mathf.repeat(target - current, 360f);
            if (num > 180f)
                num -= 360f;
            return num;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static float deltaAngle ( float current , float target ) { var num = Mathf . repeat ( target - current , 360f ) ; if ( num > 180f ) num -= 360f ; return num ; }
Calculates the shortest difference between two given angles in degrees
Calculates the shortest difference between two given angles in degrees
None
current
float
None
target
float
None