Exemple #1
0
 public static float DotProduct(Vector2 left, Vector2 right)
 {
     return(left.DotProduct(right));
 }
Exemple #2
0
 public static Vector2 CrossProduct(Vector2 left, Vector2 right)
 {
     return(left.CrossProduct(right));
 }
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 public static float Distance(Vector2 left, Vector2 right)
 {
     return(left.DistanceTo(right));
 }
Exemple #5
0
 /// <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);
 }
Exemple #6
0
 /// <summary>
 ///     Distances to.
 /// </summary>
 /// <param name="vec">The vec.</param>
 /// <returns></returns>
 public float DistanceTo(Vector2 vec)
 {
     return((this - vec).Length());
 }
Exemple #7
0
 /// <summary>
 ///     Multiplies the specified vec.
 /// </summary>
 /// <param name="vec">The vec.</param>
 public void Multiply(Vector2 vec)
 {
     X *= vec.X;
     Y *= vec.Y;
 }
Exemple #8
0
 /// <summary>
 ///     Subtracts the specified vec.
 /// </summary>
 /// <param name="vec">The vec.</param>
 public void Subtract(Vector2 vec)
 {
     X -= vec.X;
     Y -= vec.Y;
 }
Exemple #9
0
 /// <summary>
 ///     Adds the specified vec.
 /// </summary>
 /// <param name="vec">The vec.</param>
 public void Add(Vector2 vec)
 {
     X += vec.X;
     Y += vec.Y;
 }