Example #1
0
 /// <summary>
 ///     Determines the distance to another <code>Location</code>.
 /// </summary>
 /// <param name="other">The other <code>Location</code> to calculate the distance from.
 public double Distance2D(Location other)
 {
     return Math.Sqrt(Math.Pow(X - other.X, 2) + Math.Pow(Y - other.Y, 2));
 }
Example #2
0
 /// <summary>
 ///     Distances to.
 /// </summary>
 /// <param name="loc">The loc.</param>
 /// <returns>System.Double.</returns>
 public double DistanceTo(Location loc)
 {
     return
         Math.Sqrt(Math.Pow(X - loc.X, 2) + Math.Pow(Y - loc.Y, 2) +
             Math.Pow(Z - loc.Z, 2));
 }