Category

Intersection of Two Lines Calculator — Find the Point Where Two Lines Cross in 2D and 3D

Find the point of intersection of two lines from the slope-intercept form (y = ax + b) or the general form (Ax + By + C = 0), and even for lines in 3D space. Detects parallel, coincident, and skew lines, shows step-by-step formulas, the angle between the lines, and a diagram. Supports 20 world currencies, metric and US/Imperial units.

0 calculations

Calculation Parameters

Line 1: y = a₁x + b₁

Line 2: y = a₂x + b₂

Line 1: A₁x + B₁y + C₁ = 0

Line 2: A₂x + B₂y + C₂ = 0

A and B cannot both be zero — that would not describe a line.

Line 1: P₁ + t·V₁

Line 2: P₂ + s·V₂

In 3D, two lines that are not parallel may still never meet — such lines are called skew.

Enter Parameters

Fill in the form on the left and click "Calculate"

Intersection of Two Lines Calculator

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 two lines intersect. Our tool accepts both the slope-intercept and the general form of a line 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 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. 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., they are the same line). 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 still have no point in common — such lines are called skew lines.

Point of intersection of two lines — formula

Let us now discuss the formulas for the point of intersection of two lines in a plane.

Slope-intercept form

Assume the lines are given in the slope-intercept form equations, i.e.:

  • y = a₁x + b₁
  • y = a₂x + b₂

Then the point of intersection (x₀, y₀) is given by the formulas:

  • x₀ = (b₂ − b₁) / (a₁ − a₂)
  • y₀ = a₁x₀ + b₁ = (a₁b₂ − a₂b₁) / (a₁ − a₂)

Note that the denominator a₁ − a₂ must not be zero. If a₁ = a₂, the slopes are equal and the lines are parallel:

  • if b₁ = b₂, the lines coincide — every point is common;
  • if b₁ ≠ b₂, the lines are parallel and distinct — there is no intersection point.

General form

If the lines are given in the general form:

  • A₁x + B₁y + C₁ = 0
  • A₂x + B₂y + C₂ = 0

then we use Cramer's rule with the determinant W = A₁B₂ − A₂B₁:

  • x₀ = (B₁C₂ − B₂C₁) / W
  • y₀ = (C₁A₂ − C₂A₁) / W

If W = 0, the lines are parallel or coincident, and there is no single intersection point. The general form has one big advantage over the slope-intercept form: it can describe vertical lines (like x = 5), which have an undefined slope and therefore cannot be written as y = ax + b.

Intersection of two lines in 3D with example

In three dimensions, we describe each line in parametric form using a point on the line and a direction vector:

  • Line 1: P₁ + t·V₁, where P₁ = (x₁, y₁, z₁) and V₁ = (a₁, b₁, c₁)
  • Line 2: P₂ + s·V₂, where P₂ = (x₂, y₂, z₂) and V₂ = (a₂, b₂, c₂)

Two lines in 3D can be in one of four relationships. We determine which one using the cross product V₁ × V₂ and the scalar triple product:

  1. V₁ × V₂ = 0 — the directions are parallel. If P₂ also lies on line 1, the lines coincide; otherwise they are parallel and distinct.
  2. (P₂ − P₁) · (V₁ × V₂) ≠ 0 — the lines are skew: they are not parallel, yet they never meet because they don't lie in a common plane.
  3. (P₂ − P₁) · (V₁ × V₂) = 0 and V₁ × V₂ ≠ 0 — the lines are coplanar and non-parallel, so they intersect at exactly one point.

In the third case, we find the parameter t with:

t = [((P₂ − P₁) × V₂) · (V₁ × V₂)] / |V₁ × V₂|²

and then the intersection point is simply P = P₁ + t·V₁.

Example

Let's find the intersection of:

  • Line 1: (1, 2, 3) + t·(2, 1, −1)
  • Line 2: (5, 4, 1) + s·(1, −1, 1)

Step 1. Compute the cross product of the direction vectors:

V₁ × V₂ = (2, 1, −1) × (1, −1, 1) = (0, −3, −3)

It is not the zero vector, so the lines are not parallel.

