Hidden WordScanner
Private scans · No account required

DuckieDai Pick's Theorem

Solve a lattice polygon's area, interior-point count, or boundary-point count with Pick's theorem.

Version 1.0.0 · Tested on a TI calculator

← Back to Calculator Program Library

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. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.

geometry · MIT License

Overview

Solve a lattice polygon's area, interior-point count, or boundary-point count with Pick's theorem.

Usage

Inputs

  • Requested unknown: area, interior points, or boundary points
  • Nonnegative interior count and positive boundary count where applicable

Outputs

  • Requested Pick's-theorem quantity or invalid-result warning

Units: Area is in square coordinate units; point counts are whole numbers.

Assumptions and limitations

Assumptions

  • The polygon is a lattice polygon and Pick's theorem applies.

Constraints

  • The TI program validates nonnegative or positive whole-number point counts.

Known failures

  • Non-lattice or inapplicable polygons produce an incorrect interpretation.

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 Pick's theorem program runs on the physical calculator.
Dependencies
No imports
Suggested calculator name
PICKTHE — 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.

Browser preview

Try Pick's theorem

This browser preview calculates area from interior and boundary point counts. The TI program also solves the inverse counts.

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.

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

Exact reviewed bytes

Source code

Download .py

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

  1. """DuckieDai Pick's Theorem 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 whole_number(prompt):
  22. """Require a nonnegative whole number."""
  23. while True:
  24. try:
  25. value = int(input(prompt))
  26. if value >= 0:
  27. return value
  28. except ValueError:
  29. pass
  30. print("Enter a whole number")
  31. print("0 or greater.")
  32. def positive_whole(prompt):
  33. """Require a positive whole number."""
  34. while True:
  35. try:
  36. value = int(input(prompt))
  37. if value > 0:
  38. return value
  39. except ValueError:
  40. pass
  41. print("Enter a whole number")
  42. print("above 0.")
  43. def positive_number(prompt):
  44. """Require a positive number."""
  45. while True:
  46. try:
  47. value = float(input(prompt))
  48. if value > 0 and value < 1e100:
  49. return value
  50. except ValueError:
  51. pass
  52. print("Enter a number above 0.")
  53. def main():
  54. duckiedai_intro("PICKS THEOREM")
  55. print("PICK'S THEOREM")
  56. print()
  57. print("A = i + b/2 - 1")
  58. print()
  59. print("i = interior points")
  60. print("b = boundary points")
  61. print()
  62. print("What do you need?")
  63. print()
  64. print("1. Area")
  65. print("2. Interior points")
  66. print("3. Boundary points")
  67. print()
  68. choice = input("Choose 1-3: ")
  69. print()
  70. # ==========================================
  71. # 1. SOLVE AREA
  72. #
  73. # A = i + b/2 - 1
  74. # ==========================================
  75. if choice == "1":
  76. i = whole_number(
  77. "Interior points: "
  78. )
  79. b = positive_whole(
  80. "Boundary points: "
  81. )
  82. area = (
  83. i +
  84. b / 2 -
  85. 1
  86. )
  87. print()
  88. print("Using:")
  89. print("A = i + b/2 - 1")
  90. print()
  91. print("A = " + str(i))
  92. print("+ " + str(b) + "/2")
  93. print("- 1")
  94. print()
  95. print("ANSWER")
  96. print("Area = " + str(area))
  97. print("square units")
  98. # ==========================================
  99. # 2. SOLVE INTERIOR POINTS
  100. #
  101. # i = A - b/2 + 1
  102. # ==========================================
  103. elif choice == "2":
  104. area = positive_number(
  105. "Area: "
  106. )
  107. b = positive_whole(
  108. "Boundary points: "
  109. )
  110. i = (
  111. area -
  112. b / 2 +
  113. 1
  114. )
  115. print()
  116. print("Using:")
  117. print("A = i + b/2 - 1")
  118. print()
  119. print("Rearranged:")
  120. print("i = A - b/2 + 1")
  121. print()
  122. if i < 0 or i != int(i):
  123. print("INVALID RESULT")
  124. print()
  125. print("Interior points")
  126. print("must be a whole")
  127. print("number.")
  128. print()
  129. print("Check your values.")
  130. else:
  131. i = int(i)
  132. print("ANSWER")
  133. print("Interior points =")
  134. print(str(i))
  135. # ==========================================
  136. # 3. SOLVE BOUNDARY POINTS
  137. #
  138. # b = 2(A - i + 1)
  139. # ==========================================
  140. elif choice == "3":
  141. area = positive_number(
  142. "Area: "
  143. )
  144. i = whole_number(
  145. "Interior points: "
  146. )
  147. b = (
  148. 2 *
  149. (area - i + 1)
  150. )
  151. print()
  152. print("Using:")
  153. print("A = i + b/2 - 1")
  154. print()
  155. print("Rearranged:")
  156. print("b = 2(A-i+1)")
  157. print()
  158. if b <= 0 or b != int(b):
  159. print("INVALID RESULT")
  160. print()
  161. print("Boundary points")
  162. print("must be a positive")
  163. print("whole number.")
  164. print()
  165. print("Check your values.")
  166. else:
  167. b = int(b)
  168. print("ANSWER")
  169. print("Boundary points =")
  170. print(str(b))
  171. else:
  172. print("Invalid choice.")
  173. print()
  174. print("DuckieDai says: done!")
  175. # TI-Python imports the selected AppVar rather than
  176. # setting __name__ to main.
  177. main()
Filename
PICKTHE.py
Size
5044 bytes
SHA-256
1714c126a432524b92b65e5458d8a81699a3015d89d725f9ebc2295a23eca18a

Transfer and launch

  1. Confirm that your calculator is the Python-capable model named above. Check that its OS and Python App versions match the reviewed record.
  2. Download the .py source above and verify its SHA-256 digest if your computer provides that option.
  3. Use TI Connect CE to send the Python file to a compatible calculator. PICKTHE is a suggested name; you may choose another valid, unique calculator name.
  4. Open the Python App, select the program, and check sample inputs before relying on other results.

Read the complete installation, launch, troubleshooting, and removal guide.

Availability does not mean a teacher, school, or exam permits this program. Follow the applicable rules.

Version history

Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.