12.07.2015 Views

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

130 APPLE II COMPUTER GRAPHICS100 REM READ DATA110 REM120 READ NUM%130 DIM DTA( NUM%)140 FOR I = 1 TO NUM%150 READ DTA(I)160 TTL = TTL + DTA(I)170 NEXT I180 REM190 REM ************200 REM * DRAW PIE *210 REM ************220 REM230 HGR : HCOLOR = 3240 FOR T = 0 TO L57 STEP .01250 X = FN X (T) :Y = FN Y(T)260 HPLOT X + 140 , Y + 80270 HPLOT -X + 140, Y + 80280 HPLOT X + 140 , -Y + 80290 HPLOT -X + 140 ,-Y + 80300 NEXT T310 REM320 REM ***********330 REM * CUT PIE *340 REM ***********350 REM360 FOR I = 1 TO NUM%370 ACC = ACC + DTA(I)380 R = (ACC I TTL) * 6.28390 HPLOT 140,80 TO FN X (R) + 140,FN Y(R) + 80400 NEXT I410 END500 REM510 REM **************520 REM * DATA TABLE *530 REM **************540 REM550 DATA 5560 DATA 231.4,287,310.84,340, 390Listing 11-5. Pie charts.Line 550 gives the number of regions to be graphed, and line 560 liststhe actu<strong>al</strong> data used for each region. The regions are plotted clockwisefrom the right side of the circle. There are no re<strong>al</strong> restrictions on thev<strong>al</strong>ues, <strong>al</strong>though attempting to plot a region for a negative v<strong>al</strong>ue will giveyou a rather meaningless result.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!