project

open fun project(query: Vector2d, init: Double = 0.0): Double

Projects a query position onto the path using Newton's method.

Finds the arc length parameter where the path's position component is closest to the query point. Note that this projection only considers position, not heading.

Return

The arc length parameter at the closest point on the path to the query

Parameters

query

The 2D position to project onto the path

init

Initial guess for the arc length parameter (default: 0.0)