Distance Between Skew Lines Calculator

This distance between skew lines calculator finds the shortest distance between two lines in 3D from a point and a direction vector for each.

Checks on your data

  • The distance uses the scalar triple product of P₂ − P₁, d₁ and d₂, divided by the size of d₁ × d₂.
  • Lines are skew only when they are not parallel and do not intersect. Both conditions are tested.

Results

Distance between the lines
0.447214
Relationship
Skew (they never meet and are not parallel)
Common perpendicular direction d₁ × d₂
(-10, 0, 5)
Closest point on line 1
(2.68, 2.84, 6.36)
Closest point on line 2
(2.28, 2.84, 6.56)
|d₁ × d₂|
11.1803
(P₂ − P₁) · (d₁ × d₂)
5
Show step-by-step solution
  1. Line 1: P₁ = (1, 2, 3), d₁ = (2, 1, 4). Line 2: P₂ = (3, 5, 8), d₂ = (1, 3, 2).
  2. Normal to both lines: n = d₁ × d₂ = (-10, 0, 5), with length 11.1803.
  3. Vector between the points: P₂ − P₁ = (2, 3, 5).
  4. Distance = |(P₂ − P₁) · n| ÷ |n| = |5| ÷ 11.1803 = 0.447214.
  5. The closest points are (2.68, 2.84, 6.36) on line 1 and (2.28, 2.84, 6.56) on line 2. The segment between them is perpendicular to both lines.
Formula|(P₂−P₁)·(d₁×d₂)| / |d₁×d₂|
Skewnot parallel, never meet
Parallel|(P₂−P₁)×d₁| / |d₁|

What Is Distance Between Skew Lines?

Skew lines are lines in three dimensions that are not parallel and never meet. The distance between them is the length of the shortest segment joining them, which is perpendicular to both.

The formula takes the cross product of the two direction vectors, then projects the vector between the two points onto it: distance = |(P₂ − P₁) · (d₁ × d₂)| ÷ |d₁ × d₂|.

The calculator also tells you whether the lines are skew, parallel or intersecting, and gives the closest point on each line.

How to Use the Distance Between Skew Lines Calculator

  1. Enter a point on each line.
  2. Enter a direction vector for each line.
  3. Read the distance, the relationship and the closest points.

Distance Between Skew Lines Formula

Skew lines

d=∣(P2−P1)⋅(d1×d2)∣∣d1×d2∣d=\frac{|(\mathbf P_2-\mathbf P_1)\cdot(\mathbf d_1\times\mathbf d_2)|}{|\mathbf d_1\times\mathbf d_2|}

Distance Between Skew Lines Variables Explained

SymbolMeaningNotes
P₁, P₂A point on each line
d₁, d₂Direction vectors of the lines
d₁ × d₂Cross product, perpendicular to both lines
dShortest distanceTriple product over |d₁ × d₂|

Distance Between Skew Lines Worked Example

With the example values loaded in the calculator above, the steps are:

  1. Line 1: P₁ = (1, 2, 3), d₁ = (2, 1, 4). Line 2: P₂ = (3, 5, 8), d₂ = (1, 3, 2).
  2. Normal to both lines: n = d₁ × d₂ = (-10, 0, 5), with length 11.1803.
  3. Vector between the points: P₂ − P₁ = (2, 3, 5).
  4. Distance = |(P₂ − P₁) · n| ÷ |n| = |5| ÷ 11.1803 = 0.447214.
  5. The closest points are (2.68, 2.84, 6.36) on line 1 and (2.28, 2.84, 6.56) on line 2. The segment between them is perpendicular to both lines.

Result: Distance between the lines = 0.447214; Relationship = Skew (they never meet and are not parallel).

Worked example

Take line 1 through (1, 2, 3) with direction (2, 1, 4), and line 2 through (3, 5, 8) with direction (1, 3, 2). The cross product d₁ × d₂ = (−10, 0, 5), with length 11.1803.

The vector between the points is (2, 3, 5), and its dot product with the cross product is −20 + 0 + 25 = 5. The distance is 5 ÷ 11.1803 = 0.4472, so the lines are skew.

Telling the cases apart

If d₁ × d₂ is the zero vector, the lines are parallel. Otherwise, if the triple product is zero they intersect, and if it is not zero they are skew.

Where Distance Between Skew Lines Is Used

Vector geometry homework

Find the shortest distance between two lines in space.

3D modelling

Check clearance between two straight edges or pipes.

Classifying lines

Decide whether two lines are skew, parallel or intersecting.

Common Distance Between Skew Lines Mistakes to Avoid

  • Use any point on each line. The distance does not depend on the choice.
  • A direction vector can be scaled without changing the answer.

Distance Between Skew Lines Terms and Definitions

Skew lines
Lines in 3D that are neither parallel nor intersecting.
Cross product
A vector perpendicular to two given vectors.

Distance Between Skew Lines FAQs

What is the distance between skew lines?

The length of the shortest segment between them. It is |(P₂ − P₁) · (d₁ × d₂)| divided by |d₁ × d₂|.

How can I tell if lines are skew?

They are skew if they are not parallel and the triple product is not zero.

What if the lines are parallel?

Then use |(P₂ − P₁) × d₁| ÷ |d₁|. The calculator switches to this automatically.

Do skew lines exist in 2D?

No. In a plane, two lines are either parallel or they intersect.

Related calculators

Last updated 2026-11-09. See our disclaimer.