spline3_hermite_nearest_point
Functions
- polyval(p, t, size) ⇒
number
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
| Param | Type | Description |
|---|---|---|
| p | Float32Array | Polynomial coefficients [c0, c1, c2, ...] |
| t | number | The value at which to evaluate. |
| size | number |
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
| Param | Type | Description |
|---|---|---|
| ref_t | number | The 't' coordinate of the reference point. |
| ref_p | number | The 'p' coordinate of the reference point. |
| p0 | number | The start value of the spline (at t=0). |
| p1 | number | The end value of the spline (at t=1). |
| m0 | number | The tangent at the start. |
| m1 | number | The tangent at the end. |