View Single Post
  #2  
Old 12-30-2009, 06:31 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva


I'm horrible at math as well, but sin and cos map out the vertical and horizontal placement, respectively, of an angle(θ), as the picture demonstrates(ignore all the extra stuff, as just the blue and red lines are important).

Now you just wait until someone good at math comes and rips my post apart.

Just remember, gscript uses radians(0-pi*2) instead of degrees(0-360):
PHP Code:
function onCreated() {
  
temp.ang 0;
  for (
temp.i=0;i<500;i++) {
    
temp.px i;
    
temp.py sin(ang)*50// this is the wave, the 50 would be the amplitude, I guess
    
ang += pi/10// increases the angle, change this to change the frequency, I think
  
}

Should show a wave at px/py if you display it somehow with showimg or something.
Reply With Quote