12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
-
-
- #include <math.h>
-
- #ifndef _MATH_MATH_H
- #define _MATH_MATH_H
-
- #define OR_PI ((float)M_PI)
- #define OR_2_PI (OR_PI * 2.0f)
- #define OR_PI_OVER_4 (OR_PI / 4.0f)
- #define OR_PI_OVER_180 (OR_PI / 180.0f)
- #define OR_180_OVER_PI (180.0f / OR_PI)
-
- #define OR_RAD_TO_DEG(x) ((x) * OR_180_OVER_PI)
- #define OR_DEG_TO_RAD(x) ((x) * OR_PI_OVER_180)
-
- typedef float vec_t;
- typedef float vec2_t[2];
- typedef float vec3_t[3];
- typedef float vec4_t[4];
- typedef vec_t matrix_t[16];
-
-
- bool equalEpsilon(vec_t a, vec_t b);
-
-
- int intersectionLinePolygon(vec3_t intersect, vec3_t p1, vec3_t p2, vec3_t *polygon);
-
-
- vec_t distance(vec3_t a, vec3_t b);
-
-
- void midpoint(vec3_t a, vec3_t b, vec3_t mid);
-
-
- vec_t randomNum(vec_t from, vec_t to);
-
- #endif
|