feat: Vector2D Magnitude & MagnitudeSquared & Normalized Fields
This commit is contained in:
parent
3ddf6748e2
commit
30102f142c
|
@ -5,6 +5,10 @@ namespace Syntriax.Engine.Physics2D.Primitives;
|
|||
[System.Diagnostics.DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)},nq}}")]
|
||||
public record Vector2D(float X, float Y)
|
||||
{
|
||||
public float Magnitude => Length(this);
|
||||
public float MagnitudeSquared => LengthSquared(this);
|
||||
public Vector2D Normalized => Normalize(this);
|
||||
|
||||
public readonly static Vector2D Up = new(0f, 1f);
|
||||
public readonly static Vector2D Down = new(0f, -1f);
|
||||
public readonly static Vector2D Left = new(-1f, 0f);
|
||||
|
|
Loading…
Reference in New Issue