- Line-line intersection
In
Euclidean geometry , theintersection of a line and a line can be theempty set , a point, or a line. Distinguishing these cases, and finding the intersection point have use, for example, incomputer graphics ,motion planning , andcollision detection .The number and locations of possible intersections between two lines and the number of possible lines with no intersections (parallel) with a given line are the distinguishing features of
Non-Euclidean geometry . The entry titled "Parallel postulate " provides additional background on this topic.Mathematics
The intersection of two lines L_1, and L_2, in 2 dimensional space. With line L_1, being defined by two points x_1,y_1), and x_2,y_2),, and line L_2, being defined by two points x_3,y_3), and x_4,y_4),. ]
The intersection P, of line L_1, and L_2, can be defined using
determinant s.:Px = frac{egin{vmatrix} egin{vmatrix} x_1 & y_1\x_2 & y_2end{vmatrix} & egin{vmatrix} x_1 & 1\x_2 & 1end{vmatrix} \\ egin{vmatrix} x_3 & y_3\x_4 & y_4end{vmatrix} & egin{vmatrix} x_3 & 1\x_4 & 1end{vmatrix} end{vmatrix} }{egin{vmatrix} egin{vmatrix} x_1 & 1\x_2 & 1end{vmatrix} & egin{vmatrix} y_1 & 1\y_2 & 1end{vmatrix} \\ egin{vmatrix} x_3 & 1\x_4 & 1end{vmatrix} & egin{vmatrix} y_3 & 1\y_4 & 1end{vmatrix} end{vmatrix,!Py = frac{egin{vmatrix} egin{vmatrix} x_1 & y_1\x_2 & y_2end{vmatrix} & egin{vmatrix} y_1 & 1\y_2 & 1end{vmatrix} \\ egin{vmatrix} x_3 & y_3\x_4 & y_4end{vmatrix} & egin{vmatrix} y_3 & 1\y_4 & 1end{vmatrix} end{vmatrix} }{egin{vmatrix} egin{vmatrix} x_1 & 1\x_2 & 1end{vmatrix} & egin{vmatrix} y_1 & 1\y_2 & 1end{vmatrix} \\ egin{vmatrix} x_3 & 1\x_4 & 1end{vmatrix} & egin{vmatrix} y_3 & 1\y_4 & 1end{vmatrix} end{vmatrix,!
The determinants can be written out as:
egin{align}P(x,y)= igg(&frac{(x_1 y_2-y_1 x_2)(x_3-x_4)-(x_1-x_2)(x_3 y_4-y_3 x_4)}{(x_1-x_2)(y_3-y_4)-(y_1-y_2)(x_3-x_4)}, \ &frac{(x_1 y_2-y_1 x_2)(y_3-y_4)-(y_1-y_2)(x_3 y_4-y_3 x_4)}{(x_1-x_2)(y_3-y_4)-(y_1-y_2)(x_3-x_4)}igg)end{align}
Note that the intersection point is for the infinitely long lines defined by the points, rather than the
line segment s between the points, and can produce an intersection point beyond the lengths of the line segments.ee also
*
Line segment intersection References
Wikimedia Foundation. 2010.