| Melee Modding Library
    2.0.0
    A C library for modding Super Smash Bros Melee | 
Useful math functions. More...
#include "gctypes.h"Go to the source code of this file.
| Data Structures | |
| struct | Point | 
| Struct containing the coordinates of a point.  More... | |
| Macros | |
| #define | M_PI 3.14159265358f | 
| #define | M_2PI 6.28318530718f | 
| #define | M_PI_OVER_2 1.57079632679f | 
| #define | M_PI_OVER_3 1.047197551f | 
| #define | M_PI_OVER_4 0.785398163f | 
| #define | M_PI_OVER_6 0.523598776f | 
| #define | DEG_TO_RAD(x) ((x) * 0.01745329251f) | 
| #define | RAD_TO_DEG(x) ((x) * 57.2957795131f) | 
| #define | SIGN(x) ((x) < 0 ? -1 : 1) | 
| Functions | |
| float | exp (float x) | 
| eto the powerxMore... | |
| float | log (float x) | 
| natural log  More... | |
| float | fabs (float x) | 
| Absolute value of x.  More... | |
| float | recipSqrt (float x) | 
|  1 / sqrt(x) More... | |
| float | floor (float x) | 
| Round down value.  More... | |
| float | ceil (float x) | 
| Round up value.  More... | |
| s32 | imax (s32 a, s32 b) | 
| Maximum of two integers.  More... | |
| s32 | imin (s32 a, s32 b) | 
| Minimum of two integers.  More... | |
| float | fmax (float a, float b) | 
| Maximum of two floating-point values.  More... | |
| float | fmin (float a, float b) | 
| Minimum of two floating-point values.  More... | |
| int | imod (int a, int b) | 
| Mod operator for integers.  More... | |
| float | fmod (float a, float b) | 
| Mod operator for floats.  More... | |
| s32 | ipow (s16 base, u8 exp) | 
| baseraised to the power ofexpMore... | |
| float | fpow (float base, u8 exp) | 
| baseraised to the power ofexpMore... | |
| float | sqrt (float x) | 
| Square root of x.  More... | |
| float | sin (float x) | 
| Sine of x, expressed in degrees.  More... | |
| float | cos (float x) | 
| Cosine of x, expressed in degrees.  More... | |
| float | tan (float x) | 
| Tangent of x, expressed in degrees.  More... | |
| float | asin (float x) | 
| Arc sine of x.  More... | |
| float | acos (float x) | 
| Arc cosine of x.  More... | |
| float | atan (float x) | 
| Arc tangent of x.  More... | |
| float | atan2 (float y, float x) | 
| Compute arc tangent with two parameters.  More... | |
| float | magnitude (Point pt) | 
| Magnitude of point.  More... | |
| float | distance (Point a, Point b) | 
| Distance between two points.  More... | |
| float | angle (Point a, Point b) | 
| Angle between two points.  More... | |
Useful math functions.
| struct Point | 
| #define M_PI 3.14159265358f | 
approximate value of pi
| #define M_2PI 6.28318530718f | 
approximate value of 2 * pi
| #define M_PI_OVER_2 1.57079632679f | 
approximate value of pi / 2
| #define M_PI_OVER_3 1.047197551f | 
approximate value of pi / 3
| #define M_PI_OVER_4 0.785398163f | 
approximate value of pi / 4
| #define M_PI_OVER_6 0.523598776f | 
approximate value of pi / 6
| #define DEG_TO_RAD | ( | x | ) | ((x) * 0.01745329251f) | 
degree to radian conversion
| #define RAD_TO_DEG | ( | x | ) | ((x) * 57.2957795131f) | 
radian to degree conversion
| #define SIGN | ( | x | ) | ((x) < 0 ? -1 : 1) | 
sign of value
| float exp | ( | float | x | ) | 
e to the power x 
| x | - floating-point value | 
e raised the power x | float log | ( | float | x | ) | 
natural log
| x | - floating-point value, must be positive | 
x | float fabs | ( | float | x | ) | 
Absolute value of x. 
| x | - floating-point value | 
x. | float recipSqrt | ( | float | x | ) | 
 1 / sqrt(x)  
| x | - floating-point value | 
x | float floor | ( | float | x | ) | 
Round down value.
Rounds x downward, returning the largest integral value that is not greater than @ x
| x | - floating-point value | 
x rounded downward (as a floating-point value)| float ceil | ( | float | x | ) | 
Round up value.
Rounds x upward, returning the smallest integral value that is not less than @ x
| x | - floating-point value | 
x rounded upward (as a floating-point value)Maximum of two integers.
| a | - 32-bit signedint | 
| b | - 32-bit signedint | 
a and b Minimum of two integers.
| a | - 32-bit signedint | 
| b | - 32-bit signedint | 
a and b | float fmax | ( | float | a, | 
| float | b | ||
| ) | 
Maximum of two floating-point values.
| a | - floating-point value | 
| b | - floating-point value | 
a and b | float fmin | ( | float | a, | 
| float | b | ||
| ) | 
Minimum of two floating-point values.
| a | - floating-point value | 
| b | - floating-point value | 
a and b | int imod | ( | int | a, | 
| int | b | ||
| ) | 
Mod operator for integers.
| a | - signedint | 
| b | - signedint | 
 a mod b  | float fmod | ( | float | a, | 
| float | b | ||
| ) | 
Mod operator for floats.
| a | - floating-point value | 
| b | - floating-point value | 
 a mod b  base raised to the power of exp 
| base | - 16-bit signedint | 
| exp | - 8-bit signedint | 
base raised to the power of exp | float fpow | ( | float | base, | 
| u8 | exp | ||
| ) | 
base raised to the power of exp 
| base | - floating-point value | 
| exp | - 8-bit signedint | 
base raised to the power of exp | float sqrt | ( | float | x | ) | 
Square root of x. 
| x | - floating-point value | 
x | float sin | ( | float | x | ) | 
Sine of x, expressed in degrees. 
| x | - floating-point value in  [0, 360)  | 
x | float cos | ( | float | x | ) | 
Cosine of x, expressed in degrees. 
| x | - floating-point value in  [0, 360)  | 
x | float tan | ( | float | x | ) | 
Tangent of x, expressed in degrees. 
| x | - floating-point value in  [0, 360)  | 
x | float asin | ( | float | x | ) | 
Arc sine of x. 
| x | - floating-point value in  [-1, +1]  | 
x, expressed in degress in range  [0, 90]  and  [270, 360)  | float acos | ( | float | x | ) | 
Arc cosine of x. 
| x | - floating-point value in  [-1, +1]  | 
x, expressed in degress in range  [0, 180]  | float atan | ( | float | x | ) | 
Arc tangent of x. 
| x | - floating-point value in  [0, inf)  | 
x, expressed in degress in range  [0, 90)  | float atan2 | ( | float | y, | 
| float | x | ||
| ) | 
Compute arc tangent with two parameters.
Returns the arc tangent of y / x, expressed in degrees. To compute the value, the function takes into accout the sign of both arguments in order to determine the quadrant.
| y | - floating-point value | 
| x | - floating-point value | 
y / x, in interval [0, 360) degrees| float magnitude | ( | Point | pt | ) | 
Magnitude of point.
| pt | - Point struct | 
pt from (0,0) 1.8.11
 1.8.11