add Vector2.Angle

pull/18/head
cosmonaut 2022-03-31 15:31:53 -07:00
parent ec5160c060
commit 08a3c01f66
1 changed files with 8 additions and 0 deletions

View File

@ -204,6 +204,14 @@ namespace MoonWorks.Math
Y *= val;
}
/// <summary>
/// Turns this <see cref="Vector2"/> to an angle in radians.
/// </summary>
public float Angle()
{
return MathF.Atan2(Y, X);
}
/// <summary>
/// Returns a <see cref="String"/> representation of this <see cref="Vector2"/> in the format:
/// {X:[<see cref="X"/>] Y:[<see cref="Y"/>]}