LineSegment: segIntersection (cont)
int minx1 = Math.min(x1, x2);
if (x < minx1) return null;
int maxx1 = Math.max(x1, x2);
if (x > maxx1) return null;
int miny1 = Math.min(y1, y2);
if (y < miny1) return null;
int maxy1 = Math.max(y1, y2);
if (y > maxy1) return null;
int minx2 = Math.min(x3, x4);
if (x < minx2) return null;
int maxx2 = Math.max(x3, x4);
if (x > maxx2) return null;
int miny2 = Math.min(y3, y4);
if (y < miny2) return null;
int maxy2 = Math.max(y3, y4);
if (y > maxy2) return null;
return new LSPoint(x, y);