Program:

Comments:

 

 

«

 

→ a b

Creates local variables a and b.

'π^2*(b^2a^2)'

Calculates the surface area.

→NUM

Converts algebraic to a number.

»

 

 

 

`

Puts the program on the stack.

O TORSA K

Stores the program in TORSA.

 

 

Here is a stack diagram and program listing for TORSV.

Level 2

Level 1

Level 1

 

 

 

 

 

a

b

volume

 

 

 

 

 

 

 

 

 

 

Program:

 

 

Comments:

 

 

 

 

 

 

«

 

 

 

 

→ a b

 

 

Creates local variables a and b.

«

 

 

Starts a program as the defining

 

 

 

procedure.

 

a b TORSA

 

 

Puts the numbers stored in a and b

 

 

 

on the stack, then calls TORSA

 

 

 

with those arguments.

 

b a * 4 /

 

 

Completes the volume calculation

 

 

 

using the surface area.

 

»

 

 

Ends the defining procedure.

»

 

 

 

 

 

 

 

 

`

 

 

Puts the program on the stack.

O TORSV K

 

 

Stores the program in TORSV.

 

 

 

 

 

Now use TORSV to calculate the volume of a torus of inner radius a = 6 and outer radius b = 8.

6 ` 8 J %TORSV%

130 RPL Programming

Page 54
Image 54
HP 50g Graphing, 48gII Graphing manual Torsa K, Torsv K, ` 8 J %TORSV%