private float distance(float x0,float x1,float y0,float y1){
  float x=x0 - x1;
  float y=y0 - y1;
  return (float)Math.sqrt(x * x + y * y);
}

private float distance ( float x0 , float x1 , float y0 , float y1 ) { float x = x0 - x1 ; float y = y0 - y1 ; return ( float ) Math . sqrt ( x * x + y * y ) ; }
pythagoras distance between two points .
