HP 32SII: Volume of a Square Frustum (Three Approaches in RPN)
The volume of a square frustum is:
v = height ÷ 3 × (s1^2 + s2^2 + √(s1^2 × s2^2))
which is based off the formula for the volume of general frustum:
v = height ÷ 3 × (base_area_1 + base_area_2 + √(base_area_1 × base_area_2))
Here are three approaches, which were all done with a HP 32SII calculator. The beauty of RPN is on display here. The three programs are labeled A, C, and D.
s1, s2: side of the square base h: height
Stack: Z: s1 Y: s2 X: h
Program A: (24 steps, 36 bytes)
V = h/3 * (s1^2 + s2^2 + √(s1^2 * s2^2))
LBL A
STO H
R↓
x²
x<>y
x²
ENTER
ENTER
CLx
-
R↓
x<>y
R↓
×
√
R↓
+
R↑
+
RCL H
×
3
÷
RTN
Program C: (17 steps, 25.5 bytes)
Note: √(s1^2 * s2^2) = s1 * s2
V = h/3 * (s1^2 + s2^2 + (s1 * s2))
LBL C
ENTER
3
÷
R↓
×
LST x
x<>y
R↓
x²
x<>y
x²
+
R↑
+
×
RTN
Program D: (15 steps, 22.5 bytes)
Note: s1^2 + s2^2 + s1 * s2 = s1^2 + s2^2 + 2 * s1 * s2 – s1 *s2 = (s1 + s2)^2 - s1*s2
V = h/3 * ((s1 + s2)^2 - s1 * s2)
LBL D
3
÷
R↓
×
LST x
x<>y
R↓
+
x²
R↑
-
×
RTN
Examples
Example 1:
s1: 24
s2: 30
h: 5.8
Result: 4245.6
Example 2:
s1: 2.54
s2: 12.15
h: 10
Result: ≈ 616.4503
Eddie
All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.
