2022-12-04 23:15:18 +08:00
|
|
|
|
#ifndef GENERAL_DEF_H
|
|
|
|
|
#define GENERAL_DEF_H
|
|
|
|
|
|
2023-02-14 11:13:32 +08:00
|
|
|
|
// 一些module的通用数值型定义,注意条件macro兼容,一些宏可能在math.h中已经定义过了
|
|
|
|
|
|
2022-12-09 18:25:35 +08:00
|
|
|
|
#ifndef PI
|
2022-12-04 23:15:18 +08:00
|
|
|
|
#define PI 3.1415926535f
|
2023-04-14 22:26:33 +08:00
|
|
|
|
#endif
|
2022-12-04 23:15:18 +08:00
|
|
|
|
#define PI2 (PI * 2.0f) // 2 pi
|
|
|
|
|
|
2023-04-14 22:26:33 +08:00
|
|
|
|
#define RAD_2_DEGREE 57.2957795f // 180/pi
|
|
|
|
|
#define DEGREE_2_RAD 0.01745329252f // pi/180
|
2022-12-04 23:15:18 +08:00
|
|
|
|
|
2023-04-14 22:26:33 +08:00
|
|
|
|
#define RPM_2_ANGLE_PER_SEC 6.0f // ×360°/60sec
|
|
|
|
|
#define RPM_2_RAD_PER_SEC 0.104719755f // ×2pi/60sec
|
2022-12-04 23:15:18 +08:00
|
|
|
|
|
|
|
|
|
#endif // !GENERAL_DEF_H
|