Ejemplo 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());
 }
Ejemplo 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);
 }