summaryrefslogtreecommitdiffstats
path: root/services/sensorservice/vec.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/sensorservice/vec.h')
-rw-r--r--services/sensorservice/vec.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/sensorservice/vec.h b/services/sensorservice/vec.h
index 736ff37..f74ccc5 100644
--- a/services/sensorservice/vec.h
+++ b/services/sensorservice/vec.h
@@ -208,6 +208,15 @@ TYPE PURE length(const V<TYPE, SIZE>& v) {
}
template <
+ template<typename T, size_t S> class V,
+ typename TYPE,
+ size_t SIZE
+>
+V<TYPE, SIZE> PURE normalize(const V<TYPE, SIZE>& v) {
+ return v * (1/length(v));
+}
+
+template <
template<typename T, size_t S> class VLHS,
template<typename T, size_t S> class VRHS,
typename TYPE