src/main/java/de/javagl/geom/Projections.java
/**
     * Drop the perpendicular on the line p0-p1 from the point p 
     * and store the result in the given point and return it. 
     * If the given result point is <code>null</code>, then a new 
     * point will be created and returned
     * 
     * @param p0 The start point of the line
     * @param p1 The end point of the line
     * @param p The point to drop from
     * @param result The point that will store the result
     * @return The result
     */
Drop the perpendicular on the line p0-p1 from the point p
and store the result in the given point and return it.
If the given result point is null, then a new
point will be created and returned


Drop the perpendicular on the line p0 - p1 from the point p and store the result in the given point and return it . If the given result point is null then a new point will be created and returned
public static Point2D dropPerpendicular(
        Point2D p0, Point2D p1, Point2D p, Point2D result)
    {
        return dropPerpendicular(
            p0.getX(), p0.getY(),
            p1.getX(), p1.getY(),
            p.getX(), p.getY(), result);
    }
public static Point2D dropPerpendicular ( Point2D p0 , Point2D p1 , Point2D p , Point2D result ) { return dropPerpendicular ( p0 . getX ( ) , p0 . getY ( ) , p1 . getX ( ) , p1 . getY ( ) , p . getX ( ) , p . getY ( ) , result ) ; }
Drop the perpendicular on the line p0-p1 from the point p
 and store the result in the given point and return it.
Drop the perpendicular on the line p0 - p1 from the point p and store the result in the given point and return it .