예제 #1
0
 /// <summary>
 /// Calculates the euclidean distance to the specified other click.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns></returns>
 public int Distance(Hover other)
 {
     if (X == null || Y == null ||
         other.X == null || other.Y == null)
     {
         return(-1);
     }
     return((int)Math.Sqrt(Math.Pow(X.Value - other.X.Value, 2) + Math.Pow(Y.Value - other.Y.Value, 2)));
 }
예제 #2
0
 /// <summary>
 /// Determines whether the mouse positions are roughly the same.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns>
 ///   <c>true</c> if the mouse positions are roughly the same; otherwise, <c>false</c>.
 /// </returns>
 public bool IsSamePosition(Hover other)
 {
     return(Distance(other) < MAX_UNCERTAINTY);
 }