diff options
Diffstat (limited to 'internal/dynamic_depth/earth_pose.cc')
-rw-r--r-- | internal/dynamic_depth/earth_pose.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/dynamic_depth/earth_pose.cc b/internal/dynamic_depth/earth_pose.cc index cd5e0a7..db9e2b3 100644 --- a/internal/dynamic_depth/earth_pose.cc +++ b/internal/dynamic_depth/earth_pose.cc @@ -2,6 +2,8 @@ #include <math.h> +#include <cmath> + #include "android-base/logging.h" #include "dynamic_depth/const.h" @@ -25,9 +27,9 @@ const std::vector<float> NormalizeQuaternion(const std::vector<float>& quat) { if (quat.size() < 4) { return std::vector<float>(); } - float length = - sqrt((quat[0] * quat[0]) + (quat[1] * quat[1]) + (quat[2] * quat[2])) + - (quat[3] * quat[3]); + float length = std::sqrt((quat[0] * quat[0]) + (quat[1] * quat[1]) + + (quat[2] * quat[2])) + + (quat[3] * quat[3]); const std::vector<float> normalized = {quat[0] / length, quat[1] / length, quat[2] / length, quat[3] / length}; return normalized; |