3D GRAPH PLOTTER for Sinclair Spectrum
by Ian Brissenden
from Your Computer, November 1983


This program for the 48K Spectrum plots a three-dimensional graph of a
function defined at line 2, hence this is the only line that needs
alteration for a different function. By choosing different options the
type of display can be carried as shown on the printout, and the sides
of the section can be inked in if desired. The functions shown on the
printout are:

2 DEF FN a(x,y)=.7*(SIN (x/5)*1.5)^4*(SIN (y/5)*1.5^4
Choosing squares and density .75.

2 DEF FN a(x,y)=(SIN (x/3)*2)^3+(SIN (y/3)*2)^3
Choosing double lines and density .5. Press L for lines and answer N
to "Single Line?".

2 DEF FN a(x,y)=2*SIN (x)+.08*(SIN (x/3)*2)^(2*y/(x/1.6+.00001))*(SIN
(y/3)*2)^3
Choosing squares and density .5.

2 DEF FN a(x,y)=1/(COS (x)*SIN (y)+1.1)
Choosing single line and density .2.

2 DEF FN a(x,y)=1/(COS (x*.41)*SIN (y)+1.1)
Choosing squares and density .25.

As can be seen, extremely complex functions and combinations of
functions can be plotted.

In writing this program an interesting oddity in the Spectrum's
operation became apparent in [that] the answer to:
	PRINT INT(1)
can be either 0 or 1 depending on what happens beforehand. For
example:
	10 FOR x=0 TO 2 STEP .5
	20 PRINT x,INT (x)
	30 NEXT x
The answer to INT (x) when x=1 is 0. However, if the step in line 10
is altered to .1 then when x=1, INT (x)=1. This is why line 102 is
necessary in the program. Even though line 103 seems to do the same
job it fails when the steps are .5 and x=1. This discrepancy occurs in
every Spectrum I have tried.

