#pragma once #include #include #define M_PI 3.14159265359 #define M_PI_2 1.57079632679 #define abs(x) (((x) < 0) ? -(x) : (x)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) < (b)) ? (a) : (b)) #ifdef __cplusplus extern "C" { #endif static inline bool isnan(double x) { return x != x; } static inline bool isinf(double x) { return !isnan(x) && isnan(x - x); } IMPORT(Math_sin) double sin(double x); static inline double cos(double x) { return sin(x + M_PI_2); } #ifdef __cplusplus } #endif