Produces a pie chart from the data that you put in lines 500-540. The first number specifies dot density, the second sets the starting angle of the wedge, and the third sets the ending angle.
Content
Source Code
1 REM piechart
2 PRINT "This program produces a pie chart from the data that you putin lines 500-540. The first number specifies dot density, the second sets the starting angle of the wedge, and the third sets the ending angle. Press any key to demonstrate."
3 IF INKEY$="" THEN GO TO 3
4 CLS
60 INK 0
70 PAPER 5
90 GO SUB 400
110 LET xc=100: LET yc=100
120 LET ra=40
130 READ ds
140 READ as,ae
150 IF ds=0 THEN STOP
210 LET d=ds*PI/180
220 LET as=as*PI/180
230 LET ae=ae*PI/180
240 FOR r=ds TO ra STEP ds
250 FOR p=as TO ae STEP d*(40/r)
260 LET x=r*COS (p)
270 LET y=r*SIN (p)
280 LET x=x+xc
290 LET y=y+yc
300 PLOT x,y
310 NEXT p
320 NEXT r
330 GO TO 100
410 PLOT 0,0
420 DRAW 255,0
430 DRAW 0,175
440 DRAW -255,0
450 DRAW 0,-175
460 RETURN
500 DATA 4,1,70
510 DATA 3,71,200
520 DATA 2,201,300
530 DATA 1,301,360
540 DATA 0,0,0
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
