public static float DistanceSquared(Vec2 a, Vec2 b) { Vec2 c = a - b; return(Vec2.Dot(c, c)); }
/// <summary> /// Perform the cross product on two vectors. In 2D this produces a scalar. /// </summary> public static float Cross(Vec2 a, Vec2 b) { return(a.X * b.Y - a.Y * b.X); }
public static float Distance(Vec2 a, Vec2 b) { Vec2 c = a - b; return(c.Length()); }
/// <summary> /// Peform the dot product on two vectors. /// </summary> public static float Dot(Vec2 a, Vec2 b) { return(a.X * b.X + a.Y * b.Y); }