public static double getProjectionFactorToLine(
            final double pFromX, final double pFromY,
            final double pAX, final double pAY, final double pBX, final double pBY
    ) {
        if (pAX == pBX && pAY == pBY) {
            return 0;
        }
        return dotProduct(pAX, pAY, pBX, pBY, pFromX, pFromY)
                / getSquaredDistanceToPoint(pAX, pAY, pBX, pBY);
    }
@Test
    public void test_getProjectionFactorToLine() {
        final int xA = 100;
        final int yA = 200;
        Assert.assertEquals(0,
                Distance.getProjectionFactorToLine(xA, yA, xA, yA, xA, yA), mDelta);
        Assert.assertEquals(0,
                Distance.getProjectionFactorToLine(xA, yA, xA + 10, yA, xA + 10, yA), mDelta);
        Assert.assertEquals(0,
                Distance.getProjectionFactorToLine(xA, yA, xA, yA + 20, xA, yA + 20), mDelta);
        Assert.assertEquals(0,
                Distance.getProjectionFactorToLine(xA, yA + 20, xA, yA, xA + 100, yA), mDelta);
        Assert.assertEquals(-10. / 100, // < 0
                Distance.getProjectionFactorToLine(xA - 10, yA - 30, xA, yA, xA + 100, yA), mDelta);
        Assert.assertEquals(2, // > 1
                Distance.getProjectionFactorToLine(xA + 200, yA - 70, xA, yA, xA + 100, yA), mDelta);
        Assert.assertEquals(1, // 1
                Distance.getProjectionFactorToLine(xA + 200, yA - 7000, xA, yA, xA + 200, yA), mDelta);
        Assert.assertEquals(.2, // ]0,1[
                Distance.getProjectionFactorToLine(xA + 200, yA - 7000, xA, yA, xA + 1000, yA), mDelta);
    }