Skip to content
LoveToCalc

Theorem — what does that mean?

Distance from a point to a line in space

A line in space has no single equation, so the distance comes from a cross product: the area of a parallelogram divided by its base.

In Swedish: Avstånd från en punkt till en linje i rummet

Distance from a point to a line in space

The relation

D=|((x₁, y₁, z₁)−(x₀, y₀, z₀))×(a, b, c)||(a, b, c)|

The shortest distance from a point to a line in space: the length of the cross product of the vector from a point on the line to the point and the direction vector, divided by the length of the direction.

Solved for D

D=((y₁−y₀)c−(z₁−z₀)b)²+((z₁−z₀)a−(x₁−x₀)c)²+((x₁−x₀)b−(y₁−y₀)a)²a²+b²+c²

D≈2.2361

D equals the square root of (((((−2 minus (−2)) times 2) minus ((3 minus 3) times 1)) squared plus (((3 minus 3) times 2) minus ((4 minus 1) times 2)) squared) plus (((4 minus 1) times 1) minus (((−2) minus (−2)) times 2)) squared) divided by the square root of ((2 squared plus 1 squared) plus 2 squared), equals the square root of ((((0 times 2) minus (0 times 1)) squared plus ((0 times 2) minus (3 times 2)) squared) plus ((3 times 1) minus (0 times 2)) squared) divided by the square root of ((4 plus 1) plus 4), equals the square root of (((0 minus 0) squared plus (0 minus 6) squared) plus (3 minus 0) squared) divided by the square root of (5 plus 4), equals the square root of ((0 squared plus (−6) squared) plus 3 squared) divided by the square root of (9), equals the square root of ((0 plus 36) plus 9) divided by 3, equals the square root of (36 plus 9) divided by 3, equals the square root of (45) divided by 3, is approximately 6.7082 divided by 3, is approximately 2.2361

Working9 steps

Practice questions

You are given

  • r₁=(0, -3, 3)
  • r₀=(2, -3, -1)
  • v=(0, 3, 3)

Round to 2 decimals.

The formula

r₀ is a point on the line, v its direction (see the vector equation of a line) and r₁ the point. The parallelogram spanned by r₁ − r₀ and v has the area |(r₁ − r₀) × v|, its base is |v|, and the height is the distance.

With r₀ = (1, −2, 3), v = (2, 1, 2) and r₁ = (4, −2, 3): r₁ − r₀ = (3, 0, 0), the cross product with v is (0, −6, 3) with length √45, and |v| = 3. So D = √45 / 3 = √5 ≈ 2.24.

Checking with Pythagoras

The length along the line is the scalar projection of r₁ − r₀ onto v: 6/3 = 2. Then 2² + (√5)² = 9 = |r₁ − r₀|², as it should be.

In the plane

The plane version, distance from a point to a line, uses the line’s equation. In space a line is two planes, so the vector form is easier.

Common mistakes

Common questions

Which point on the line do I use? Any. A different one changes r₁ − r₀ by a multiple of v, and the cross product with v is unchanged.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
D((y₁−y₀)c−(z₁−z₀)b)²+((z₁−z₀)a−(x₁−x₀)c)²+((x₁−x₀)b−(y₁−y₀)a)²a²+b²+c²((−2−(−2))·2−(3−3)·1)²+((3−3)·2−(4−1)·2)²+((4−1)·1−(−2−(−2))·2)²2²+1²+2²2.2361

Last reviewed October 11, 2026 ·How pages are reviewed

GeometryAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.