Beispiel #1
0
        public static void Normalize(Vector2f v)
        {
            var magnitude = InternalMagnitude(v);
            var normalized = v / magnitude;

            InternalSet(v, normalized._x, normalized._y);
        }
Beispiel #2
0
 private static void InternalSet(Vector2f v, float x, float y)
 {
     v._x = x;
     v._y = y;
 }
Beispiel #3
0
 private static double InternalMagnitude(Vector2f v)
 {
     return Math.Sqrt((v._x * v._x) + (v._y * v._y));
 }
Beispiel #4
0
 public static void Set(Vector2f v, float x, float y)
 {
     InternalSet(v, x, y);
 }
Beispiel #5
0
 public static float ReadY(Vector2f v)
 {
     return v._y;
 }
Beispiel #6
0
 public static float ReadX(Vector2f v)
 {
     return v._x;
 }
Beispiel #7
0
 public static double Magnitude(Vector2f v)
 {
     return InternalMagnitude(v);
 }