Theoretica
A C++ numerical and automatic mathematical library
splines.h File Reference

Spline interpolation. More...

Go to the source code of this file.

Classes

struct  theoretica::spline_node
 A cubic splines node for a given x interval. More...
 
class  theoretica::spline
 A natural cubic spline interpolation class. More...
 

Namespaces

 theoretica
 Main namespace of the library which contains all functions and objects.
 

Functions

real theoretica::lerp (real x1, real x2, real interp)
 Linear interpolation.
 
template<unsigned int N>
vec< real, N > theoretica::lerp (const vec< real, N > &P1, const vec< real, N > &P2, real interp)
 Linear interpolation.
 
real theoretica::invlerp (real x1, real x2, real value)
 Inverse linear interpolation.
 
template<unsigned int N>
vec< real, N > theoretica::invlerp (const vec< real, N > &P1, const vec< real, N > &P2, real value)
 Inverse linear interpolation.
 
real theoretica::remap (real iFrom, real iTo, real oFrom, real oTo, real value)
 Remap a value from one range to another.
 
template<unsigned int N>
vec< real, N > theoretica::remap (const vec< real, N > &iFrom, const vec< real, N > &iTo, const vec< real, N > &oFrom, const vec< real, N > &oTo, real value)
 Remap a vector value from one range to another.
 
template<unsigned int N>
vec< real, N > theoretica::nlerp (const vec< real, N > &P1, const vec< real, N > &P2, real interp)
 Normalized linear interpolation.
 
template<unsigned int N>
vec< real, N > theoretica::slerp (const vec< real, N > &P1, const vec< real, N > &P2, real t)
 Spherical interpolation.
 
real theoretica::smoothstep (real x1, real x2, real interp)
 Smoothstep interpolation.
 
real theoretica::smootherstep (real x1, real x2, real interp)
 Smootherstep interpolation.
 
template<unsigned int N>
vec< real, N > theoretica::quadratic_bezier (const vec< real, N > &P0, const vec< real, N > &P1, const vec< real, N > &P2, real t)
 Quadratic Bezier curve.
 
template<unsigned int N>
vec< real, N > theoretica::cubic_bezier (const vec< real, N > &P0, const vec< real, N > &P1, const vec< real, N > &P2, vec< real, N > P3, real t)
 Cubic Bezier curve.
 
template<unsigned int N>
vec< real, N > theoretica::bezier (const std::vector< vec< real, N >> &points, real t)
 Generic Bezier curve in N dimensions. More...
 
template<typename DataPoints = std::vector<vec2>>
std::vector< spline_node > theoretica::cubic_splines (DataPoints p)
 Compute the cubic splines interpolation of a set of data points. More...
 
template<typename Dataset1 , typename Dataset2 >
std::vector< spline_node > theoretica::cubic_splines (const Dataset1 &x, const Dataset2 &y)
 Compute the cubic splines interpolation of the sets of X and Y data points. More...
 

Detailed Description

Spline interpolation.