Welcome to the intersection of two lines calculator, which will make you forget you've ever had trouble with this notorious problem of finding the point where some two lines intersect. Our tool accepts both the slope-intercept and general form of equation, and it can determine the intersection of two lines in 3D space as well!
Below you'll find a bit of theory related to this area. We'll recall what the intersection of two lines is all about and discuss the intersection of two lines formulas in 2D. Then we'll move on to 3D space, where we will see a bit of theory and test it in practice by going together through an example of intersecting lines in 3D. Never again will you have to wonder how do you find the intersection of two lines, promise!
What is the intersection of two lines?
We say that two lines in 2D or 3D space are intersecting if they cross each other. The intersecting lines can cross at one point only โ this point is called the point of intersection. If two lines have more than one point in common, then these lines coincide (i.e., are the same). It's also possible that two lines do not intersect at all.
๐ In 2D space, if two lines do not have a common point, then these lines are parallel. In 3D space, however, two non-parallel lines can have no point in common! To learn more, visit our parallel line calculator or its twin brother, the perpendicular line calculator.
Point of intersection of two lines โ formula
Let us now discuss the formulas for the point of intersection of two lines in a plane.
Assume the lines are given in the slope-intercept form equations, i.e.:
y=a1โx+b1โy=a2โx+b2โ
Then the point of intersection, (x0โ,y0โ), is given by the formula:
x0โ=a1โโa2โb2โโb1โโy0โ=a1โa1โโa2โb2โโb1โโ+b1โ
If, instead, the lines are given by the standard form equations as:
A1โx+B1โy+C1โ=0A2โx+B2โy+C2โ=0
then you can find the point of intersection (x0โ,y0โ) using these formulae:
x0โ=A1โB2โโA2โB1โB1โC2โโB2โC1โโy0โ=A1โB2โโA2โB1โC1โA2โโC2โA1โโ
Derivation
To better understand where these formulas come from, let us derive the first of them. Take the two slope-intercept forms and note that their y-values are equal at the point of intersection. This leads to the following:
a1โx0โ+b1โ=a2โx0โ+b2โ
which simplifies to:
(a1โโa2โ)x0โ=b2โโb1โ
We can now easily solve for x0โ, the x-value at which the intersection occurs:
x0โ=a1โโa2โb2โโb1โโ
Once we have x0โ, we plug it into the first equation to get the corresponding y0โ:
y0โโ=a1โx0โ+b1โ=a1โ(a1โโa2โb2โโb1โโ)+b1โโ
That's it! As you can see, these formulas are not very short and simple, even if they are easy to derive. Fortunately, you can always use our intersection of two lines calculator!
In the next section, we'll discuss how to find the intersection of two lines in 3D space.
Intersection of two lines in 3D with example
Assume we have the parametric equations for two lines in 3D space. For the first line, we have:
x=x1โt+a1โy=y1โt+b1โz=z1โt+c1โ
and for the second, we have:
x=x2โs+a2โy=y2โs+b2โz=z2โs+c2โ
The parameters are s,tโR (i.e., they can be any real value) and thus both represent all possible points on their respective lines.
๐ If you have two points on the line (q1โ,q2โ,q3โ) and (r1โ,r2โ,r3โ), the parametric equations of the line passing through them is:
x=(q1โโr1โ)t+r1โ
y=(q2โโr2โ)t+r2โ
z=(q3โโr3โ)t+r3โ
To learn more, check out our line equation from two points calculator.
If these two lines have an intersection point, then the parameters t and s have some values (which we'll specify as t0โ and s0โ) that deliver the same point (x0โ,y0โ,z0โ). In other words, the system of equations:
x1โt0โ+a1โy1โt0โ+b1โz1โt0โ+c1โโ=x2โs0โ+a2โ=y2โs0โ+b2โ=z2โs0โ+c2โโ
which we may rewrite as:
x1โt0โโx2โs0โy1โt0โโy2โs0โz1โt0โโz2โs0โโ=a2โโa1โ=b2โโb1โ=c2โโc1โโ
has the solution (t0โ,s0โ). If there is no solution, our lines do not intersect.
Assume the solution (t0โ,s0โ) exists. Be careful โ this is not the intersection point yet! To find the intersection point, we must substitute t0โ into the parametric equations for the first line or s0โ into the equations for the second line.
It sounds complicated, but it's not! The best way to understand how this method works is to see it in action. Let us go through an example together.
Example
Let's find the intersection point of the following two lines:
First line:
x=6+6ty=8+7tz=2+4t
Second line:
x=6+6sy=8+7sz=4
We write down the system:
6+6t=6+6s8+7t=8+7s2+4t=4
and simplify it to:
6tโ6s=07tโ7s=04t=2.
Let's solve it. We'll do it by hand, but you can also use Omni's system of equations calculator.
From the first equation, we get s=t, while from the third one, we have t=21โ. Hence, s=21โ as well. Therefore, (t0โ,s0โ)=(21โ,21โ)
Let's plug in t0โ=21โ into the equations for the first line:
x=6+6โ 21โ=9y=8+7โ 21โ=11.5z=2+4โ 21โ=4
Therefore, our lines intersect at the 3D point (9,11.5,4). Don't hesitate to test this example in our intersection of two lines calculator!
How to use this intersection of two lines calculator
This is how you can use our tool to get your results quickly and easily:
Tell us the dimension of your problem: is it 2D or 3D?
Enter the equations of your lines. In the case of 2D problems, you can choose between the slope-intercept form and the general form. For 3D problems, enter the parametric form.
The results appear immediately. Omni's intersection of two lines calculator will display the coordinates of the intersection point, or it will warn you that the lines do not intersect.
If the latter happens, check carefully if you've entered the correct equations.
FAQ
How do I know if two lines in 2D intersect?
To determine if two lines in a plane intersect, check their slopes. If the slopes are different, then the lines intersect at a single unique point. If the slopes are equal, then compute the intercepts:
- If the intercepts are different, the lines are parallel and have no point in common.
- If the intercepts are equal, the lines coincide and have all points in common.
Do non-parallel lines always intersect in 3D?
No, two non-parallel lines in 3D space generally do not intersect. Such lines are called skew lines, and they do not lie in the same plane. In fact, two lines in 3D space can be:
- Intersecting at exactly one point;
- Parallel to each other (but not identical);
- Identical (and therefore also parallel); or
- Skew (neither parallel nor intersecting).
What is the intersection of lines y=x+3 and y=2x+1?
The answer is (2, 5). To arrive at this result, we solve the equation x + 3 = 2x + 1, which gives x = 2. Then we plug in x = 2 into y = x + 3 to get y = 5. So the point of intersection has the coordinates (x, y) = (2, 5), as claimed.