From ff4587a33ab505b97fb9eae633db34472b8f7c6f Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Fri, 12 Apr 2019 10:35:30 +0200 Subject: [PATCH] AP_Math: move location define to Location class --- libraries/AP_Common/Location.h | 6 ++++++ libraries/AP_Math/location.h | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libraries/AP_Common/Location.h b/libraries/AP_Common/Location.h index cdfeb5341b..f314599431 100644 --- a/libraries/AP_Common/Location.h +++ b/libraries/AP_Common/Location.h @@ -114,4 +114,10 @@ public: private: static AP_Terrain *_terrain; + + // scaling factor from 1e-7 degrees to meters at equator + // == 1.0e-7 * DEG_TO_RAD * RADIUS_OF_EARTH + static constexpr float LOCATION_SCALING_FACTOR = 0.011131884502145034f; + // inverse of LOCATION_SCALING_FACTOR + static constexpr float LOCATION_SCALING_FACTOR_INV = 89.83204953368922f; }; diff --git a/libraries/AP_Math/location.h b/libraries/AP_Math/location.h index b326c9d5a7..5dd40964fd 100644 --- a/libraries/AP_Math/location.h +++ b/libraries/AP_Math/location.h @@ -4,13 +4,6 @@ #include "vector2.h" #include "vector3.h" -#include - -// scaling factor from 1e-7 degrees to meters at equator -// == 1.0e-7 * DEG_TO_RAD * RADIUS_OF_EARTH -#define LOCATION_SCALING_FACTOR 0.011131884502145034f -// inverse of LOCATION_SCALING_FACTOR -#define LOCATION_SCALING_FACTOR_INV 89.83204953368922f /* * LOCATION