Math and Graphics on the QL

See all articles from CATS v6 n9
Author(s): Pieter van Dijk
Publication: CATS Newsletter
Pub Details: CATS v6 n9 (Volume 6, Issue 9)
Date: January 1989
Pages: 6

Mathematical equations can become interesting when the results are plotted on the screen. A different way of showing results is demonstrated in the following program. Nice “pictures” can be made in a simple way after a suitable equation is found and proper loop limits are used. This example fills one sheet of printer paper with 80 characters wide output. By the way, I found this equation in a book on Fortran programming.

100 OPEN#3,SER
110 A$='OI#|*=+:%-X'
120 FOR X=0 TO 5 STEP 8E-2
130 B$=":FOR Y=-40 TO 40
140 Z=INT(X+SIN(PI*X)+Y^2/400+1)
150 B$=B$&A$(Z)
160 NEXT Y
170 PRINT#3,B$
180 NEXT X
190 CLOSE#3

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.