From 8371cc84d9d7699911a559d3c44a8c37834e5cfa Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sat, 8 Mar 2014 18:14:41 +0100 Subject: [PATCH] may work faster --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index ba7d627..4e4205e 100644 --- a/init.lua +++ b/init.lua @@ -151,8 +151,8 @@ function vector.sun_dir(time) or t > 0.75 then return end - local tmp = math.pi*(2*t-0.5) - return {x=math.cos(tmp), y=math.sin(tmp), z=0} + local tmp = math.cos(math.pi*(2*t-0.5)) + return {x=tmp, y=math.sqrt(1-tmp*tmp), z=0} end function vector.inside(pos, minp, maxp)