distanceXY method

num distanceXY (
  1. num x,
  2. num y
)

Implementation

num distanceXY(num x, num y) {
  var xd = this.x - x;
  var yd = this.y - y;
  return sqrt(xd * xd + yd * yd);
}