Hidden WordScanner
Private scans · No account required

DuckieDai Euler Polyhedral Formula

Solve one missing vertex, edge, or face count from Euler's polyhedral formula.

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

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.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

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

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

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

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. """DuckieDai Euler Polyhedron for TI-84 Plus CE Python."""
  2. def duckiedai_intro(program_name, wait=True):
  3. """Show the reusable DuckieDai program opening."""
  4. title = program_name[:16]
  5. empty = 16 - len(title)
  6. left = empty // 2
  7. right = empty - left
  8. print("+----------------------+")
  9. print("| " + " " * left + title + " " * right + " |")
  10. print("| |")
  11. print("| __ |")
  12. print("| ___(o )> quack! |")
  13. print("| \\ <_. ) |")
  14. print("| `---' |")
  15. print("| by DuckieDai |")
  16. print("+----------------------+")
  17. print("Loading...")
  18. if wait:
  19. input("Press enter to start ")
  20. print("\n" * 6)
  21. def optional_count(prompt):
  22. """Return a nonnegative integer or None if blank."""
  23. while True:
  24. raw = input(prompt)
  25. if raw == "":
  26. return None
  27. try:
  28. value = int(raw)
  29. if value >= 0:
  30. return value
  31. except ValueError:
  32. pass
  33. print("Enter a whole number")
  34. print("or leave blank.")
  35. def main():
  36. duckiedai_intro("EULER FORMULA")
  37. print("EULER POLYHEDRAL")
  38. print("FORMULA")
  39. print()
  40. print("V - E + F = 2")
  41. print()
  42. print("V = vertices")
  43. print("E = edges")
  44. print("F = faces")
  45. print()
  46. print("Enter known values.")
  47. print("Leave ONE blank")
  48. print("to solve for it.")
  49. print()
  50. V = optional_count("Vertices V: ")
  51. E = optional_count("Edges E: ")
  52. F = optional_count("Faces F: ")
  53. known = 0
  54. if V is not None:
  55. known += 1
  56. if E is not None:
  57. known += 1
  58. if F is not None:
  59. known += 1
  60. print()
  61. # ==========================================
  62. # SOLVE VERTICES
  63. #
  64. # V - E + F = 2
  65. # V = 2 + E - F
  66. # ==========================================
  67. if known == 2 and V is None:
  68. V = 2 + E - F
  69. print("Using:")
  70. print("V - E + F = 2")
  71. print()
  72. print("Rearranged:")
  73. print("V = 2 + E - F")
  74. print()
  75. print("ANSWER")
  76. print("Vertices = " + str(V))
  77. # ==========================================
  78. # SOLVE EDGES
  79. #
  80. # E = V + F - 2
  81. # ==========================================
  82. elif known == 2 and E is None:
  83. E = V + F - 2
  84. print("Using:")
  85. print("V - E + F = 2")
  86. print()
  87. print("Rearranged:")
  88. print("E = V + F - 2")
  89. print()
  90. print("ANSWER")
  91. print("Edges = " + str(E))
  92. # ==========================================
  93. # SOLVE FACES
  94. #
  95. # F = 2 - V + E
  96. # ==========================================
  97. elif known == 2 and F is None:
  98. F = 2 - V + E
  99. print("Using:")
  100. print("V - E + F = 2")
  101. print()
  102. print("Rearranged:")
  103. print("F = 2 - V + E")
  104. print()
  105. print("ANSWER")
  106. print("Faces = " + str(F))
  107. # ==========================================
  108. # VERIFY ALL THREE VALUES
  109. # ==========================================
  110. elif known == 3:
  111. result = V - E + F
  112. print("Checking:")
  113. print()
  114. print(str(V) + " - " +
  115. str(E) + " + " +
  116. str(F))
  117. print()
  118. print("Result = " + str(result))
  119. print()
  120. if result == 2:
  121. print("VALID")
  122. print()
  123. print("Euler formula")
  124. print("is satisfied.")
  125. else:
  126. print("NOT VALID")
  127. print()
  128. print("Expected result:")
  129. print("2")
  130. else:
  131. print("Need at least")
  132. print("two known values.")
  133. print()
  134. print("DuckieDai says: done!")
  135. # TI-Python imports the selected AppVar rather than
  136. # setting __name__ to main.
  137. 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

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.