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