Title   : 3D f(X,Y) surface tracer (adapted from a Sinclair Basic Program)
Author  : Lucio Marino Miranda Quintal
Address : ----------------------------       :  [email protected]
          At the University of Madeira Island:  http://www.uma.pt
Release Date: 21 March     1996
Programmed at: 27 September 1995
Aknowlegdments: Rui Victor S.G. Baptista and Carlos Alberto Nobrega for tempting me
                             to convert it to the FX9700GE.
 
This file and associated programs are Freeware.

NOTES:
-Before start typing set your calculator to WRT/MATRIX mode with
 [Shift][MENU][F5].
-This file was edited in MSDOS EDIT (under Windows95).
-When translating please use the 'translat.asc' file available at some Casio
 support sites. This is intuitive anyway.
-The indented text after a ';' in a program line is a comment and should not
 be entered.
-The lines are listed as they appear on the calculator screen.
-The program calls another program. Either use 'Prog ProgramReference' or
 'Prog "Editor File Name"'.I just called it 'Prog D' because the first was
 'Prog C'.
-I'm building an interface for my FX9700GE and PC, then I hope to make
 all my programs available:- Simplex;Biorhythm;Frequency analysies;etc.

'3D-PLOT'                       ;press [EXE] to move to next line
"Mat A~D,VECT E,f6 OK           ;define your function in f6 of the [Shift][0]
 ?":"X MIN "?->A:"X MA          ;Matrixs A to D store graphic data and shall
X "?->B:"Y MIN "?->C:"Y         ;be of dimension [1+GRID XX,1+GRID YY],
 MAX "?->D:"GRID  XX            ;typically 11x11; vector E is
"?->E:"GRID  YY "?->F:          ;Matrix E[1,1+GRID YY], usually 1x11.
1->G                            ;Try for example:
Lbl 0:A+(G-1)*(B-A)/E           ;f6:e(-(X^2+y^2)) with    X MIN=-2;X MAX=2;
->Mat D[1,G]:Isz G:G<=E         ;Y MIN=-2;Y MAX=2;GRID XX=10;GRID YY=10 or
+1=>Goto 0                      ;f6:2rt(100-X^2-Y^2) with X MIN=-6;X MAX=6;
1->G                            ;Y MIN=-6;Y MAX=6;GRID XX=10;GRID YY=10.
Lbl 1:C+(G-1)*(D-C)/F
->Mat E[1,G]:Isz G:G<=F
+1=>Goto 1
1->G:Lbl 2
1->H:Lbl 3
Mat D[1,G]->X:Mat E[1,
H]->Y:f6->Mat A[G,H]:Is         ;enter f6 with [Shift][0][F3][6]
z H:H<=F+1=>Goto 3:Isz
G:G<=E+1=>Goto 2
-10E30->I~J:10E30->K~L:         ;enter '~' with [ALPHA][F3]
1->G
Lbl 4:1->H                      ;.375 instead of 0.375 saves one byte!
Lbl 5:Mat D[1,G]+.375           ;the 0.375 constant aids to the projection to
*Mat E[1,H]->Mat B[G,H          ;a 3D view in "Cavalier Perspective", that is
]                               ;45 degrees with +XX axis and 50% reduction
Mat A[G,H]+.375*Mat E           ;in depth.
[1,H]->Mat C[G,H]
Mat B[G,H]<K=>Mat B[G,
H]->K
Mat C[G,H]<L=>Mat C[G,
H]->L
Mat B[G,H]>I=>Mat B[G,
H]->I
Mat C[G,H]>J=>Mat C[G,
H]->J
Isz H:H<=F+1=>Goto 5:Is
z G:G<=E+1=>Goto 4
125/(I-K)->M:61/(J-L)->         ;the constants 125;61;126 and 62 are related
N:126-M*I->O:62-N*J->P          ;to the screen resolution of 127x63 pixels
1->G
Lbl 6:1->H
Lbl 7:M*Mat B[G,H]+O->
Mat B[G,H]:N*Mat C[G,
H]+P->Mat C[G,H]
Isz H:H<=F+1=>Goto 7:Is
z G:G<=E+1=>Goto 6
Prog D                          ;Instead of D you may call any another program

------------------------------------------------------------------------------

'3D-PLOT SUBROUTINE'            ;type this in another program (called 'Prog D'
Range 0,126,1,0,62,1            ;here) or in the Editor area
1->G:Lbl 0:1->H                 ;This had to be done separately due to the
Lbl 1:G>E=>Goto 2               ;(valid) restriction of labels.
Mat B[G,H]->X:Mat C[G,
H]->Y:Plot X,Y:Mat B[G
+1,H]->X:Mat C[G+1,H]->
Y:Plot X,Y:Line
Lbl 2:H>F=>Goto 3
Mat B[G,H]->X:Mat C[G,
H]->Y:Plot X,Y:Mat B[G
,H+1]->X:Mat C[G,H+1]->
Y:Plot X,Y:Line
Lbl3:Isz H:H<=F+1=>Got
o 1:Isz G:G<=E+1=>Goto
0
------------------------------------------------------------------------------
for any comments or bug reports I'm -> [email protected]
------------------------------------------------------------------------------
 

Hosted by www.Geocities.ws

1