public static int intersectLineLine(Line2D a,Line2D b,Point2D intersect){
  double a1x=a.getX1(), a1y=a.getY1();
  double a2x=a.getX2(), a2y=a.getY2();
  double b1x=b.getX1(), b1y=b.getY1();
  double b2x=b.getX2(), b2y=b.getY2();
  return intersectLineLine(a1x,a1y,a2x,a2y,b1x,b1y,b2x,b2y,intersect);
}

public static int intersectLineLine ( Line2D a , Line2D b , Point2D intersect ) { double a1x = a . getX1 ( ) , a1y = a . getY1 ( ) ; double a2x = a . getX2 ( ) , a2y = a . getY2 ( ) ; double b1x = b . getX1 ( ) , b1y = b . getY1 ( ) ; double b2x = b . getX2 ( ) , b2y = b . getY2 ( ) ; return intersectLineLine ( a1x , a1y , a2x , a2y , b1x , b1y , b2x , b2y , intersect ) ; }
compute the intersection of two line segments .
