Math functions.
| Namespace: | dmMath |
| Include: | #include <dmsdk/dlib/math.h> |
| FUNCTIONS | |
|---|---|
| template <T> T Abs (T x) | Abs function |
| template <T> T Clamp (T v, T min, T max) | Clamp function |
| float DegToRad (float degrees) | Convert degrees to radians |
| template <T> T Max (T a, T b) | Max function |
| template <T> T Min (T a, T b) | Min function |
| float RadToDeg (float radians) | Convert radians to degrees |
| template <T> T Select (T x, T a, T b) | Select one of two values |
T Clamp(T v, T min, T max)
Clamp function
PARAMETERS
T |
v |
Value to clamp |
T |
min |
Lower bound |
T |
max |
Upper bound |
RETURNS
T |
Value closest to v inside the range [min, max] |
float DegToRad(float degrees)
Convert degrees to radians
PARAMETERS
float |
degrees |
Angle in degrees |
RETURNS
float |
Angle in radians |
float RadToDeg(float radians)
Convert radians to degrees
PARAMETERS
float |
radians |
Angle in radians |
RETURNS
float |
Angle in degrees |