Nez.Portable/Utils/Extensions/Vector2Ext.cs
/// <summary>
/// returns the angle between the two vectors in degrees
/// </summary>
/// <param name="from">From.</param>
/// <param name="to">To.</param>
returns the angle between the two vectors in degrees
returns the angle between the two vectors in degrees
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static float angle(Vector2 from, Vector2 to)
        {
            normalize(ref from);
            normalize(ref to);
            return Mathf.acos(Mathf.clamp(Vector2.Dot(from, to), -1f, 1f)) * Mathf.rad2Deg;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static float angle ( Vector2 from , Vector2 to ) { normalize ( ref from ) ; normalize ( ref to ) ; return Mathf . acos ( Mathf . clamp ( Vector2 . Dot ( from , to ) , - 1f , 1f ) ) * Mathf . rad2Deg ; }
returns the angle between the two vectors in degrees
returns the angle between the two vectors in degrees
from
Vector2
None
to
Vector2
None