Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
math_util.h
Go to the documentation of this file.
1#ifndef MATH_UTIL_H
2#define MATH_UTIL_H
3
37f32 frsqrt(f32 number);
38
54f32 to_radians(f32 angle);
55
71f32 to_degrees(f32 angle);
72
82#define sqr(x) ((x)*(x))
83
93#define cube(x) ((x)*(x)*(x))
94
100#define PI 3.14159265358979323846264338327
101
111#define MIN(x,y) ((x < y) ? x : y)
112
122#define MAX(x,y) ((x > y) ? x : y)
123
137#define CLAMP(x,y,z) (MIN(MAX(x,y),z))
138
139
149f32 float_approach(f32 * const origin, const f32 dest, const f32 factor);
150
160float * vec3_approach(float * origin, float * dest, const f32 factor);
161
164#endif
#define f32
Alias for float (32-bit floating-point).
Definition aliases.h:55
f32 to_degrees(f32 angle)
Converts an angle from radians to degrees.
Definition math_util.c:31
f32 frsqrt(f32 number)
Computes the fast inverse square root of a given number using the "Fast Inverse Square Root" algorith...
Definition math_util.c:8
f32 float_approach(f32 *const origin, const f32 dest, const f32 factor)
Approaches a target float by a given factor.
Definition math_util.c:36
float * vec3_approach(float *origin, float *dest, const f32 factor)
Approaches a target vector by a given factor.
Definition math_util.c:41
f32 to_radians(f32 angle)
Converts an angle from degrees to radians.
Definition math_util.c:22