src/main/java/de/javagl/geom/Projections.java
/**
     * Drop the perpendicular on the line 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 line 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 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

@param line 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 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 @param line The line @param p The point to drop from @param result The point that will store the result @return The result
public static Point2D dropPerpendicular(
        Line2D line, Point2D p, Point2D result)
    {
        return dropPerpendicular(
            line.getX1(), line.getY1(), 
            line.getX2(), line.getY2(),
            p.getX(), p.getY(), result);
    }
public static Point2D dropPerpendicular ( Line2D line , Point2D p , Point2D result ) { return dropPerpendicular ( line . getX1 ( ) , line . getY1 ( ) , line . getX2 ( ) , line . getY2 ( ) , p . getX ( ) , p . getY ( ) , result ) ; }
Drop the perpendicular on the line from the point p and store
 the result in the given point and return it.
Drop the perpendicular on the line from the point p and store the result in the given point and return it .