forked from MoonsideGames/MoonWorks
add Vector2.Angle
parent
ec5160c060
commit
08a3c01f66
|
@ -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"/>]}
|
||||
|
|
Loading…
Reference in New Issue