Change of magic number to 2 * math.pi
This commit is contained in:
parent
c9a7698677
commit
a38e31674c
|
@ -569,7 +569,7 @@ function scroll.step_functions.smooth_back_and_forth(elapsed, size, visible_size
|
||||||
local state = ((elapsed * speed) % (size)) / size
|
local state = ((elapsed * speed) % (size)) / size
|
||||||
-- The cosine function is scaled to map [0,1] to [0,2π] then it’s output is
|
-- The cosine function is scaled to map [0,1] to [0,2π] then it’s output is
|
||||||
-- scaled from [1 -- -1 -- 1] to [0 -- 1 -- 0]
|
-- scaled from [1 -- -1 -- 1] to [0 -- 1 -- 0]
|
||||||
return (size - visible_size) * (0.5 - 0.5*math.cos(state*6.2832))
|
return (size - visible_size) * (0.5 - 0.5*math.cos(state * 2 * math.pi))
|
||||||
end
|
end
|
||||||
|
|
||||||
return scroll
|
return scroll
|
||||||
|
|
Loading…
Reference in New Issue