Name space for maths related utilities.
More...
|
int | mapValue (int x, int in_min, int in_max, int out_min, int out_max) |
| Maps a value from one range to another using linear interpolation. This function takes an input value within a specified range and maps it to a corresponding value in a different output range using std::lerp.
|
|
float | sineFromDegrees (float angle) |
| Computes the sine of an angle given in degrees. This function converts the input angle from degrees to radians and then calculates the sine of that angle using the standard C++ sin function.
|
|
float | cosineFromDegrees (float angle) |
| Computes the cosine of an angle given in degrees. This function converts the input angle from degrees to radians and then calculates the cosine of that angle using the standard C++ cos function.
|
|
Name space for maths related utilities.
◆ cosineFromDegrees()
float rdlib_maths::cosineFromDegrees |
( |
float |
angle | ) |
|
Computes the cosine of an angle given in degrees. This function converts the input angle from degrees to radians and then calculates the cosine of that angle using the standard C++ cos
function.
- Parameters
-
angle | The angle in degrees. |
- Returns
- The cosine value of the given angle.
◆ mapValue()
int rdlib_maths::mapValue |
( |
int |
x, |
|
|
int |
in_min, |
|
|
int |
in_max, |
|
|
int |
out_min, |
|
|
int |
out_max |
|
) |
| |
Maps a value from one range to another using linear interpolation. This function takes an input value within a specified range and maps it to a corresponding value in a different output range using std::lerp.
- Parameters
-
x | The input value to map. |
in_min | The lower bound of the input range. |
in_max | The upper bound of the input range. |
out_min | The lower bound of the output range. |
out_max | The upper bound of the output range. |
- Returns
- The mapped value in the output range.
◆ sineFromDegrees()
float rdlib_maths::sineFromDegrees |
( |
float |
angle | ) |
|
Computes the sine of an angle given in degrees. This function converts the input angle from degrees to radians and then calculates the sine of that angle using the standard C++ sin
function.
- Parameters
-
angle | The angle in degrees. |
- Returns
- The sine value of the given angle.