mirror of
https://github.com/encounter/tp.git
synced 2026-03-30 11:40:53 -07:00
1d2a0d9568
* Last fix for standard compiler error * adding define guards around headers * rename cmath.h and climits.h to cmath and climits respectively * renaming cstdarg.h to cstdarg * renaming cstdlib.h to cstdlib * renaming cstring.h to cstring * renaming cstdio.h to cstdio * renaming cmath locale ctype * renaming stdarg string and va_list * renaming cstddef * renaming stdio stddef stdlib * renaming algorithm, functional, iterator, memory, and utility * renaming bitset, cstdint, limits, and stdint * renaming new and type_traits * update quote includes for standard library headers to angle bracket includes
59 lines
1011 B
C++
59 lines
1011 B
C++
#ifndef C_MATH_H
|
|
#define C_MATH_H
|
|
|
|
#include "JSystem/JMath/JMATrigonometric.h"
|
|
|
|
#ifndef __MWERKS__
|
|
#include <limits>
|
|
#ifndef FLT_MAX
|
|
#define FLT_MAX std::numeric_limits<float>::max()
|
|
#endif
|
|
#endif
|
|
|
|
s16 cM_rad2s(float rad);
|
|
u16 U_GetAtanTable(float, float);
|
|
s16 cM_atan2s(float y, float x);
|
|
float cM_atan2f(float y, float x);
|
|
void cM_initRnd(int, int, int);
|
|
float cM_rnd();
|
|
float cM_rndF(float);
|
|
float cM_rndFX(float);
|
|
void cM_initRnd2(int, int, int);
|
|
float cM_rnd2();
|
|
float cM_rndF2(float);
|
|
float cM_rndFX2(float);
|
|
|
|
inline f32 cM_scos(s16 x) {
|
|
return JMASCos(x);
|
|
}
|
|
|
|
inline f32 cM_ssin(s16 x) {
|
|
return JMASSin(x);
|
|
}
|
|
|
|
inline s16 cM_deg2s(f32 deg) {
|
|
return deg * 182.04445f;
|
|
}
|
|
|
|
inline s16 i_cM_deg2s(f32 deg) {
|
|
return deg;
|
|
}
|
|
|
|
inline f32 cM_fcos(f32 x) {
|
|
return JMASCos(cM_rad2s(x));
|
|
}
|
|
|
|
inline f32 cM_fsin(f32 x) {
|
|
return JMASSin(cM_rad2s(x));
|
|
}
|
|
|
|
inline f32 cM_sht2d(f32 v) {
|
|
return v * 0.005493164f;
|
|
}
|
|
|
|
inline f32 cM_s2rad(s16 x) {
|
|
return x * 9.58738e-05f;
|
|
}
|
|
|
|
#endif /* C_MATH_H */
|