From 157d859ed096cbb067de1d9f9247d2b89661eb3d Mon Sep 17 00:00:00 2001 From: danielmartin0 Date: Wed, 2 Oct 2024 17:00:27 +0100 Subject: [PATCH] Update geometry.lua --- utils/math/geometry.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/math/geometry.lua b/utils/math/geometry.lua index 57dab577..b1e8b8fa 100644 --- a/utils/math/geometry.lua +++ b/utils/math/geometry.lua @@ -40,6 +40,10 @@ function Public.vector_sum(...) return result end +function Public.vector_scaled(vec, scalar) + return { x = vec.x * scalar, y = vec.y * scalar } +end + function Public.vector_distance(vec1, vec2) local vecx = vec2.x - vec1.x local vecy = vec2.y - vec1.y