public static float DotProduct(Vector2 left, Vector2 right) { return(left.DotProduct(right)); }
public static Vector2 CrossProduct(Vector2 left, Vector2 right) { return(left.CrossProduct(right)); }
/// <summary> /// Crosses the product. /// </summary> /// <param name="vec">The vec.</param> /// <returns></returns> public Vector2 CrossProduct(Vector2 vec) { return(new Vector2(X * vec.Y - Y * vec.X, Y * vec.Y - X * vec.X)); }
public static float Distance(Vector2 left, Vector2 right) { return(left.DistanceTo(right)); }
/// <summary> /// Dots the product. /// </summary> /// <param name="vec">The vec.</param> /// <returns></returns> public float DotProduct(Vector2 vec) { return(X * vec.X + Y * vec.Y); }
/// <summary> /// Distances to. /// </summary> /// <param name="vec">The vec.</param> /// <returns></returns> public float DistanceTo(Vector2 vec) { return((this - vec).Length()); }
/// <summary> /// Multiplies the specified vec. /// </summary> /// <param name="vec">The vec.</param> public void Multiply(Vector2 vec) { X *= vec.X; Y *= vec.Y; }
/// <summary> /// Subtracts the specified vec. /// </summary> /// <param name="vec">The vec.</param> public void Subtract(Vector2 vec) { X -= vec.X; Y -= vec.Y; }
/// <summary> /// Adds the specified vec. /// </summary> /// <param name="vec">The vec.</param> public void Add(Vector2 vec) { X += vec.X; Y += vec.Y; }