matchInSameDirection method
The coordinate pairs match if they define line segments lying in the same direction. E.g. the segments are parallel and in the same quadrant (as opposed to parallel and opposite!).
Implementation
bool matchInSameDirection(
Coordinate p0, Coordinate p1, Coordinate ep0, Coordinate ep1) {
if (!p0.equals(ep0)) return false;
if (Orientation.index(p0, p1, ep1) == Orientation.COLLINEAR &&
Quadrant.quadrantFromCoords(p0, p1) ==
Quadrant.quadrantFromCoords(ep0, ep1)) return true;
return false;
}