]> git.mxchange.org Git - simgear.git/blob - simgear/math/Math.hxx
Allow geocentric distance computations to return radians.
[simgear.git] / simgear / math / Math.hxx
1 #ifndef SIMGEAR_MATH_MATH_HXX
2 #define SIMGEAR_MATH_MATH_HXX 1
3 namespace simgear
4 {
5 namespace math
6 {
7 /** Linear interpolation between two values.
8  */
9 template<typename T>
10 inline T lerp(const T& x, const T& y, double alpha)
11 {
12     return x * (1.0 - alpha) + y * alpha;
13 }
14
15 template<typename T>
16 inline T lerp(const T& x, const T& y, float alpha)
17 {
18     return x * (1.0f - alpha) + y * alpha;
19 }
20
21 }
22 }
23 #endif