gl3n

gl3n.interpolate

Authors
David Herberth
License
MIT

T interp(T)(T a, T b, float t);
alias interp_linear = interp(T)(T a, T b, float t);
alias lerp = interp(T)(T a, T b, float t);
alias mix = interp(T)(T a, T b, float t);

Interpolates linear between two points, also known as lerp.


T interp_spherical(T)(T a, T b, float t);
alias slerp = interp_spherical(T)(T a, T b, float t) if (is_vector!(T) || is_quaternion!(T));

Interpolates spherical between to vectors or quaternions, also known as slerp.


T interp_nearest(T)(T x, T y, float t);

Nearest interpolation of two points.


T interp_catmullrom(T)(T p0, T p1, T p2, T p3, float t);

Catmull-rom interpolation between four points.


T catmullrom_derivative(T)(T p0, T p1, T p2, T p3, float t);

Catmull-derivatives of the interpolation between four points.


T interp_hermite(T)(T x, T tx, T y, T ty, float t);

Hermite interpolation (cubic hermite spline).