Пример #1
0
 //returns the length of the vector
 public static float Magnitude(this Vector2f v, Vector2f v2)
 {
     return(MathExtensions.Sqrt(v.X * v2.X + v.Y * v2.Y));
 }
Пример #2
0
 // returns the distance between this vector and the one passed as a parameter
 public static float Distance(this Vector2f v, Vector2f v2)
 {
     return(MathExtensions.Sqrt(Math.Pow(v.X - v2.X, 2) + Math.Pow(v.Y - v2.Y, 2)));
 }