Add unit vectors to QVec2.
This commit is contained in:
parent
f07208ebe9
commit
4d5e0dd8f2
@ -12,7 +12,7 @@ namespace Quik
|
|||||||
{
|
{
|
||||||
public float X;
|
public float X;
|
||||||
public float Y;
|
public float Y;
|
||||||
|
|
||||||
public float Magnitude => MathF.Sqrt(X * X + Y * Y);
|
public float Magnitude => MathF.Sqrt(X * X + Y * Y);
|
||||||
|
|
||||||
public QVec2(float x, float y)
|
public QVec2(float x, float y)
|
||||||
@ -92,6 +92,10 @@ namespace Quik
|
|||||||
{
|
{
|
||||||
return $"({X}; {Y})";
|
return $"({X}; {Y})";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly QVec2 Zero = new QVec2(0, 0);
|
||||||
|
public static readonly QVec2 UnitX = new QVec2(1, 0);
|
||||||
|
public static readonly QVec2 UnitY = new QVec2(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user