You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
288 B
14 lines
288 B
9 years ago
|
#include "mathlib.h"
|
||
|
|
||
|
float math::constrain(float &val, float min, float max)
|
||
|
{
|
||
|
return (val < min) ? min : ((val > max) ? max : val);
|
||
|
}
|
||
|
float math::radians(float degrees)
|
||
|
{
|
||
|
return (degrees / 180.0f) * M_PI_F;
|
||
|
}
|
||
|
float math::degrees(float radians)
|
||
|
{
|
||
|
return (radians * 180.0f) / M_PI_F;
|
||
|
}
|