Skip to main content

spline3_hermite_nearest_point

Functions

Helper to evaluate a polynomial given its coefficients.

Finds the parameter 't' of the nearest point on a 1D Hermite spline function graph to a reference point. The curve is defined by (t, p(t)). This version is optimized to avoid allocations.

polyval(p, t, size) ⇒ number

Helper to evaluate a polynomial given its coefficients.

Kind: global function

ParamTypeDescription
pFloat32ArrayPolynomial coefficients [c0, c1, c2, ...]
tnumberThe value at which to evaluate.
sizenumber

spline3_hermite_nearest_point(ref_t, ref_p, p0, p1, m0, m1) ⇒ number

Finds the parameter 't' of the nearest point on a 1D Hermite spline function graph to a reference point. The curve is defined by (t, p(t)). This version is optimized to avoid allocations.

Kind: global function
Returns: number - The parameter 't' of the nearest point. This value is always in [0..1] range

ParamTypeDescription
ref_tnumberThe 't' coordinate of the reference point.
ref_pnumberThe 'p' coordinate of the reference point.
p0numberThe start value of the spline (at t=0).
p1numberThe end value of the spline (at t=1).
m0numberThe tangent at the start.
m1numberThe tangent at the end.