HP 50g User's Reference Manual
Download Advanced user's reference manual of HP 48gII Calculator for Free or View it Online on All-Guides.com.
Brand: HP
Category: Calculator
Type: Advanced user's reference manual
Model: HP 48gII , HP 49g+ , HP 50G
Pages: 693
RPL Programming Examples 2-35
Program: Comments:
(66,32) 20 0 6.28 ARC
Draws the circle.
PICT RCL →LCD
Displays the empty circle.
RCLΣ TOT /
Recalls the statistics data matrix,
computes totals, and calculates the
proportions.
DUP 100 *
Converts the proportions to
percentages.
→ prcnts
Stores the percentage matrix in prcnts.
«
2 π →NUM * *
0
Multiplies the proportion matrix by
2
π
, and enters the initial angle (0).
→ prop angle
Stores the angle matrix in prop and
angle in angle.
«
prop SIZE OBJ→
DROP SWAP
Sets up 1 to m as loop counter range.
FOR n
Begins loop-clause.
(66,32) prop n GET
'angle' STO+
Puts the center of the circle on the
stack, then gets the nth value from
the proportion matrix and adds it to
angle.
angle COS angle SIN
R→C 20 * OVER +
LINE
Computes the endpoint and draws
the line for the nth slice.
PICT RCL
angle prop n GET
2 / - DUP DUP
COS SWAP SIN R→C
26 * (66,32) +
Recalls PICT to the stack.
For labeling the slice, computes the
midpoint of the arc of the slice.
SWAP
CASE
Starts the CASE structure to test
angle and determine the offset value
for the label.
DUP 1.5 ‰
THEN
DROP
END
From 0 to 1.5 radians, doesn’t offset
the label.
DUP 4.4 ‰
THEN
DROP 15 -
END
From 1.5 to 4.4 radians, offsets the
label 15 user units left.
5 <
THEN
(3,2) +
END
From 4.4 to 5 radians, offsets the
label 3 units right and 2 units up.
END
Ends the CASE structure.