question: protected MutableCoord calculatePointOnLine ( MutableCoord P1 , MutableCoord P2 , MutableCoord P3 ) { double rel = calculateRelation ( P1 , P2 , P3 ) ; double dx = Math . abs ( P1 . getX ( ) - P2 . getX ( ) ) , dy = Math . abs ( P1 . getY ( ) - P2 . getY ( ) ) ; double nx = P1 . getX ( ) + dx * rel , ny = P1 . getY ( ) + dy * rel ; if ( P1 . getX ( ) > P2 . getX ( ) ) nx = P1 . getX ( ) - dx * rel ; if ( P1 . getY ( ) > P2 . getY ( ) ) ny = P1 . getY ( ) - dy * rel ; MutableCoord result = new MutableCoord ( nx , ny ) ; return result ; }
target:  Calculates the point where P3 is proyected on the line formed by the points P1 and P2