[Math] Intersection Of Two Lines In 2D

geometry

). To find the Point where 2 lines intersect, is there any simpler method than this?

http://en.wikipedia.org/wiki/Line-line_intersection

For example could you use the equation of the line? (y = mx + b)

Another question: what would happen if I use Determinants for 2 lines that never intersect? (parallel lines). I think I should mention that I intend to do this calculation in a programming language (AS3).

I suppose that those determinants will return something along the lines of division by zero / +/- infinity for parallel lines. I didn't try it yet ::- D. Still trying to figure out the best way to get the intersection point. Determinants or… do you know another method?

Best Answer

well you probably want to include vertical lines, so you should have a system of the form $a_1x+b_1y=c_1, a_2x+b_2y=c_2$. if $a_1b_2-a_2b_1=0$ you have parallel (or identical) lines. else return the point of intersection, which is $$ (x,y)=\Big(\frac{c_1b_2-b_1c_2}{a_1b_2-b_1a_2},\frac{a_1c_2-c_1a_2}{a_1b_2-b_1a_2}\Big). $$ for instance using cramer's rule. in general, you should take linear algebra at some point if you haven't. you will need it.