geometry · MIT License
Overview
Solve frustum volume, height, or either base area using the square-root frustum-volume formula.
- Tested on a TI calculator
- Downloaded 46 times
- Version 1.0.0
- 5989 bytes
- Uses math
Tried it? Did this program work on your calculator?
Before you run it
- TI-84 Plus CE Python · tested on OS 5.8.3, Python App 5.8.3.0048
- TI Connect CE .py conversion to a Python AppVar in RAM; owner physically verified the supplied program.
- A1 and A2 are positive parallel base areas of one frustum.
- All entered values must be positive and below 1e100.
- Inconsistent units produce an incorrect result.
Try the DuckieDai calculator screen
This browser preview calculates volume from height and two base areas. The TI program also solves the inverse modes.
TI-84 Plus CE Python · screen preview
Learn the math
How the volume of a frustum works
The idea
A frustum is what is left when you slice the top off a cone or pyramid parallel to its base: a bucket, a lampshade, a paper cup.
Its volume depends on the height and on the areas of both ends, with a square-root term that accounts for the taper.
The formula
V = h/3 * (A1 + A2 + sqrt(A1*A2))
V- volume
h- perpendicular height between the two ends
A1, A2- areas of the two parallel ends
Using the program
- 1 finds the volume. 2 finds the height. 3 and 4 find either end area.
- Enter areas, not radii or side lengths.
Worked example
A frustum is 6 units tall with end areas of 16 and 4 square units. Choose 1 and enter 6, 16, and 4.
V = 6/3 x (16 + 4 + sqrt(64))
The program shows Volume = 56.0 cubic units.
Tips and common mistakes
- For a circular frustum, work out each end area as pi*r^2 first.
- Use the vertical height, not the slant height.
- If both ends have the same area, the shape is a prism or cylinder and the formula gives area times height.
Where this comes up
It appears in the volume unit of geometry and in calculus as a standard solid of revolution. Design and engineering courses use it for tapered containers.
Exact reviewed bytes
Source code
"""DuckieDai Frustum Volume for TI-84 Plus CE Python."""from math import sqrtdef duckiedai_intro(program_name, wait=True):"""Show the reusable DuckieDai program opening."""title = program_name[:16]empty = 16 - len(title)left = empty // 2right = empty - leftprint("+----------------------+")print("| " + " " * left + title + " " * right + " |")print("| |")print("| __ |")print("| ___(o )> quack! |")print("| \\ <_. ) |")print("| `---' |")print("| by DuckieDai |")print("+----------------------+")print("Loading...")if wait:input("Press enter to start ")print("\n" * 6)def positive_number(prompt):"""Require a positive finite number."""while True:try:value = float(input(prompt))if value > 0 and value < 1e100:return valueexcept ValueError:passprint("Enter a number above 0.")def show_answer(name, value, unit):print()print("ANSWER")print(name + " = " + str(value))print(unit)def frustum_volume(h, a1, a2):"""Calculate frustum volume."""return (h / 3 *(a1 + a2 + sqrt(a1 * a2)))def solve_missing_area(volume, height, known_area):"""Solve one base area when the other is known."""k = 3 * volume / heightinside = 4 * k - 3 * known_areaif inside < 0:return Noneroot_area = (-sqrt(known_area) +sqrt(inside)) / 2if root_area < 0:return Nonereturn root_area ** 2def main():duckiedai_intro("FRUSTUM VOLUME")print("FRUSTUM VOLUME")print()print("V = h/3 *")print("(A1+A2+sqrt(A1*A2))")print()print("A1 = base area 1")print("A2 = base area 2")print("h = height")print()print("What do you need?")print()print("1. Volume")print("2. Height")print("3. Base area A1")print("4. Base area A2")print()choice = input("Choose 1-4: ")print()# ==========================================# 1. SOLVE VOLUME## V = h/3(A1+A2+sqrt(A1*A2))# ==========================================if choice == "1":h = positive_number("Height: ")a1 = positive_number("Base area A1: ")a2 = positive_number("Base area A2: ")volume = frustum_volume(h, a1, a2)print()print("Using:")print("V = h/3 *")print("(A1+A2+sqrt(A1*A2))")show_answer("Volume",volume,"cubic units")# ==========================================# 2. SOLVE HEIGHT## h = 3V /# (A1+A2+sqrt(A1*A2))# ==========================================elif choice == "2":volume = positive_number("Volume: ")a1 = positive_number("Base area A1: ")a2 = positive_number("Base area A2: ")denominator = (a1 +a2 +sqrt(a1 * a2))h = (3 * volume /denominator)print()print("Using:")print("V = h/3 *")print("(A1+A2+sqrt(A1*A2))")print()print("Rearranged:")print("h = 3V /")print("(A1+A2+sqrt(A1*A2))")show_answer("Height",h,"units")# ==========================================# 3. SOLVE A1# ==========================================elif choice == "3":volume = positive_number("Volume: ")h = positive_number("Height: ")a2 = positive_number("Known area A2: ")a1 = solve_missing_area(volume,h,a2)if a1 is None:print()print("NO VALID RESULT")print()print("Check volume,")print("height, and area.")else:print()print("Using:")print("V = h/3 *")print("(A1+A2+sqrt(A1*A2))")print()print("Solved for A1.")show_answer("A1",a1,"square units")# ==========================================# 4. SOLVE A2# ==========================================elif choice == "4":volume = positive_number("Volume: ")h = positive_number("Height: ")a1 = positive_number("Known area A1: ")a2 = solve_missing_area(volume,h,a1)if a2 is None:print()print("NO VALID RESULT")print()print("Check volume,")print("height, and area.")else:print()print("Using:")print("V = h/3 *")print("(A1+A2+sqrt(A1*A2))")print()print("Solved for A2.")show_answer("A2",a2,"square units")else:print("Invalid choice.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
FRUSTVOL.py- Size
- 5989 bytes
- SHA-256
843d2b627eedddda839b21978ad6b94af9db20adee8b489f96886e5c4adc8f4e
Usage
Inputs
- Requested unknown: volume, height, or one base area
- Three known positive values
Outputs
- Requested frustum quantity with formula and units
Units: Height uses length units, base areas use squared units, and volume uses cubed units.
Assumptions and limitations
Assumptions
- A1 and A2 are positive parallel base areas of one frustum.
Constraints
- All entered values must be positive and below 1e100.
Known failures
- Inconsistent units produce an incorrect result.
Compatibility and review
- Review status
- Tested on a TI calculator
- Tested on
- TI-84 Plus CE Python; OS 5.8.3; Python App 5.8.3.0048; exact source owner-tested through TI Connect CE
- What happened
- Owner confirmed the supplied frustum volume program runs on the physical calculator.
- Dependencies
- math
- Suggested calculator name
FRUSTVOL— you can give it another valid, unique name when you transfer it- Desktop test cases
- Not available for this interactive-only source
This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.
Transfer and launch
Download the .py file, send it to your calculator with TI Connect CE as FRUSTVOL or another name, then open the Python App and try the worked example on this page first.
Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.
Version history
- 1.0.0 — current version, published . Download this reviewed version
Related learning
Did a DuckieDai program help with your homework? Every program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.
Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.
Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.