CTRE Phoenix C++ 5.33.1
LinearInterpolation.h
Go to the documentation of this file.
1/* Copyright (C) Cross The Road Electronics 2024 */
2#pragma once
3
4namespace ctre {
5namespace phoenix {
6
7/**
8 * Class to calculate linear interpolation
9 */
11public:
12 /**
13 * Calculates the linear interpolation of x
14 * @param x value to interpolate between
15 * @param x1 min x value
16 * @param y1 y value that corresponds to x1
17 * @param x2 max x value
18 * @param y2 y value that corresponds to x2
19 * @return interpolated point
20 */
21 static float Calculate(float x, float x1, float y1, float x2, float y2);
22};
23
24}}
25
Class to calculate linear interpolation.
Definition: LinearInterpolation.h:10
static float Calculate(float x, float x1, float y1, float x2, float y2)
Calculates the linear interpolation of x.
namespace ctre
Definition: paramEnum.h:5