better macros ... (multiplication avoided)

This commit is contained in:
Pascal Brisset
2007-05-27 15:48:52 +00:00
parent fee2fedfe0
commit fe1c23b88d
2 changed files with 3 additions and 6 deletions
-3
View File
@@ -118,9 +118,6 @@ static inline void fly_to_xy(float x, float y);
#define MIN_DX ((int16_t)(MAX_PPRZ * 0.05))
#define DegOfRad(x) ((x) / M_PI * 180.)
#define RadOfDeg(x) ((x)/180. * M_PI)
void nav_circle_XY(float x, float y, float radius) {
float last_trigo_qdr = nav_circle_trigo_qdr;
nav_circle_trigo_qdr = atan2(estimator_y - y, estimator_x - x);
+3 -3
View File
@@ -62,9 +62,9 @@ typedef uint8_t unit_t;
while (x > M_PI) x -= 2 * M_PI; \
while (x < -M_PI) x += 2 * M_PI; \
}
#define DegOfRad(x) ((x) / M_PI * 180.)
#define DeciDegOfRad(x) ((x) / M_PI * 1800.)
#define RadOfDeg(x) ((x)/180. * M_PI)
#define DegOfRad(x) ((x) * (180. / M_PI))
#define DeciDegOfRad(x) ((x) * (1800./ M_PI))
#define RadOfDeg(x) ((x) * (M_PI/180.))
#define Min(x,y) (x < y ? x : y)
#define Max(x,y) (x > y ? x : y)