class GeometryUtils {

    public static double calculateLineBearing(final Line line,
                                              final BearingDirection dir, final int pointDistance,
                                              final int projectionAlongLine) {
        if (line == null || projectionAlongLine < 0 || projectionAlongLine > line.getLineLength()) {
            return -1.0;
        }

        GeoCoordinates p1 = line.getGeoCoordinateAlongLine(projectionAlongLine);
        GeoCoordinates p2;
        if (dir == BearingDirection.IN_DIRECTION) {
            p2 = bearingPointCalculator.calculateBearingDestinationInDirection(line, pointDistance, projectionAlongLine);
        } else {
            p2 = bearingPointCalculator.calculateBearingDestinationAgainstDirection(line, pointDistance, projectionAlongLine);

        }

        return bearing(p1, p2);
    }

    private  GeometryUtils();

}