From 4d5e0dd8f2c59a02f2f8479221c9b0e4bdd2377b Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Sun, 14 Apr 2024 22:35:54 +0300 Subject: [PATCH] Add unit vectors to QVec2. --- Quik/QuikGeometry.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Quik/QuikGeometry.cs b/Quik/QuikGeometry.cs index 2d5ed26..575e304 100644 --- a/Quik/QuikGeometry.cs +++ b/Quik/QuikGeometry.cs @@ -12,7 +12,7 @@ namespace Quik { public float X; public float Y; - + public float Magnitude => MathF.Sqrt(X * X + Y * Y); public QVec2(float x, float y) @@ -92,6 +92,10 @@ namespace Quik { 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); } ///