WPILibC++ 2025.0.0-alpha-1-14-g3b6f38d
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...
 
constexpr std::signed_integral auto frc::FloorDiv (std::signed_integral auto x, std::signed_integral auto y)
 Returns the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient. More...
 
constexpr std::signed_integral auto frc::FloorMod (std::signed_integral auto x, std::signed_integral auto y)
 Returns the floor modulus of the int arguments. More...