Intersection of Two Lines Using Vectors
Requires a Wolfram Notebook System
Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.
The intersection of two lines, each given by a pair of points (i.e. the respective equations are not used), is obtained by elementary vector considerations.[more]
Objective: to find the intersection of the two lines and .
The projection (blue line ) of the red segment through perpendicular to onto has magnitude , where is the angle between the red segment and .
In vector terms, the tip of the blue vector is at a distance from , so that its position vector is , where is a unit vector (in purple). Use the positive sign whenever ; otherwise use the negative sign.
Let be the angle betwen the lines and . The point of intersection of the two lines (in orange) lies at the distance from (with ), so that its position vector is , where is a unit vector (in black). Choose the sign to give the position closest to .[less]
Contributed by: Tomas Garza (January 2012)
Open content licensed under CC BY-NC-SA
The method relies on Mathematica's capabilities to handle vectors and the angles between them. If is the angle between the two lines, and is the angle between the red segment and the line (see step 2 in the figure), then it can readily be seen that the position vector of the point of intersection is
(, implying that the two lines are not parallel), where and are the position vectors of the points and , is the length of the red segment, and is a unit vector in the direction of the line , from to .