This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function intersect(x1, y1, x2, y2, x3, y3, x4, y4){ | |
var a1, a2, b1, b2, c1, c2; | |
var r1, r2 , r3, r4; | |
var denom, offset, num; | |
// Compute a1, b1, c1, where line joining points 1 and 2 | |
// is "a1 x + b1 y + c1 = 0". | |
a1 = y2 - y1; | |
b1 = x1 - x2; | |
c1 = (x2 * y1) - (x1 * y2); |