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; } }
public static Vector Subtract(Vector v1, Vector v2) { return new Vector(v1.X - v2.X, v1.Y - v2.Y); }
public static double Dot(Vector v1, Vector v2) { return v1.X * v2.X + v1.Y * v2.Y; }