UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

15 lines 862 B
/** * 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. * * @param {number} ref_t - The 't' coordinate of the reference point. * @param {number} ref_p - The 'p' coordinate of the reference point. * @param {number} p0 - The start value of the spline (at t=0). * @param {number} p1 - The end value of the spline (at t=1). * @param {number} m0 - The tangent at the start. * @param {number} m1 - The tangent at the end. * @returns {number} The parameter 't' of the nearest point. This value is always in [0..1] range */ export function spline3_hermite_nearest_point(ref_t: number, ref_p: number, p0: number, p1: number, m0: number, m1: number): number; //# sourceMappingURL=spline3_hermite_nearest_point.d.ts.map