Find the intersection of two lines: Difference between revisions

m
Line 255:
⍝ The following solver will take ⍵ the matrix of coordinates, one point per row, then massage the argument to extract x,y
⍝ and inject 1, where needed
⍝ Applied twice, we now have a, b and a', b' defining the two lines, we need to resolve it in x and y, in order to determine
⍝ their intersection
⍝ y = ax + b
⍝ y = a'x + b'
⍝ In order to reuse the same solver, we need to format it a little bit the arguments, and change the sign of a and a', and multiply (a,b) by (-1, 1):therefore
⍝ multiply (a,b) by (-1, 1):
⍝ b = -ax + y
⍝ b' = -a'x + y
Anonymous user