'=========================================================================== ' Subject: MOVING SINE WAVE Date: 05-24-97 (15:20) ' Author: Daniel Davies Code: QB, QBasic, PDS ' Origin: ia53@rapid.co.uk Packet: GRAPHICS.ABC '=========================================================================== 'moving sine wave BY Daniel Davies 'This is the sort of sine wave you use to generate moving plasmas. 'I haven't got a web site yet but I've almost finished it, but in the meantime 'if you want to contact me, my email address is - ia53@rapid.co.uk DIM sine1%(0 TO 360) DIM sine2%(0 TO 360) DIM sine3%(0 TO 360) DIM sine4%(0 TO 360) SCREEN 7, , 1, 0 rtd = 3.141592654# / 180 FOR y% = 0 TO 360 sine1%(y%) = -(4 * SIN((y% * 16) * rtd)) sine2%(y%) = -(9 * SIN((y% * 6) * rtd)) sine3%(y%) = (10 * SIN((y% * 13) * rtd)) sine4%(y%) = (6 * SIN((y% * 5) * rtd)) NEXT y% DO s1tmp% = sine1%(0) s3tmp% = sine3%(0) FOR x% = 0 TO 359 sine1%(x%) = sine1%(x% + 1) sine3%(x%) = sine3%(x% + 1) NEXT x% sine1%(360) = s1tmp% sine3%(360) = s3tmp% s2tmp% = sine2%(360) s4tmp% = sine4%(360) FOR x% = 360 TO 1 STEP -1 sine2%(x%) = sine2%(x% - 1) sine4%(x%) = sine4%(x% - 1) NEXT x% sine2%(0) = s2tmp% sine4%(0) = s4tmp% FOR x% = 0 TO 319 PSET (x%, 100 + sine1%(x%) + sine2%(x%) + sine3%(x%) + sine4%(x%)) 'PSET (x%, 100 + sine1%(x%) + sine2%(x%)) 'PSET (x%, 100 + sine3%(x%) + sine4%(x%)) NEXT x% PCOPY 1, 0 CLS LOOP