Skip to main content

utils.projectPointOntoLine()

The utils.projectPointOntoLine() function finds the closest point to p on the line between from and to.

note

The line between the given point and the returned point will always be either perpendicular to the line or go to an endpoint.

Signature

Point utils.projectPointOntoLine(
Point p,
Point from,
Point to
)

Example

A Utils.projectPointOntoLine() example