← 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 dot product, magnitudes, angle, and angle class for 2D or 3D vectors.
Usage
Inputs
- Two 2D or 3D vectors with finite components
Outputs
- Dot product, magnitudes, angle in degrees, and perpendicular/acute/obtuse classification
Units: Both vectors must use compatible component units.
Assumptions and limitations
Assumptions
- Neither vector is the zero vector when calculating an angle.
Constraints
- Components must remain between -1e100 and 1e100; zero-vector angles are undefined.
Known failures
- A zero vector cannot produce a direction or angle.
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 vector dot product angle program runs on the physical calculator.
- Dependencies
- math
- Suggested calculator name
VECDOT— 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 a 2D vector angle
This browser preview calculates the dot product and angle for two 2D vectors. The TI program also supports 3D vectors.
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 Vector Angle for TI-84 Plus CE Python."""from math import sqrt, acos, degreesdef 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 safe_acos(value):"""Protect acos from floating-point rounding."""if value > 1:value = 1if value < -1:value = -1return acos(value)def magnitude(x, y, z=0):"""Return vector magnitude."""return sqrt(x ** 2 +y ** 2 +z ** 2)def main():duckiedai_intro("VECTOR ANGLE")print("VECTOR DOT PRODUCT")print("& ANGLE")print()print("1. 2D vectors")print("2. 3D vectors")print()choice = input("Choose 1 or 2: ")print()# ==========================================# 2D VECTOR INPUT# ==========================================if choice == "1":print("VECTOR u")ux = number("ux: ")uy = number("uy: ")uz = 0print()print("VECTOR v")vx = number("vx: ")vy = number("vy: ")vz = 0# ==========================================# 3D VECTOR INPUT# ==========================================elif choice == "2":print("VECTOR u")ux = number("ux: ")uy = number("uy: ")uz = number("uz: ")print()print("VECTOR v")vx = number("vx: ")vy = number("vy: ")vz = number("vz: ")else:print("Invalid choice.")print()print("DuckieDai says: done!")return# ==========================================# VECTOR MAGNITUDES# ==========================================mag_u = magnitude(ux, uy, uz)mag_v = magnitude(vx, vy, vz)# Angle is undefined if either vector# has zero magnitude.if mag_u == 0 or mag_v == 0:print()print("ANGLE UNDEFINED")print()print("A zero vector has")print("no direction.")print()print("DuckieDai says: done!")return# ==========================================# DOT PRODUCT## u dot v =# ux*vx + uy*vy + uz*vz# ==========================================dot = (ux * vx +uy * vy +uz * vz)# ==========================================# ANGLE## cos(theta) =# dot / (|u|*|v|)# ==========================================cos_theta = (dot /(mag_u * mag_v))theta = degrees(safe_acos(cos_theta))# ==========================================# RESULTS# ==========================================print()print("Using:")print("u dot v /")print("(|u|*|v|)")print()print("DOT PRODUCT")print("u dot v =")print(str(dot))print()print("MAGNITUDES")print("|u| = " + str(mag_u))print("|v| = " + str(mag_v))print()print("cos(theta) =")print(str(cos_theta))print()print("ANGLE")print("theta =")print(str(theta))print("degrees")print()# ==========================================# CLASSIFY ANGLE# ==========================================tolerance = 0.0000001if abs(dot) < tolerance:print("Vectors are")print("PERPENDICULAR.")elif dot > 0:print("Angle is ACUTE.")else:print("Angle is OBTUSE.")print()print("DuckieDai says: done!")# TI-Python imports the selected AppVar rather than# setting __name__ to main.main()
- Filename
VECDOT.py- Size
- 4772 bytes
- SHA-256
ce10c3625e3880468361fd5b292e2d982ecf2ee49a0fba89e9e6959eccb7dcc8
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.
VECDOTis 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.