Page 1 of 1

Sine curve loop

Posted: May 19th, 2005, 5:47 am
by byronnash
I am trying to make an expression using sine curves. I want the result to be a series of loops like a roller coaster.
Here is what I have so far:

Code: Select all

x=Math.sin(time*10)+(time*60);
y=Math.sin(time*10)*20;
[x+50,y+240]
I understand the parts for making a line go up and down across the screen, but I'm having trouble grasping what I need to make the x modulate properly to create the loops.

Posted: May 19th, 2005, 7:02 am
by byronnash
Got it. It's upside down but I can live with that. Below is the code.

Code: Select all

wave= Math.cos(time*10)*50;
forward=time*150;
x=wave + forward;
y=Math.sin(time*10)*30;
[x,y]