13 #define M_PI 3.14159265358f 16 #define M_2PI 6.28318530718f 19 #define M_PI_OVER_2 1.57079632679f 20 #define M_HALF_PI M_PI_OVER_2 //TODO: remove for v2 23 #define M_PI_OVER_3 1.047197551f 26 #define M_PI_OVER_4 0.785398163f 29 #define M_PI_OVER_6 0.523598776f 32 #define DEG_TO_RAD(x) ((x) * 0.01745329251f) 35 #define RAD_TO_DEG(x) ((x) * 57.2957795131f) 38 #define SIGN(x) ((x) < 0 ? -1 : 1) 51 extern float (*
fabs)(
float x);
53 extern float (*
exp)(
float x);
54 extern float (*
log)(
float x);
56 extern float (*native_sin)(
float x);
57 extern float (*native_cos)(
float x);
58 extern float (*native_tan)(
float x);
59 extern float (*native_acos)(
float x);
60 extern float (*native_asin)(
float x);
61 extern float (*native_atan)(
float x);
62 extern float (*native_atan2)(
float y,
float x);
119 float floor(
float x);
163 float fmax(
float a,
float b);
173 float fmin(
float a,
float b);
183 int imod(
int a,
int b);
193 float fmod(
float a,
float b);
296 float atan2(
float y,
float x);
uint8_t u8
Definition: gctypes.h:14
float fmin(float a, float b)
Minimum of two floating-point values.
Definition: math.c:53
float acos(float x)
Arc cosine of x.
Definition: math.c:126
Data types for the gamecube.
float ceil(float x)
Round up value.
Definition: math.c:33
Struct containing the coordinates of a point.
Definition: math.h:43
float recipSqrt(float x)
1 / sqrt(x)
float atan(float x)
Arc tangent of x.
Definition: math.c:131
float magnitude(Point pt)
Magnitude of point.
Definition: math.c:146
float x
Definition: math.h:45
float y
Definition: math.h:46
s32 imin(s32 a, s32 b)
Minimum of two integers.
Definition: math.c:43
float angle(Point a, Point b)
Angle between two points.
Definition: math.c:141
float asin(float x)
Arc sine of x.
Definition: math.c:121
float fmax(float a, float b)
Maximum of two floating-point values.
Definition: math.c:48
float sqrt(float x)
Square root of x.
Definition: math.c:101
int16_t s16
Definition: gctypes.h:19
float atan2(float y, float x)
Compute arc tangent with two parameters.
Definition: math.c:136
float log(float x)
natural log
int imod(int a, int b)
Mod operator for integers.
Definition: math.c:58
float fmod(float a, float b)
Mod operator for floats.
Definition: math.c:64
float fabs(float x)
Absolute value of x.
float floor(float x)
Round down value.
Definition: math.c:20
float cos(float x)
Cosine of x, expressed in degrees.
Definition: math.c:111
s32 imax(s32 a, s32 b)
Maximum of two integers.
Definition: math.c:38
float distance(Point a, Point b)
Distance between two points.
Definition: math.c:151
s32 ipow(s16 base, u8 exp)
base raised to the power of exp
Definition: math.c:71
int32_t s32
Definition: gctypes.h:20
float sin(float x)
Sine of x, expressed in degrees.
Definition: math.c:106
float fpow(float base, u8 exp)
base raised to the power of exp
Definition: math.c:86
float tan(float x)
Tangent of x, expressed in degrees.
Definition: math.c:116
float exp(float x)
e to the power x