Find the intersection of two lines: Difference between revisions

→‎{{header|TI-83 BASIC}}: Better special characters
(→‎{{header|TI-83 BASIC}}: Better special characters)
Line 1,731:
{{trans|Rexx}}
Simple version:
<lang ti83b>[[4,0][6,10][0,3][10,7]]->[A]
([A](2,2)-[A](1,2))/([A](2,1)-[A](1,1))->B→B
[A](1,2)-[A](1,1)*B->AB→A
([A](4,2)-[A](3,2))/([A](4,1)-[A](3,1))->D→D
[A](3,2)-[A](3,1)*D->CD→C
(C-A)/(B-D)->X→X
A+X*B->YB→Y
C+X*D->ZD→Z
Disp {X,Y}</lang>
{{out}}
Line 1,745:
</pre>
Full version:
<lang ti83b>[[4,0][6,10][0,3][10,7]]->[A]
{4,2}->Dim→Dim([B])
0→M
0->M
If [A](1,1)=[A](2,1)
Then
[A](1,1)->[B](3,1)
If [A](1,2)=[A](2,2):1->M1→M
Else
1->1→[B](4,1)
([A](2,2)-[A](1,2))/([A](2,1)-[A](1,1))->[B](1,1)
[A](1,2)-[B](1,1)*[A](1,1)->[B](2,1)
End
If [A](3,1)=[A](4,1)
Then
[A](3,1)->[B](3,2)
If [A](3,2)=[A](4,2):2->M2→M
Else
1->1→[B](4,2)
([A](4,2)-[A](3,2))/([A](4,1)-[A](3,1))->[B](1,2)
[A](3,2)-[B](1,2)*[A](3,1)->[B](2,2)
End
If M=0 Then
Line 1,772:
Then
If [B](3,1)=[B](3,2)
Then:3->M3→M
Else:4->M4→M
End
Else
[B](3,1)->X→X
[B](1,2)*X+[B](2,2)->Y→Y
End
Else
If [B](4,2)=0
Then
[B](3,2)->X→X
[B](1,1)*X+[B](2,1)->Y→Y
Else
If [B](1,1)=[B](1,2)
Then
If [B](2,1)=[B](2,2)
Then:5->M5→M
Else:6->M6→M
End
Else
([B](2,2)-[B](2,1))/([B](1,1)-[B](1,2))->X→X
[B](1,1)*X+[B](2,1)->Y→Y
End
End
1,392

edits