summaryrefslogtreecommitdiff
path: root/internal/dynamic_depth/pose.cc
diff options
context:
space:
mode:
Diffstat (limited to 'internal/dynamic_depth/pose.cc')
-rw-r--r--internal/dynamic_depth/pose.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/dynamic_depth/pose.cc b/internal/dynamic_depth/pose.cc
index 63c0740..ae9a1c9 100644
--- a/internal/dynamic_depth/pose.cc
+++ b/internal/dynamic_depth/pose.cc
@@ -2,6 +2,8 @@
#include <math.h>
+#include <cmath>
+
#include "android-base/logging.h"
#include "dynamic_depth/const.h"
@@ -25,8 +27,8 @@ 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;