Find the intersection of two lines: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) |
Drkameleon (talk | contribs) |
||
Line 422: | Line 422: | ||
define :line [a, b][ |
define :line [a, b][ |
||
init: [ |
init: [ |
||
this\slope: |
this\slope: div this\b\y-this\a\y this\b\x-this\a\x |
||
this\yInt: this\a\y - this\slope |
this\yInt: this\a\y - this\slope*this\a\x |
||
] |
] |
||
] |
] |
||
Line 432: | Line 432: | ||
intersect: function [line1, line2][ |
intersect: function [line1, line2][ |
||
x: |
x: div line2\yInt-line1\yInt line1\slope-line2\slope |
||
y: evalX line1 x |
y: evalX line1 x |
||