mc_trajectory::LinearInterpolation< T > Struct Template Reference

#include <mc_trajectory/LinearInterpolation.h>

Public Member Functions

operator() (const T &v1, const T &v2, double t) const
 Linear interpolation between two values. More...
 

Member Function Documentation

◆ operator()()

template<typename T >
T mc_trajectory::LinearInterpolation< T >::operator() ( const T &  v1,
const T &  v2,
double  t 
) const
inline

Linear interpolation between two values.

\[ f(t) = (1 - t) * v_1 + t * v_2; \]

Template Parameters
Tvalue type, must support multiplication with scalar and addition with T
Parameters
v1First value
v2Second value
tInterpolation ratio between 0 and 1
Returns
  • v1 for t = 0
  • v2 for t = 1
  • value linearly interpolated between v1 and v2 otherwise

The documentation for this struct was generated from the following file: