prime-splines
Spline math — Bezier (quadratic, cubic), Hermite, Catmull-Rom, B-spline, slerp, arc length, and uniform-speed parameterization. Scalar and 3D variants.
Part of the prime math ecosystem.
What's inside
bezier_quadratic/bezier_cubic— Bezier curves (scalar + 3D)hermite/hermite_3d— Hermite interpolation with tangentscatmull_rom/catmull_rom_3d— smooth pass-through splinesb_spline_cubic/b_spline_cubic_3d— B-spline curvesslerp— spherical linear interpolation for rotationsbezier_cubic_arc_length— arc length approximationbezier_cubic_t_at_length— uniform-speed parameterization
Usage
use ;
use Vec3;
// Smooth path through control points
let pos = catmull_rom_3d;
// Spherical interpolation between directions
let dir = slerp;
// Move at constant speed along a bezier
let uniform_t = bezier_cubic_t_at_length_3d;
License
MIT