curve.closestPointLength(point [, opt])
Return the length of the curve up to the point that lies closest to point
.
The function uses the same algorithm as the curve.closestPointT()
function. The length of the curve at t
closest to point
is returned.
The default value for opt.precision
is 3; this corresponds to maximum observed error of 0.1%.
The opt.subdivisions
property may be specified, directly providing an array of pre-computed curve subdivisions with which to begin the algorithm. Use the curve.getSubdivisions()
function to obtain an array of curve subdivisions. The opt.precision
property is still necessary, however; it determines the precision of the point search algorithm.