From 72a6a92ff680428fa00b023b9cd79b26f1f672dc Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 11 Nov 2017 09:43:38 +0100 Subject: [PATCH] Removed unused variables from randomDirection I just realized there were some unused variables in the randomDirection function, so I removed them. --- vector.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vector.lua b/vector.lua index 6e25bd6..2d75d62 100644 --- a/vector.lua +++ b/vector.lua @@ -46,10 +46,8 @@ local function randomDirection(len_min, len_max) assert(len_max > 0, "len_max must be greater than zero") assert(len_max >= len_min, "len_max must be greater than or equal to len_min") - - local range = len_max - len_min - local rnd = math.random() * range - return fromPolar(math.random()*2*math.pi, + + return fromPolar(math.random() * 2*math.pi, math.random() * (len_max-len_min) + len_min) end