@thi.ng/ramp
Version:
Extensible keyframe interpolation/tweening of arbitrary, nested types
32 lines • 1.13 kB
TypeScript
import type { Vec } from "@thi.ng/vectors";
import type { Frame, RampImpl, RampOpts, VecAPI } from "./api.js";
import { Ramp } from "./ramp.js";
/**
* Syntax sugar for creating a numeric {@link Ramp} using the {@link HERMITE_N}
* ramp hermite spline interpolation impl and given stops (aka keyframes,
* minimum 2 required).
*
* @remarks
* For vector-valued hermite ramps, use {@link ramp} with {@link HERMITE_V}.
*
* Reference:
* https://en.wikipedia.org/wiki/Cubic_Hermite_spline
*
* Also see:
*
* - https://docs.thi.ng/umbrella/math/functions/mixCubicHermite.html
* - https://docs.thi.ng/umbrella/math/functions/tangentCardinal.html
*
* @param stops
* @param opts
*/
export declare const hermite: (stops: Frame<number>[], opts?: Partial<RampOpts>) => Ramp<number>;
export declare const HERMITE_N: RampImpl<number>;
/**
* Vector version of {@link HERMITE_N}. Use with any of the supplied vector APIs:
* {@link VEC} (arbitrary size), {@link VEC2}, {@link VEC3} or {@link VEC4}.
*
* @param vec
*/
export declare const HERMITE_V: <T extends Vec>(vec: VecAPI) => RampImpl<T>;
//# sourceMappingURL=hermite.d.ts.map