public boolean projectionIsOnLine(Point point) {
            double distance = rawDistanceToPoint(point);
            Point normal = new Point(pA.getY() - pB.getY(), pA.getX() - pB.getX());
            normal.divide(distance(normal, new Point(0, 0)));
            Point pointOnLine = point.add(normal.multiply(distance));
            if (Math.abs(f(pointOnLine)) > 0.01) {
                normal = normal.multiply(-1);
                pointOnLine = point.add(normal.multiply(distance));
            }
            if (((pA.getX() <= pointOnLine.getX() && pointOnLine.getX() <= pB.getX()) || ((pA.getX() >= pointOnLine.getX() && pointOnLine.getX() >= pB.getX())) &&
                    ((pA.getY() <= pointOnLine.getY() && pointOnLine.getY() <= pB.getY()) || pA.getY() >= pointOnLine.getY() && pointOnLine.getY() >= pB.getY()))) {
                return true;
            }
            return false;
        }