Intersection of Two Lines Calculator (2024)

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=a1x+b1y=a2x+b2 \smally = a_1x+b_1\\y = a_2x+b_2y=a1​x+b1​y=a2​x+b2​

Then the point of intersection, (x0,y0)(x_0, y_0)(x0​,y0​), is given by the formula:

x0=b2βˆ’b1a1βˆ’a2y0=a1b2βˆ’b1a1βˆ’a2+b1 \smallx_0 = \frac{ b_2-b_1}{a_1-a_2} \\[0.75em]y_0 = a_1 \frac{ b_2-b_1}{a_1-a_2} +b_1x0​=a1β€‹βˆ’a2​b2β€‹βˆ’b1​​y0​=a1​a1β€‹βˆ’a2​b2β€‹βˆ’b1​​+b1​

If, instead, the lines are given by the standard form equations as:

A1x+B1y+C1=0A2x+B2y+C2=0 \smallA_1x+B_1y+C_1 = 0\\A_2x+B_2y+C_2 = 0A1​x+B1​y+C1​=0A2​x+B2​y+C2​=0

then you can find the point of intersection (x0,y0)(x_0, y_0)(x0​,y0​) using these formulae:

x0=B1C2βˆ’B2C1A1B2βˆ’A2B1y0=C1A2βˆ’C2A1A1B2βˆ’A2B1\smallx_0 = \frac{B_1C_2-B_2C_1}{A_1B_2-A_2B_1} \\[1em]y_0 = \frac{C_1A_2-C_2A_1}{A_1B_2-A_2B_1}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 yyy-values are equal at the point of intersection. This leads to the following:

a1x0+b1=a2x0+b2 \smalla_1x_0+b_1 = a_2x_0+b_2 a1​x0​+b1​=a2​x0​+b2​

which simplifies to:

(a1βˆ’a2)x0=b2βˆ’b1 \small(a_1-a_2)x_0 = b_2-b_1(a1β€‹βˆ’a2​)x0​=b2β€‹βˆ’b1​

We can now easily solve for x0x_0x0​, the xxx-value at which the intersection occurs:

x0=b2βˆ’b1a1βˆ’a2 \smallx_0 =\frac{ b_2-b_1}{a_1-a_2}x0​=a1β€‹βˆ’a2​b2β€‹βˆ’b1​​

Once we have x0x_0x0​, we plug it into the first equation to get the corresponding y0y_0y0​:

y0=a1x0+b1=a1(b2βˆ’b1a1βˆ’a2)+b1 \small\begin{align*}y_0 & = a_1x_0+b_1 \\[0.75em]& = a_1 \left(\frac{ b_2-b_1}{a_1-a_2}\right) +b_1\end{align*}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=x1t+a1y=y1t+b1z=z1t+c1\smallx=x_1t+a_1\\y=y_1t+b_1\\z=z_1t+c_1x=x1​t+a1​y=y1​t+b1​z=z1​t+c1​

and for the second, we have:

x=x2s+a2y=y2s+b2z=z2s+c2\smallx=x_2s+a_2\\y=y_2s+b_2\\z=z_2s+c_2x=x2​s+a2​y=y2​s+b2​z=z2​s+c2​

The parameters are s,t∈Rs, t \in \mathbb Rs,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)(q_1,q_2,q_3)(q1​,q2​,q3​) and (r1,r2,r3)(r_1,r_2,r_3)(r1​,r2​,r3​), the parametric equations of the line passing through them is:
x=(q1βˆ’r1)t+r1x = (q_1-r_1)t + r_1x=(q1β€‹βˆ’r1​)t+r1​
y=(q2βˆ’r2)t+r2y = (q_2-r_2)t + r_2y=(q2β€‹βˆ’r2​)t+r2​
z=(q3βˆ’r3)t+r3z = (q_3-r_3)t + r_3z=(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 ttt and sss have some values (which we'll specify as t0t_0t0​ and s0s_0s0​) that deliver the same point (x0,y0,z0)(x_0, y_0, z_0)(x0​,y0​,z0​). In other words, the system of equations:

x1t0+a1=x2s0+a2y1t0+b1=y2s0+b2z1t0+c1=z2s0+c2\small\begin{aligned} x_1t_0+a_1 &=x_2s_0+a_2\\ y_1t_0+ b_1&=y_2s_0+b_2\\ z_1t_0 +c_1 &=z_2s_0+c_2\end{aligned}x1​t0​+a1​y1​t0​+b1​z1​t0​+c1​​=x2​s0​+a2​=y2​s0​+b2​=z2​s0​+c2​​

which we may rewrite as:

x1t0βˆ’x2s0=a2βˆ’a1y1t0βˆ’y2s0=b2βˆ’b1z1t0βˆ’z2s0=c2βˆ’c1\small\begin{aligned}x_1t_0-x_2s_0 &= a_2-a_1\\y_1t_0-y_2s_0 &= b_2-b_1\\z_1t_0 - z_2s_0 &=c_2- c_1\end{aligned}x1​t0β€‹βˆ’x2​s0​y1​t0β€‹βˆ’y2​s0​z1​t0β€‹βˆ’z2​s0​​=a2β€‹βˆ’a1​=b2β€‹βˆ’b1​=c2β€‹βˆ’c1​​

has the solution (t0,s0)(t_0, s_0)(t0​,s0​). If there is no solution, our lines do not intersect.

Assume the solution (t0,s0)(t_0, s_0)(t0​,s0​) exists. Be careful β€” this is not the intersection point yet! To find the intersection point, we must substitute t0t_0t0​ into the parametric equations for the first line or s0s_0s0​ 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\smallx=6+6t\\y=8+7t\\z=2+4tx=6+6ty=8+7tz=2+4t

Second line:

x=6+6sy=8+7sz=4\smallx=6+6s\\y=8+7s\\z=4x=6+6sy=8+7sz=4

We write down the system:

6+6t=6+6s8+7t=8+7s2+4t=4\small 6+6t =6+6s\\ 8+7t =8+7s\\ 2+4t =46+6t=6+6s8+7t=8+7s2+4t=4

and simplify it to:

6tβˆ’6s=07tβˆ’7s=04t=2.\small6t - 6s = 0\\7t - 7s = 0\\4t = 2.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=ts = ts=t, while from the third one, we have t=12t = \frac 12t=21​. Hence, s=12s = \frac 12s=21​ as well. Therefore, (t0,s0)=(12,12)(t_0,s_0) = (\frac 12,\frac 12)(t0​,s0​)=(21​,21​)

Let's plug in t0=12t_0 = \frac 12t0​=21​ into the equations for the first line:

x=6+6β‹…12=9y=8+7β‹…12=11.5z=2+4β‹…12=4\smallx=6+6 \cdot \tfrac 12 = 9\\[.5em]y=8+7 \cdot \tfrac 12 = 11.5\\[.5em]z=2+4 \cdot \tfrac 12 = 4x=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)(9, 11.5, 4)(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:

  1. Tell us the dimension of your problem: is it 2D or 3D?

  2. 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.

  3. 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.

  4. 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.

Intersection of Two Lines Calculator (2024)

References

Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 6377

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.