public Vec2(Vec2 vec) { this.X = vec.X; this.Y = vec.Y; }
public bool Equals(Vec2 other) { return(X.Equals(other.X) && Y.Equals(other.Y)); }
public static double DistanceSq(Vec2 a, Vec2 b) { return((a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y)); }
public static Vec2 Cross(double s, Vec2 a) { a.X *= s; a.Y *= -s; return(a); }
public static Vec2 Cross(Vec2 a, double s) { a.X *= -s; a.Y *= s; return(a); }
public static double Cross(Vec2 a, Vec2 b) { return(a.X * b.Y - a.Y * b.X); }
public static double Dot(Vec2 a, Vec2 b) { return(a.X * b.X + a.Y * b.Y); }