Math.sin()...couldn't figure it out

how do i make something go back and forth on an axis?

i was trying out

Math.sin((Math.PI*2)/sway)*swayTime

sway and swayTime will increase and decrease depending on the amplitude of the oscillation (if that’s the right word).

according to that script above, “sway” is the Period while “swayTime” is the the amplitude, right?

-=EDIT=-
come to think of it… that whole thing just becomes one single number that goes up and down… so why would I need to use Math.sin in the first place?

But I know it works with Math.sin() as well, but how is that any different if i just did two random variables that increases and decreases?