WPILibC++ 2024.3.2
MathUtil.h File Reference
#include <numbers>
#include <type_traits>
#include <wpi/SymbolExports.h>
#include "units/angle.h"
#include "units/base.h"
#include "units/math.h"

Go to the source code of this file.

Namespaces

namespace  frc
 

Functions

template<typename T >
requires std::is_arithmetic_v<T> || units::traits::is_unit_t_v<T>
frc::ApplyDeadband (T value, T deadband, T maxMagnitude=T{1.0})
 Returns 0.0 if the given value is within the specified range around zero. More...
 
template<typename T >
constexpr T frc::InputModulus (T input, T minimumInput, T maximumInput)
 Returns modulus of input. More...
 
template<typename T >
requires std::is_arithmetic_v<T> || units::traits::is_unit_t_v<T>
constexpr bool frc::IsNear (T expected, T actual, T tolerance)
 Checks if the given value matches an expected value within a certain tolerance. More...
 
template<typename T >
requires std::is_arithmetic_v<T> || units::traits::is_unit_t_v<T>
constexpr bool frc::IsNear (T expected, T actual, T tolerance, T min, T max)
 Checks if the given value matches an expected value within a certain tolerance. More...
 
WPILIB_DLLEXPORT constexpr units::radian_t frc::AngleModulus (units::radian_t angle)
 Wraps an angle to the range -pi to pi radians (-180 to 180 degrees). More...