private static double pointsDistance(Point a,Point b){
  int dx=b.x - a.x;
  int dy=b.y - a.y;
  return Math.sqrt(dx * dx + dy * dy);
}

private static double pointsDistance ( Point a , Point b ) { int dx = b . x - a . x ; int dy = b . y - a . y ; return Math . sqrt ( dx * dx + dy * dy ) ; }
calculate distance of two points
