summaryrefslogtreecommitdiff
path: root/src/helpers/Vector2D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Vector2D.cpp')
-rw-r--r--src/helpers/Vector2D.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp
index 118ba9d9..ae2484b3 100644
--- a/src/helpers/Vector2D.cpp
+++ b/src/helpers/Vector2D.cpp
@@ -45,3 +45,7 @@ bool Vector2D::inTriangle(const Vector2D& p1, const Vector2D& p2, const Vector2D
return 0 <= a && a <= 1 && 0 <= b && b <= 1 && 0 <= c && c <= 1;
}
+
+double Vector2D::size() const {
+ return std::sqrt(x * x + y * y);
+}