C++でJavaのMathクラスみたいなやつを
とりあえずここまで作った
#ifndef UTILMATH_H #define UTILMATH_H #include <time.h> class UtilMath { public: UtilMath() { srand(time(NULL)); // 乱数の種を生成 } const static float pi = 3.1415926535f; float toDegrees(float radians) { return radians * 180.0f / pi; } float toRadians(float degrees) { return degrees * pi / 180.0f; } float random() { return (float)rand() / 32768.0f; } // 処理系依存 }; #endif