blob: dc5c358e8e6b4ed6375473410acbf8749ab9efaa [file] [log] [blame]
Brian Silverman890a32a2018-03-11 15:41:56 -07001#include "ctre/phoenix/LinearInterpolation.h"
2
3namespace ctre {
4namespace phoenix {
5float 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}