summaryrefslogtreecommitdiff
path: root/src/Math
diff options
context:
space:
mode:
Diffstat (limited to 'src/Math')
-rw-r--r--src/Math/Vector.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Math/Vector.hpp b/src/Math/Vector.hpp
index 9cc2d75..ccfa556 100644
--- a/src/Math/Vector.hpp
+++ b/src/Math/Vector.hpp
@@ -65,6 +65,10 @@ public:
return map([=](auto x) { return x / m; });
}
+ T distance(Vector<S, T> other) const {
+ return (*this - other).magnitude();
+ }
+
Vector<S, T> abs() const {
return map([=](auto x) { return std::abs(x); });
}