sorter.put(getDistance(aSegment, northWest), northWest);
sorter.put(getDistance(aSegment, southWest), southWest);
sorter.put(getDistance(aSegment, southEast), southEast);
sorter.put(getDistance(aSegment, northEast), northEast);
return ((OrientedPoint) sorter.get(sorter.firstKey())).getOrientation();
}
private static Double getDistance(Line2D aSegment, Point aPoint) {
double lenght1 = getLineLength(aSegment.getX1(), aSegment.getY1(), aPoint.getX(), aPoint.getY());