mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
Changed M_PI to M_PI_F in the matrix library since M_PI is non-standard. (#20458)
* Changed M_PI to M_PI_F in the matrix library since M_PI is non-standard. * Added a new M_PI_PRECISE constant definition to px4_platform_common/defines.h to be used in places when M_PI is desired but shouldn't be used because it is not C standard. * Added the px4_platform_common/defines.h include to the matrix library math.hpp header to pull in some non-standard M_PI constants and updated the test files to use those constants. * Fixed PI constants in matrix helper test to prevent test failure
This commit is contained in:
@@ -136,5 +136,9 @@ __END_DECLS
|
||||
#define M_LOG2_E_F 0.69314718f
|
||||
#define M_INVLN2_F 1.44269504f // 1 / log(2)
|
||||
|
||||
/* The M_PI, as stated above, is not C standard. If you need it and
|
||||
* it isn't in your math.h file then you can use this instead. */
|
||||
#define M_PI_PRECISE 3.141592653589793238462643383279502884
|
||||
|
||||
#define M_DEG_TO_RAD 0.017453292519943295
|
||||
#define M_RAD_TO_DEG 57.295779513082323
|
||||
|
||||
Reference in New Issue
Block a user