Find the intersection of two lines: Difference between revisions
Content added Content deleted
m (→{{header|APL}}) |
m (→{{header|APL}}) |
||
Line 253: | Line 253: | ||
⍝ The ( 4 1 ) matrix as the right argument. |
⍝ The ( 4 1 ) matrix as the right argument. |
||
⍝ ( 6 1 ) |
⍝ ( 6 1 ) |
||
⍝ |
⍝ We will define a solver that will take the matrix of coordinates, one point per row, then massage the argument to extract x,y |
||
⍝ and inject 1, where needed |
⍝ and inject 1, where needed, and return a pair (a, b) of resolved unknowns. |
||
⍝ Applied twice, we |
⍝ Applied twice, we will 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 |
⍝ their intersection |
||
⍝ y = ax + b |
⍝ y = ax + b |