Skip to main content

utils.projectPointOntoCurve()

The utils.projectPointOntoCurve() function finds the closest point to p on the Bézier curve defined by from, to and two control points.

note

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

Signature

Point utils.projectPointOntoCurve(
Point p,
Point from,
Point cp1,
Point cp2,
Point to
)

Example

A Utils.projectPointOntoCurve() example