Пример #1
0
 public static double SmallerAngleBetween(Vector v1, Vector v2)
 {
     double diff = v1.Angle() - v2.Angle();
     if (diff < -180)
     {
         return diff + 360;
     }
     else if (diff > 180)
     {
         return diff - 360;
     }
     else
     {
         return diff;
     }
 }
Пример #2
0
 public static Vector Subtract(Vector v1, Vector v2)
 {
     return new Vector(v1.X - v2.X, v1.Y - v2.Y);
 }
Пример #3
0
 public static double Dot(Vector v1, Vector v2)
 {
     return v1.X * v2.X + v1.Y * v2.Y;
 }