Skip to content

Instantly share code, notes, and snippets.

@JeffreyO
Last active August 29, 2015 14:08
Show Gist options
  • Save JeffreyO/5df5b38ead78ffc0ce24 to your computer and use it in GitHub Desktop.
Save JeffreyO/5df5b38ead78ffc0ce24 to your computer and use it in GitHub Desktop.
This is a program for testing if a line is Parallel, Perpendicular,
or Neither for the TI line of graphing calculators.
It is written in TI-Basic.
PROGRAM: TESTSLOP
:Input "SLOPE 1: ",A
:Input "SLOPE 2: ",B
:(AB)->C
:
:If C=-1
:Then
:Disp "PERP"
:Else
:If C=A^2 and C=B^2
:Then
:Disp "PARALLEL"
:Else
:Disp "NEITHER"
:End
@JeffreyO
Copy link
Author

Issue: If AB=-1 and A=-5, B=5 the program will return a false string of PERP instead of the correct string of NEITHER. Do any of you have an equation that will prevent this?

@JeffreyO
Copy link
Author

JeffreyO commented Dec 2, 2014

Never mind: I had a brain fart. -5*5=-25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment