geometry · MIT License
Overview
Solve an ellipse's area, semi-major axis, or semi-minor axis with labelled formulas and guarded positive inputs.
- Tested on a TI calculator
- Downloaded 48 times
- Version 1.0.0
- 3675 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.
- a and b are the semi-axis lengths of one ellipse.
- Inputs must be positive and below 1e100.
- Inconsistent units produce an incorrect numerical result.
Try the DuckieDai calculator screen
This browser preview calculates area from the two semi-axes. The TI program also solves either missing semi-axis.
TI-84 Plus CE Python · screen preview
Learn the math
How the area of an ellipse works
The idea
An ellipse is a stretched circle. Where a circle has one radius, an ellipse has two: half its longest width and half its shortest width.
Replace r*r in the circle formula with those two half-widths and you have the area.
The formula
A = pi*a*b
A- area
a- semi-major axis: half the longest diameter
b- semi-minor axis: half the shortest diameter
Using the program
- 1 finds the area. 2 finds the semi-major axis. 3 finds the semi-minor axis.
- Enter the two values you know.
Worked example
An ellipse is 10 units long and 6 units wide, so a = 5 and b = 3. Choose 1 and enter 5 and 3.
A = pi x 5.0 x 3.0
The program shows Area = 47.12 square units (it prints more decimal places).
Tips and common mistakes
- Use the half-widths, not the full length and width.
- When a equals b the ellipse is a circle and the formula becomes pi*r^2.
- This gives area only. An ellipse's perimeter has no simple exact formula.
Where this comes up
Ellipses appear in the conic sections unit of algebra 2 and precalculus, and in physics and astronomy when orbits are described.
Exact reviewed bytes
Source code
"""DuckieDai Ellipse Area for TI-84 Plus CE Python."""from math import pidef 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 main():duckiedai_intro("ELLIPSE AREA")print("AREA OF ELLIPSE")print()print("Formula:")print("A = pi*a*b")print()print("a = semi-major axis")print("b = semi-minor axis")print()print("What do you need?")print()print("1. Area")print("2. Semi-major axis")print("3. Semi-minor axis")print()choice = input("Choose 1-3: ")print()# ==========================================# 1. SOLVE AREA## A = pi*a*b# ==========================================if choice == "1":a = positive_number("Semi-major a: ")b = positive_number("Semi-minor b: ")area = pi * a * bprint()print("Using:")print("A = pi*a*b")print()print("A = pi x")print(str(a) + " x " + str(b))show_answer("Area",area,"square units")# ==========================================# 2. SOLVE SEMI-MAJOR AXIS## a = A / (pi*b)# ==========================================elif choice == "2":area = positive_number("Area: ")b = positive_number("Semi-minor b: ")a = area / (pi * b)print()print("Using:")print("A = pi*a*b")print()print("Rearranged:")print("a = A/(pi*b)")show_answer("a",a,"units")# ==========================================# 3. SOLVE SEMI-MINOR AXIS## b = A / (pi*a)# ==========================================elif choice == "3":area = positive_number("Area: ")a = positive_number("Semi-major a: ")b = area / (pi * a)print()print("Using:")print("A = pi*a*b")print()print("Rearranged:")print("b = A/(pi*a)")show_answer("b",b,"units")else:print("Invalid choice.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
ELLIPSE.py- Size
- 3675 bytes
- SHA-256
66732e0d1831cc0bcbac60aa47066db15d918bfc34dce3242f33afabb725c9fe
Usage
Inputs
- Requested unknown: area, semi-major axis, or semi-minor axis
- Two known positive values below 1e100
Outputs
- Requested ellipse quantity with formula and labelled units
Units: Use one consistent length unit; area uses that unit squared.
Assumptions and limitations
Assumptions
- a and b are the semi-axis lengths of one ellipse.
Constraints
- Inputs must be positive and below 1e100.
Known failures
- Inconsistent units produce an incorrect numerical 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 ellipse area program runs on the physical calculator.
- Dependencies
- math
- Suggested calculator name
ELLIPSE— 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 ELLIPSE 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.