Sine Waves, graphics demo (SINEWAVE.BAS)
Sine Waves, graphics demo by Patrick Bass, 7
Description
Sine Waves, graphics demo by Patrick Bass, 7
From the Antic disk of October 1985 (Vol. 4 No. 6).
From the Antic Software Archive at atarimagazines.com. The program remains the property of its author and publisher.
What is in this file
Atari BASIC program · 836 bytes
- Dialect
- Atari BASIC
- Lines
- 22
- Variables
XRES,YRES,LOOP,SINEAMPLITUDE,COSINEAMPLITUDE,SINEPERIOD,COSINEPERIOD,SIZE,XPOINT,SINEY,COSINEY,KEYPRESS
BASIC listing (22 lines)
10 REM SINE WAVES
20 REM BY PATRICK BASS
30 REM (c) 1985, ANTIC PUBLISHING
100 OPEN #1,4,0,"K:"
110 XRES=319:YRES=191
120 FOR LOOP=0 TO 1 STEP 0
130 GRAPHICS 8+16
140 SETCOLOR 2,0,0:SETCOLOR 4,0,0:COLOR 1
150 SINEAMPLITUDE=(RND(9)*70)+10
160 COSINEAMPLITUDE=(RND(9)*70)+10
170 SINEPERIOD=(RND(9)*70)+5
180 COSINEPERIOD=(RND(9)*70)+5
190 SIZE=(RND(9)*5)+1
200 FOR XPOINT=0 TO XRES STEP SIZE
210 SINEY=(SIN(XPOINT/SINEPERIOD)*SINEAMPLITUDE)+(YRES/2)
220 COSINEY=(COS(XPOINT/COSINEPERIOD)*COSINEAMPLITUDE)+(YRES/2)
230 PLOT XPOINT,SINEY:DRAWTO XRES-XPOINT,COSINEY
240 IF PEEK(764)<>255 THEN XPOINT=XRES
250 NEXT XPOINT
260 GET #1,KEYPRESS
270 IF CHR$(KEYPRESS)="X" THEN LOOP=2
280 NEXT LOOP
