public static double getProjectionFactorToSegment(
            final double pFromX, final double pFromY,
            final double pAX, final double pAY, final double pBX, final double pBY
    ) {
        final double result = getProjectionFactorToLine(pFromX, pFromY, pAX, pAY, pBX, pBY);
        if (result < 0) {
            return 0;
        }
        if (result > 1) {
            return 1;
        }
        return result;
    }
public static double getProjectionFactorToSegment ( final double pFromX , final double pFromY , final double pAX , final double pAY , final double pBX , final double pBY ) { final double result = getProjectionFactorToLine ( pFromX , pFromY , pAX , pAY , pBX , pBY ) ; if ( result < 0 ) { return 0 ; } if ( result > 1 ) { return 1 ; } return result ; }
@since 6.0.3
Projection factor on segment AB from a point
@return [0,1]; 0 if projected to A, 1 if projected to B