geometry · MIT License
Overview
Solve one missing vertex, edge, or face count from Euler's polyhedral formula.
- Tested on a TI calculator
- Downloaded 48 times
- Version 1.0.0
- 4037 bytes
- No imports
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.
- The object satisfies Euler's polyhedral formula.
- Leave exactly one value blank in the TI program.
- Values that do not describe the intended polyhedron may produce a mathematically valid but inapplicable count.
Try the DuckieDai calculator screen
This browser preview solves faces from vertices and edges. The TI program lets you leave any one of the three counts blank.
TI-84 Plus CE Python · screen preview
Learn the math
How Euler's polyhedral formula works
The idea
For any solid with flat faces and no holes, the number of corners minus the number of edges plus the number of faces is always 2. It works for cubes, pyramids, prisms, and far stranger shapes.
The formula
V - E + F = 2
V- vertices (corners)
E- edges
F- faces
Using the program
- Enter the two counts you know and press Enter on the one you want.
- If you enter all three, the program checks whether they satisfy the formula.
Worked example
A cube has 8 vertices and 12 edges. Enter 8, then 12, and leave faces blank.
F = 2 - V + E = 2 - 8 + 12
The program shows Faces = 6.
Tips and common mistakes
- The formula applies to convex solids and others without holes. A doughnut-shaped solid gives 0, not 2.
- Count each edge once, even though two faces share it.
- Entering all three values is a quick way to check a count you made by hand.
Where this comes up
It is taught in the solids unit of geometry and in introductory discrete mathematics, where it is the starting point for graph theory.
Exact reviewed bytes
Source code
"""DuckieDai Euler Polyhedron for TI-84 Plus CE Python."""def 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 optional_count(prompt):"""Return a nonnegative integer or None if blank."""while True:raw = input(prompt)if raw == "":return Nonetry:value = int(raw)if value >= 0:return valueexcept ValueError:passprint("Enter a whole number")print("or leave blank.")def main():duckiedai_intro("EULER FORMULA")print("EULER POLYHEDRAL")print("FORMULA")print()print("V - E + F = 2")print()print("V = vertices")print("E = edges")print("F = faces")print()print("Enter known values.")print("Leave ONE blank")print("to solve for it.")print()V = optional_count("Vertices V: ")E = optional_count("Edges E: ")F = optional_count("Faces F: ")known = 0if V is not None:known += 1if E is not None:known += 1if F is not None:known += 1print()# ==========================================# SOLVE VERTICES## V - E + F = 2# V = 2 + E - F# ==========================================if known == 2 and V is None:V = 2 + E - Fprint("Using:")print("V - E + F = 2")print()print("Rearranged:")print("V = 2 + E - F")print()print("ANSWER")print("Vertices = " + str(V))# ==========================================# SOLVE EDGES## E = V + F - 2# ==========================================elif known == 2 and E is None:E = V + F - 2print("Using:")print("V - E + F = 2")print()print("Rearranged:")print("E = V + F - 2")print()print("ANSWER")print("Edges = " + str(E))# ==========================================# SOLVE FACES## F = 2 - V + E# ==========================================elif known == 2 and F is None:F = 2 - V + Eprint("Using:")print("V - E + F = 2")print()print("Rearranged:")print("F = 2 - V + E")print()print("ANSWER")print("Faces = " + str(F))# ==========================================# VERIFY ALL THREE VALUES# ==========================================elif known == 3:result = V - E + Fprint("Checking:")print()print(str(V) + " - " +str(E) + " + " +str(F))print()print("Result = " + str(result))print()if result == 2:print("VALID")print()print("Euler formula")print("is satisfied.")else:print("NOT VALID")print()print("Expected result:")print("2")else:print("Need at least")print("two known values.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
EULERPF.py- Size
- 4037 bytes
- SHA-256
ad1a878f3de1e5db1051e22de457d37604340cec90547b575d86362b18c238ce
Usage
Inputs
- Exactly two known nonnegative whole-number counts for vertices, edges, and faces
Outputs
- The remaining count from V - E + F = 2
Units: Counts are whole numbers.
Assumptions and limitations
Assumptions
- The object satisfies Euler's polyhedral formula.
Constraints
- Leave exactly one value blank in the TI program.
Known failures
- Values that do not describe the intended polyhedron may produce a mathematically valid but inapplicable count.
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 Euler formula program runs on the physical calculator.
- Dependencies
- No imports
- Suggested calculator name
EULERPF— 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 EULERPF 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.