A class that provides light-weight mathematical functions.
More...
#include <Math.h>
|
| static float | pow (float base, int exponent) |
| | exponentiation
|
| |
| static float | min (float a, float b) |
| | get minimum float value
|
| |
| static int | min (int a, int b) |
| | get minimum integer value
|
| |
| static float | max (float a, float b) |
| | get maximum float value
|
| |
| static int | max (int a, int b) |
| | get maximum integer value
|
| |
| static float | fabs (float n) |
| | get the floating-point absolute value
|
| |
| static int | abs (int n) |
| | get integer absolute value
|
| |
| static float | sqrt (float n) |
| | get the square root of the number
|
| |
| static float | cos (float angle) |
| | get the cosine of the angle
|
| |
| static int | sign (float x) |
| | get the sign of number
|
| |
| static float | sin (float angle) |
| | get the sine of the angle
|
| |
| static float | atan (float m) |
| | get the arc tangent of a ratio if slope approaches infinity
|
| |
| static float | atan (float y, float x) |
| | get the arc tangent of the ratio constructed by the y amount and the x amount if x is zero, the result is exactly pi/2, if x will never be zero, use atan(float m)
|
| |
|
| static constexpr float | PI = 3.141592653589793 |
| |
A class that provides light-weight mathematical functions.
- Note
- This class is not intended to be used for heavy mathematical calculations, it only approximates the values.
◆ abs()
| static int Math::abs |
( |
int | n | ) |
|
|
inlinestatic |
get integer absolute value
- Parameters
-
- Returns
- absolute value
◆ atan() [1/2]
| static float Math::atan |
( |
float | m | ) |
|
|
inlinestatic |
get the arc tangent of a ratio if slope approaches infinity
- See also
- atan(float y, float x)
- Parameters
-
- Returns
- approximated angle value in radians, between pi/2 and -pi/2 inclusive.
◆ atan() [2/2]
| static float Math::atan |
( |
float | y, |
|
|
float | x ) |
|
inlinestatic |
get the arc tangent of the ratio constructed by the y amount and the x amount if x is zero, the result is exactly pi/2, if x will never be zero, use atan(float m)
- Parameters
-
- Returns
- approximated angle value in radians, between pi/2 and -pi/2 inclusive.
◆ cos()
| static float Math::cos |
( |
float | angle | ) |
|
|
inlinestatic |
get the cosine of the angle
- Parameters
-
| angle | the angle in radians |
- Returns
- approximated value between 1 and -1
◆ fabs()
| static float Math::fabs |
( |
float | n | ) |
|
|
inlinestatic |
get the floating-point absolute value
- Parameters
-
- Returns
- absolute value
◆ max() [1/2]
| static float Math::max |
( |
float | a, |
|
|
float | b ) |
|
inlinestatic |
get maximum float value
- Parameters
-
- Returns
- the maximum value
◆ max() [2/2]
| static int Math::max |
( |
int | a, |
|
|
int | b ) |
|
inlinestatic |
get maximum integer value
- Parameters
-
- Returns
- the maximum value
◆ min() [1/2]
| static float Math::min |
( |
float | a, |
|
|
float | b ) |
|
inlinestatic |
get minimum float value
- Parameters
-
- Returns
- the minimum value
◆ min() [2/2]
| static int Math::min |
( |
int | a, |
|
|
int | b ) |
|
inlinestatic |
get minimum integer value
- Parameters
-
- Returns
- the minimum value
◆ pow()
| static float Math::pow |
( |
float | base, |
|
|
int | exponent ) |
|
inlinestatic |
exponentiation
- Parameters
-
- Returns
- the base raised to the exponent
◆ sign()
| static int Math::sign |
( |
float | x | ) |
|
|
inlinestatic |
get the sign of number
- Parameters
-
- Returns
- 1 or -1
◆ sin()
| static float Math::sin |
( |
float | angle | ) |
|
|
inlinestatic |
get the sine of the angle
- Parameters
-
| angle | the angle in radians |
- Returns
- approximated value between 1 and -1
◆ sqrt()
| static float Math::sqrt |
( |
float | n | ) |
|
|
inlinestatic |
get the square root of the number
- Parameters
-
- Returns
- the approximated square root
◆ PI
| constexpr float Math::PI = 3.141592653589793 |
|
staticconstexpr |
The approximated value of PI
The documentation for this class was generated from the following file: