private int distance2(Point p0,Point p1){
  int d0=Math.abs(p0.x - p1.x);
  int d1=Math.abs(p0.y - p1.y);
  return d0 * d0 + d1 * d1;
}

private int distance2 ( Point p0 , Point p1 ) { int d0 = Math . abs ( p0 . x - p1 . x ) ; int d1 = Math . abs ( p0 . y - p1 . y ) ; return d0 * d0 + d1 * d1 ; }
returns the distance to the power of 2 between two points
