示例#1
0
 /// <summary>
 ///		Used to subtract a Vector2ii from another Vector2ii.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector2i Subtract(Vector2i left, Vector2i right)
 {
     return(left - right);
 }
示例#2
0
 /// <summary>
 ///		Used to negate the elements of a vector.
 /// </summary>
 /// <param name="left"></param>
 /// <returns></returns>
 public static Vector2i Negate(Vector2i left)
 {
     return(-left);
 }
示例#3
0
 /// <summary>
 ///		Used when a Vector2ii is multiplied by a scalar value.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="scalar"></param>
 /// <returns></returns>
 public static Vector2i Multiply(Vector2i left, int scalar)
 {
     return(left * scalar);
 }
示例#4
0
 /// <summary>
 ///		Used when a scalar value is multiplied by a Vector2ii.
 /// </summary>
 /// <param name="scalar"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector2i Multiply(int scalar, Vector2i right)
 {
     return(scalar * right);
 }
示例#5
0
 /// <summary>
 ///		Used when a Vector2ii is divided by another vector.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector2i Divide(Vector2i left, Vector2i right)
 {
     return(left / right);
 }
示例#6
0
 /// <summary>
 ///		Used when a Vector2ii is added to another Vector2ii.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector2i Add(Vector2i left, Vector2i right)
 {
     return(left + right);
 }
示例#7
0
 /// <summary>
 /// Used to divide a vector by a scalar value.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="scalar"></param>
 /// <returns></returns>
 public static Vector2i Divide(Vector2i left, int scalar)
 {
     return(left / scalar);
 }
示例#8
0
 /// <summary>
 ///		Used when a Vector2ii is multiplied by another vector.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector2i Multiply(Vector2i left, Vector2i right)
 {
     return(left * right);
 }
示例#9
0
 public static Real Dot(Vector2i p0, Vector2i p1)
 {
     return(p0.Dot(p1));
 }
示例#10
0
 /// <summary>
 /// Calculates the 2 dimensional dot-product of 2 vectors,
 /// which is equal to the cosine of the angle between the vectors, times the lengths of each of the vectors.
 /// A.Dot(B) == |A| * |B| * cos(fi)
 /// </summary>
 /// <param name="vector"></param>
 /// <returns></returns>
 public Real Dot(Vector2i vector)
 {
     return(this.X * vector.X + this.Y * vector.Y);
 }
示例#11
0
 /// <summary>
 /// Calculates the 2 dimensional cross-product of 2 vectors, which results
 /// in a Real value which is 2 times the area of the triangle
 /// defined by the two vectors. It also is the magnitude of the 3D vector that is perpendicular
 /// to the 2D vectors if the 2D vectors are projected to 3D space.
 /// </summary>
 /// <param name="vector"></param>
 /// <returns></returns>
 public Real Cross(Vector2i vector)
 {
     return(this.X * vector.Y - this.Y * vector.X);
 }