2022-03-21 21:51:23 -04:00
|
|
|
#ifndef MATH_H
|
|
|
|
#define MATH_H
|
|
|
|
|
2023-01-17 00:17:49 -05:00
|
|
|
#include <libultraship/libultra.h>
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2024-10-28 20:30:11 -04:00
|
|
|
#ifndef M_PI
|
2022-03-21 21:51:23 -04:00
|
|
|
#define M_PI 3.14159265358979323846f
|
2024-10-28 20:30:11 -04:00
|
|
|
#endif
|
|
|
|
#ifndef M_SQRT2
|
2022-03-21 21:51:23 -04:00
|
|
|
#define M_SQRT2 1.41421356237309504880f
|
2024-10-28 20:30:11 -04:00
|
|
|
#endif
|
|
|
|
#ifndef FLT_MAX
|
2022-03-21 21:51:23 -04:00
|
|
|
#define FLT_MAX 340282346638528859811704183484516925440.0f
|
2024-10-28 20:30:11 -04:00
|
|
|
#endif
|
2022-03-21 21:51:23 -04:00
|
|
|
#define SHT_MAX 32767.0f
|
|
|
|
#define SHT_MINV (1.0f / SHT_MAX)
|
|
|
|
#define DEGTORAD(x) (x * M_PI / 180.0f)
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
struct {
|
|
|
|
u32 hi;
|
|
|
|
u32 lo;
|
|
|
|
} word;
|
|
|
|
|
|
|
|
f64 d;
|
|
|
|
} du;
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
u32 i;
|
|
|
|
f32 f;
|
|
|
|
} fu;
|
|
|
|
|
|
|
|
extern f32 __libm_qnan_f;
|
|
|
|
|
|
|
|
#endif
|