I know how to use it for modulating things, but I don't know HOW it works. I know what tick() is and I know what sines are, but can someone please explain how this works?
How does math.sin(tick()) work?
2 answers
Your question is more of a trigonometry question. You can take a look at links to find out what functions things are, such as sin, cos, and tan.
They are highly important functions that basically set the base for all trigonometry. They coordinate with how angles of triangles function with most of time, circles.
I won't offer my explanation as to what is going on as I feel you should get a more formal and worked-out description from some other resources, such as:
Graphing Trig Functions:http://www.purplemath.com/modules/grphtrig.htm
Video Demonstration:https://www.khanacademy.org/math/trigonometry/trig-function-graphs/trig_graphs_tutorial/v/we-amplitude-and-period
Video Explanation: https://www.khanacademy.org/math/trigonometry/basic-trigonometry/cc-trig-ratios-similarity/v/similarity-to-define-sine-cosine-and-tangent
You can transform a large number into a small number by using the modulo operator %. The following isn't how math.sin works, but it does transform any number to one in the range -1 to 1:
function Transform(n)
return math.floor(n) % 3 - 1
end
math.sin is a similar idea (though significantly more complicated).
1 comment
cool I'll have to play with this
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
What do you mean, 'how does it work'? Are you asking what math.sin does, or are you asking why someone would use math.sin(tick())?
well, print(tick()) prints something like 1443811072.8355. print(math.sin(tick())) prints something that's -1 - 1. How is it converting a number that keeps getting bigger into a modulation that is between -1 and 1
Sine is a weird geometry/trig thing that i haven't learned yet. Tick is a number of seconds since some date. It's always increasing (every second). This makes it useful for keeping track of how long something took to happen.
Tick is the amount of seconds since the unix Epoch.