Definition at line 9 of file Util.h.
double Util::DegreesToRadians |
( |
double |
theta | ) |
|
|
static |
Convert any angle theta in degrees to radians.
Definition at line 4 of file Util.cpp.
6 return theta * (2 * wpi::math::pi) / 360.0;
double Util::RadiansToDegrees |
( |
double |
theta | ) |
|
|
static |
Convert any angle theta in radians to degrees.
Definition at line 9 of file Util.cpp.
11 return theta * 360.0 / (2 * wpi::math::pi);
double Util::ZeroTo2PiRads |
( |
double |
theta | ) |
|
|
static |
Convert any angle theta in radians to its equivalent on the interval [0, 2pi]
- Parameters
-
theta | any angle in radians |
- Returns
- any angle within the interval [0, 2pi]
Definition at line 15 of file Util.cpp.
17 theta = fmod(theta, 2 * wpi::math::pi);
19 theta += 2 * wpi::math::pi;
double Util::ZeroTo360Degs |
( |
double |
theta | ) |
|
|
static |
Convert any angle theta in degrees to its equivalent on the interval [0, 360]
- Parameters
-
theta | any angle in degrees |
- Returns
- any angle within the interval [0, 360]
Definition at line 25 of file Util.cpp.
27 theta = fmod(theta, 360.0);
double Util::NegPiToPiRads |
( |
double |
theta | ) |
|
|
static |
Convert any angle theta in radians to its equivalent on the interval [-pi, pi]
- Parameters
-
theta | any angle in radians |
- Returns
- any angle within the interval [-pi, pi]
Definition at line 35 of file Util.cpp.
References ZeroTo2PiRads().
38 if (theta > wpi::math::pi)
39 theta -= 2 * wpi::math::pi;
40 else if (theta < -1.0 * wpi::math::pi)
41 theta += 2 * wpi::math::pi;
static double ZeroTo2PiRads(double theta)
double Util::GetAverage |
( |
vector< double > |
numbers | ) |
|
|
static |
Get the average of a double vector
- Parameters
-
- Returns
- average of doubles in vector
Definition at line 46 of file Util.cpp.
50 for (
auto n : numbers)
53 return sum / numbers.size();
static double Util::Deadzone |
( |
double |
inputValue, |
|
|
double |
deadzone |
|
) |
| |
|
inlinestatic |
If an inputValue is smaller than its deadzone, returns 0, otherwise returns the inputValue.
Definition at line 39 of file Util.h.
42 return abs(inputValue) <= deadzone ? 0 : inputValue;
The documentation for this class was generated from the following files: