← 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
Calculate perpendicular distance from a point to a line written as Ax + By + C = 0.
Usage
Inputs
- Line coefficients A, B, and C
- Point coordinates x0 and y0
Outputs
- Perpendicular distance and an on-line notice when the distance is zero
Units: Coordinates and coefficients must use one consistent coordinate system.
Assumptions and limitations
Assumptions
- The line is represented by Ax + By + C = 0.
Constraints
- A and B cannot both be zero; entered values must remain between -1e100 and 1e100.
Known failures
- An all-zero A and B pair is rejected.
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 point to line distance program runs on the physical calculator.
- Dependencies
- math
- Suggested calculator name
PTLINE— 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 point-to-line distance
This browser preview applies the perpendicular-distance formula to one line and point.
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
"""DuckieDai Point-Line Distance 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 number(prompt):"""Allow positive, negative, or zero values."""while True:try:value = float(input(prompt))if value > -1e100 and value < 1e100:return valueexcept ValueError:passprint("Enter a valid number.")def get_line():"""Get valid coefficients for Ax + By + C = 0."""while True:print("LINE:")print("Ax + By + C = 0")print()A = number("A: ")B = number("B: ")C = number("C: ")if A != 0 or B != 0:return A, B, Cprint()print("INVALID LINE")print("A and B cannot")print("both be zero.")print()def point_line_distance(A, B, C, x0, y0):"""Return perpendicular distance from point to line."""numerator = abs(A * x0 +B * y0 +C)denominator = sqrt(A ** 2 +B ** 2)distance = numerator / denominatorreturn numerator, denominator, distancedef main():duckiedai_intro("POINT-LINE DIST")print("POINT TO LINE")print("DISTANCE")print()print("Line form:")print("Ax + By + C = 0")print()print("Formula:")print("|A*x0+B*y0+C|")print("----------------")print("sqrt(A^2+B^2)")print()A, B, C = get_line()print()print("POINT (x0, y0)")print()x0 = number("x0: ")y0 = number("y0: ")numerator, denominator, distance = \point_line_distance(A, B, C, x0, y0)print()print("Using:")print("d = |A*x0+B*y0+C|")print(" /sqrt(A^2+B^2)")print()print("Top =")print(str(numerator))print()print("Bottom =")print(str(denominator))print()print("ANSWER")print("Distance =")print(str(distance))print("units")if distance == 0:print()print("Point lies on")print("the line.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
PTLINE.py- Size
- 3045 bytes
- SHA-256
01930d1a4a1ad79ed564c62296cec16f6e3cb7b371ec0c98dd7957042ee0d4ff
Transfer and launch
- Confirm that your calculator is the Python-capable model named above. Check that its OS and Python App versions match the reviewed record.
- Download the
.pysource above and verify its SHA-256 digest if your computer provides that option. - Use TI Connect CE to send the Python file to a compatible calculator.
PTLINEis a suggested name; you may choose another valid, unique calculator name. - 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
- 1.0.0 — current version, published . Download this reviewed version
Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.