From 338548c5ebef6407bb1b38ba15cf46a319a63026 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 3 Apr 2020 15:26:01 +0900 Subject: [PATCH] AP_Math: move HALF_SQRT_2 def to rotation.h This allows it to be used by the Quaternion class --- libraries/AP_Math/rotations.h | 3 +++ libraries/AP_Math/vector3.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Math/rotations.h b/libraries/AP_Math/rotations.h index a4161040fc..d63f4174ba 100644 --- a/libraries/AP_Math/rotations.h +++ b/libraries/AP_Math/rotations.h @@ -80,6 +80,9 @@ enum Rotation : uint8_t { // maximum rotation that will be used for auto-detection #define ROTATION_MAX_AUTO_ROTATION ROTATION_ROLL_90_PITCH_315 +// definitions used by quaterion and vector3f +#define HALF_SQRT_2 0.70710678118654757f + /* Here are the same values in a form suitable for a @Values attribute in auto documentation: diff --git a/libraries/AP_Math/vector3.cpp b/libraries/AP_Math/vector3.cpp index a23fbfbb10..984f4172c8 100644 --- a/libraries/AP_Math/vector3.cpp +++ b/libraries/AP_Math/vector3.cpp @@ -20,8 +20,6 @@ #include "AP_Math.h" -#define HALF_SQRT_2 0.70710678118654757f - // rotate a vector by a standard rotation, attempting // to use the minimum number of floating point operations template