Displays a two dimensional array in 3D. GO TO 9935 for demo data.
Content
Source Code
9061 PRINT AT 3,3;y;" ";x,
9850 REM 07;10 PM 05/03/85 GWG GRAPH.2 DISPLAYS A TWO DIMENSION ARRAY IN 3D
9855 BORDER 0: PAPER 0: INK 7: CLS
9860 GO TO 9875
9865 DIM A(128,44)
9870 GO TO 4000
9875 LET A1=0
9880 LET Y1=0
9885 LET C=0
9890 FOR X=2 TO 255 STEP 2: REM DISPLAY ROUTINE
9895 FOR Y=4 TO 170 STEP 4
9900 LET X1=X+INT (((.05*(Y/50))*(127-X))): REM SETS ASPECT RATIO
9905 LET Y1=A(X/2,Y/4): REM READS VALUE OF POINT IN ARRAY
9910 IF (Y+Y1)/2>C THEN PLOT X1,(Y+Y1)/2: DRAW 2,0: LET C=(Y1+Y)/2: REM PLOT IF > THAN LAST PT
9915 NEXT Y
9920 LET C=0
9925 NEXT X
9930 STOP
9935 DIM A(128,44): REM INIT ARRAY
9945 FOR Y=1 TO 44: REM DEMO DATA GENERATOR
9950 FOR X=1 TO 128
9955 LET Y1=INT (70/(1+ABS (10-X))*(10/(1+ABS (15-Y))))
9960 LET Y1=Y1+INT (90/(1+ABS (80-X))*(10/(1+ABS (28-Y))))
9961 PRINT AT 3,3;"Filling A(";x;",";y;")",
9965 LET Y1=Y1+INT (90/(1+ABS (128-X))*(10/(1+ABS (44-Y))))
9970 IF Y1>175 THEN LET Y1=175: REM SETS UPPER CUTOFF LEVEL
9975 LET A(X,Y)=Y1
9980 NEXT X
9985 NEXT Y
9990 GO TO 9855
9991 REM "GRAPH.3" BY Jerry Goegelein