distance method

double distance(
  1. Mappoint point
)

Calculates the Euclidean distance from this point to the given point.

Implementation

double distance(Mappoint point) {
  return sqrt((x - point.x) * (x - point.x) + (y - point.y) * (y - point.y));
}