public static double distance(VisualItem vi1,VisualItem vi2){
  double dx=vi1.getX() - vi2.getX();
  double dy=vi1.getY() - vi2.getY();
  return Math.sqrt(dx * dx + dy * dy);
}

public static double distance ( VisualItem vi1 , VisualItem vi2 ) { double dx = vi1 . getX ( ) - vi2 . getX ( ) ; double dy = vi1 . getY ( ) - vi2 . getY ( ) ; return Math . sqrt ( dx * dx + dy * dy ) ; }
get the distance between the x , y points of two visualitems .
