Esempio n. 1
0
 /// <summary>
 /// Compute the distance between two vectors.
 /// </summary>
 /// <param name="v">The other vector.</param>
 /// <returns>The distance between the two vectors.</returns>
 public float distance(ref IntVector2 v)
 {
     return((v - this).length());
 }
Esempio n. 2
0
 /// <summary>
 /// Compute the dot product of this vector and another.
 /// </summary>
 /// <param name="v">The other vector.</param>
 /// <returns>The dot product.</returns>
 public int dot(ref IntVector2 v)
 {
     return(x * v.x + y * v.y);
 }