RPL Programming Examples 2-35
Program: Comments:
I2u)$Z)!s$tpddd !
4j$stGm!2t)!Oy$jpI!
3!46D2!
Displays “drawing” message.
-ccFVH/!H8!8!cdHR!
BKO!
Draws the circle.
26O:!KOE!#EO4!
KOE\!:L:!,!
Displays the empty circle.
Recalls the statistics data
matrix, computes totals, and
calculates the proportions.
452!388!.!
Converts the proportions to
ercentages.
#!qj&GpZ!
Stores the percentage matrix in
rcnts.
"!
H!i!#=5M!.!.!
8!
Multiplies the proportion matrix
by 2π, and enters the initial
angle (0).
#!qjkq!$Gmu)!
Stores the angle matrix in prop
and angle in angle.
"!
qjkq!D6J<!LS_#!
4KL2!DYB2!
7LK!G!
Sets up 1 to m as loop counter
range.
Begins loop-clause.
-ccFVH/!qjkq!G!><:!
+$Gmu)+!D:L'!
Puts the center of the circle on
the stack, then gets the nth
value from the proportion
matrix and adds it to angle.
$Gmu)!OLD!$Gmu)!D6=
K#O!H8!.!LN<K!'!
E6=<!
Computes the endpoint and
draws the line for the nth slice.
26O:!KOE!
$Gmu)!qjkq!G!><:!
H!,!0!452!452!
OLD!DYB2!D6=!K#O!
Hc!.!-ccFVH/!'!
Recalls PICT to the stack.
For labeling the slice, computes
the midpoint of the arc of the
slice.
DYB2!
OBD<!
Starts the CASE structure to
test angle and determine the
offset value for the label.
452!3dQ!]!
:;<=!
4KL2!
<=4!
From 0 to 1.5 radians, doesn't
offset the label.
452!ada!]!
:;<=!
4KL2!3Q!0!
<=4!
From 1.5 to 4.4 radians, offsets
the label 15 user units left.