Line segment intersection

I’m glad to see you’ve found the answer here:


But I think your code does not work with negative coordinates:

var testInters:Point = linesIntersection(new Point(-50, 100), new Point(111, 100), new Point(0, 0), new Point(0, 999));
trace(testInters);
[trace] (x=-7.105427357601002e-15, y=100)

ps. can someone tell my how to format text in reply to make it look like code? Cant see any tag or button on replay panel!