distanceTo method

double distanceTo(
  1. Position<num> other
)

Returns the distance between this position and other

Implementation

double distanceTo(Position other) {
  return sqrt((x - other.x) * (x - other.x) + (y - other.y) * (y - other.y));
}