Step 2. Check coplanarity. With P₂ − P₁ = (4, 2, −2):

(4, 2, −2) · (0, −3, −3) = 0 − 6 + 6 = 0

The scalar triple product is zero, so the lines are coplanar — they do intersect.

Step 3. Find the parameter and the point:

t = 2, which gives P = (1, 2, 3) + 2·(2, 1, −1) = (5, 4, 1)

Step 4. Verify with the second line: at s = 0, P₂ + 0·V₂ = (5, 4, 1) ✓. Both lines agree, so the intersection point is (5, 4, 1).

How to use this intersection of two lines calculator

  1. Pick the form of your line equations. Choose slope-intercept (2D) if your lines look like y = ax + b, general form (2D) if they look like Ax + By + C = 0 (this is the one to use for vertical lines), or 3D parametric for lines in space.
  2. Choose an optional unit. Your coordinates can be pure numbers, or you can attach a currency (US dollar, Russian ruble, euro, and 17 more), a metric unit (mm, cm, m, km, kg, L, …), or a US/Imperial unit (in, ft, yd, mi, lb, gal, …).
  3. Enter the coefficients of both lines.
  4. Read the result. The calculator tells you whether the lines intersect, are parallel, coincide, or are skew. When there is an intersection point, you get its coordinates, a step-by-step formula walk-through, the angle between the lines, and — in 2D — a diagram of both lines with the intersection marked.

Why would you use units here?

Straight lines are not only an abstract idea — they model real quantities. The classic example is break-even analysis: your total cost is a line (fixed cost plus variable cost per item), and your total revenue is another line (price per item). The point where these two lines intersect is the break-even point — the number of items you must sell before you start making a profit. That is why this calculator lets you label the axes with a currency or a physical unit.

Quick reference table

Case Condition Result
2D, slope-intercept a₁ ≠ a₂ x₀ = (b₂ − b₁)/(a₁ − a₂), y₀ = a₁x₀ + b₁
2D, general form W = A₁B₂ − A₂B₁ ≠ 0 x₀ = (B₁C₂ − B₂C₁)/W, y₀ = (C₁A₂ − C₂A₁)/W
2D, parallel a₁ = a₂, b₁ ≠ b₂ (or W = 0) No intersection point
2D, coincident a₁ = a₂ and b₁ = b₂ Infinitely many common points
3D, intersecting V₁ × V₂ ≠ 0 and (P₂ − P₁)·(V₁ × V₂) = 0 P = P₁ + t·V₁
3D, skew (P₂ − P₁)·(V₁ × V₂) ≠ 0 No intersection; distance = |(P₂−P₁)·(V₁×V₂)| / |V₁×V₂|

FAQs

How do I find the intersection of two lines?

Write both lines in the same form, then solve the two equations simultaneously. For y = a₁x + b₁ and y = a₂x + b₂, set the right-hand sides equal to each other: a₁x + b₁ = a₂x + b₂. Solving for x gives x₀ = (b₂ − b₁)/(a₁ − a₂). Substitute x₀ back into either equation to get y₀.

Can two lines intersect at more than one point?

No. Two distinct straight lines share at most one point. If they have two or more points in common, they must be the very same line — that is, they coincide.

What does it mean when the calculator says the lines are parallel?

It means the lines have the same direction but never touch. In slope-intercept form this happens when a₁ = a₂ but b₁ ≠ b₂. The calculator also reports the constant distance separating them.

What are skew lines?

Skew lines exist only in 3D (or higher). They are lines that are neither parallel nor intersecting — they point in different directions but pass by each other without ever touching, because no single plane contains both. Think of one road running east on the ground and another running north on an overpass above it. The calculator reports the shortest distance between them.

How do I find the intersection of a vertical line?

Use the general form mode. A vertical line such as x = 5 has an undefined slope and cannot be written as y = ax + b, but it is perfectly expressible in general form as 1·x + 0·y − 5 = 0.

What is the angle between two intersecting lines?

The calculator reports the acute angle θ between the lines, computed from their direction vectors u and v as cos θ = |u · v| / (|u| |v|). If the angle is 90°, the lines are perpendicular, and the calculator points that out.

Calculation History

Loading...