Skip to content

Commit 0f1a839

Browse files
committed
Update PI constant
Using PI constant from Arduino.h instead.
1 parent 1c24886 commit 0f1a839

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/MadgwickAHRS.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ float Madgwick::getYawRadians() {
509509

510510
/*Convert degree to radian*/
511511
inline float Madgwick::deg2rad(float value) {
512-
return value * M_PI / 180.0f;
512+
return value * PI / 180.0f;
513513
}
514514

515515
/*Convert radian to degree*/
516516
inline float Madgwick::rad2deg(float value) {
517-
return value * 180.0f / M_PI;
517+
return value * 180.0f / PI;
518518
}

src/MadgwickAHRS.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
#ifndef MadgwickAHRS_h
1818
#define MadgwickAHRS_h
1919

20-
#ifndef _USE_MATH_DEFINES
21-
#define _USE_MATH_DEFINES
22-
#endif
20+
#include <Arduino.h>
2321
#include <math.h>
2422

2523
//-------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)