public static final Distance distanceToStartLine(Location current, Location portBuoy, Location starboardBuoy)
    {
        double dep = departure(portBuoy, starboardBuoy);
        double x0 = current.getLongitude()*dep;
        double y0 = current.getLatitude();
        double x1 = portBuoy.getLongitude()*dep;
        double y1 = portBuoy.getLatitude();
        double x2 = starboardBuoy.getLongitude()*dep;
        double y2 = starboardBuoy.getLatitude();

        double d = ((x2-x1)*(y1-y0)-(x1-x0)*(y2-y1))/Math.sqrt(Math.pow((x2-x1), 2)+Math.pow((y2-y1), 2));
        return new NauticalMile(60*d);
    }
public static final Distance distanceToStartLine ( Location current , Location portBuoy , Location starboardBuoy ) { double dep = departure ( portBuoy , starboardBuoy ) ; double x0 = current . getLongitude ( ) * dep ; double y0 = current . getLatitude ( ) ; double x1 = portBuoy . getLongitude ( ) * dep ; double y1 = portBuoy . getLatitude ( ) ; double x2 = starboardBuoy . getLongitude ( ) * dep ; double y2 = starboardBuoy . getLatitude ( ) ; double d = ( ( x2 - x1 ) * ( y1 - y0 ) - ( x1 - x0 ) * ( y2 - y1 ) ) / Math . sqrt ( Math . pow ( ( x2 - x1 ) , 2 ) + Math . pow ( ( y2 - y1 ) , 2 ) ) ; return new NauticalMile ( 60 * d ) ; }
@param current
@param portBuoy
@param starboardBuoy
@return
@see <a href="http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html">Point-Line Distance--2-Dimensional</a>