Skip to main content

Path.projectPoint()

The Path.projectPoint() function calculates and returns the point on this path that is closest to the given point. If multiple points have the same distance, which of these nearest points is chosen is not defined.

note

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

Signature

Point Path.projectPoint(
Point p,
)

Example

A Path.projectPoint() example