Brian Silverman | 890a32a | 2018-03-11 15:41:56 -0700 | [diff] [blame] | 1 | #include "ctre/phoenix/LinearInterpolation.h" |
2 | |||||
3 | namespace ctre { | ||||
4 | namespace phoenix { | ||||
5 | float LinearInterpolation::Calculate(float x, float x1, float y1, float x2, | ||||
6 | float y2) { | ||||
7 | float m = (y2 - y1) / (x2 - x1); | ||||
8 | |||||
9 | float retval = m * (x - x1) + y1; | ||||
10 | return retval; | ||||
11 | } | ||||
12 | } | ||||
13 | } |