# Shortest Distance Between Two Lines in 3D Space | Class 12 Maths

Last Updated : 11 Mar, 2024

The shortest distance between two lines in three-dimensional space is the length of the perpendicular segment drawn from a point on one line to the other line. This distance can be found using vector calculus or analytical geometry techniques, such as finding the vector equation of each line and calculating the distance between them. The formula involves determining the dot product and cross product of vectors associated with the lines. This concept is essential in various fields like physics, engineering, and computer graphics for determining proximity and collision detection.

In 3D space, two lines can either intersect each other at some point, parallel to each other or they can neither be intersecting nor parallel to each other also known as skew lines.

• In the case of intersecting lines the shortest distance between them is 0.
• For parallel lines, the length of the line joining the two parallel lines or the length of the line perpendicular to both the parallel lines has the shortest distance.
• In the case of skew lines, the shortest distance is the line perpendicular to both of the given lines.

Note: The alphabets written in bold represent vector. ‘x’ denotes cross product (vector product).

## Shortest Distance Between Two Parallel Lines

Considering 2 lines in vector form as:

v1 = a1 + c Ã— b

v2 = a2 + d Ã— b

Here, c and d are the constants.

b = parallel vector to both the vectors v1 and v2

a1, a2  are the position vector of some point on v1 and v2 respectively

Shortest distance = |b Ã— (a2 – a1)| / |b|

### Examples

Example 1: For the following lines in 3D space.

v1 = i – 2j + (i – j + k)

v2 = i – 3j + k +(i – j + k)

Find the shortest distance between these lines?

Solution:

v1: i – 2j + (i – j + k)

v2: i – 3j + k + (i – j + k)

Here, b = i – j + k

a1 = i -2j

a2 = i – 3j + k

a2 – a1 = -j + k

|b| = âˆš3 = 1.73

|b Ã— (a2a1)| = âˆš2 = 1.41

Shortest distance = |b Ã— (a2a1)|/|b| = 1.41/1.73 = 0.815

Example 2: For the following lines in 3D space.

v1 = i – j – k + (2i – 3j + 4k)

v2 = 2i – 3j + k + 3(2i – 3j + 4k)

Find the shortest distance between these lines?

Solution:

The vector can be written in form as:

v1 = i – j – k + (2i – 3j + 4k)

v2 = 2i – 3j + k + 3(2i – 3j + 4k)

Here, b = 2i – 3j + 4k

|b| = âˆš(2)2 + (-3)2+ (4)2 = 5.385

a1 = ijk

a2 = 2i – 3j + k

a2 a1 = i – 2j + 2k

b Ã— (a2a1) = 2ik

|b Ã— (a2a1)| = âˆš(2)2 + (1)2 = 2.236

Now applying the shortest distance formula for parallel lines = |b Ã— (a2a1)|/|b| = 2.236/5.385 = 0.415

Example 3: Given two lines in the cartesian format as:

V1: (x – 2)/2 = (y – 1)/3 = (z)/4

V2: (x – 3)/4 = (y – 2)/6 = (z – 5)/8

Find the shortest distance between these lines.

Solution:

The displacement vector of V1 is 2i + 3j + 4k, for V2 is 4i + 6j + 8k

The displacement vector V2 is a multiple of V1 as,

4i + 6j + 8k = 2 (2i + 3j + 4k)

So the two given lines are parallel to each other.

a1 = 2i + j + 0k

a2 = 3i + 2j + 5k

a2 – a1 = i + j +5k

b = 2i + 3j + 4k

|b| = âˆš(2)2 + (3)2 + (4)2 = 5.385

b Ã— (a2 – a1) = 11i – 6j – k

|b Ã— (a2 – a1)| = 12.569

shortest distance = |b Ã— (a2 – a1)|/|b| = 12.569/5.385 = 2.334

## Shortest Distance Between Skew Lines

Considering 2 lines in vector form as:

v1 = a1 + c Ã— b1

v2 = a2 + d Ã— b2

Here, c and d are the constants.

The shortest distance 2 skew lines = |(b1 Ã— b2)(a2 – a1)|/|(b1 Ã— b2)|

Note: If two lines are intersecting then’s the shortest distance considering the two lines skew will automatically come out to be zero.

### Examples

Example 1: Given two lines in vector form as:

V1: i – j + 2i + j + k

V2: i + j + 3i – j – k

Find the shortest distance between these lines.

Solution:

The given lines are skew lines.

b1 = 2i + j + k

b2 = 3i – j – k

a1 = i – j

a2 = i + j

a2 – a1 = 2j

(b1 Ã— b2) = 5j – 5k

Shortest distance = |(b1 Ã— b2)(a2 – a1)|/|(b1 Ã— b2)| = 10/7.07 = 1.41

Example 2: Given two lines in vector form as:

v1: 2i – j + 5(3i – j + 2k)

v2: i – j + 2k + 2(i + 3j + 4k)

Find the shortest distance between these lines.

Solution:

The given lines are skew lines.

Shortest distance = |(b1 Ã— b2)(a2 – a1)|/|(b1 Ã— b2)|

b1 = 3i – j + 2k

b2 = i + 3j + 4k

a1 = 2i – j

a2 = i – j + 2k

a2 – a1 = -i + 2k

(b1 Ã— b2) = -10i – 10j + 10k

|b1 Ã— b2| = 17.320

|(b1 Ã— b2)(a2 a1)| = 40

Shortest distance = 40/17.320 = 2.309

Example 3: Given 2 lines in the cartesian form, find the shortest distance between them.

• V1: (x – 1)/2 = (y – 1)/3 = (z)/4
• V2: (x)/1 = (y – 2)/2 = (z – 1)/3

Solution:

a1 = i + j

a2 = -2j + k

b1 = 2i + 3j + 4k

b2 = i + 2j + 3k

a2 – a1 = -3i – j + k

(b1 Ã— b2) = i – 2j + k

|b1 Ã— b2| = 2.44

Shortest distance =|(i – 2j + k)( -3i – j + k)|/2.44 = 0

Since, shortest distance is zero it means these two lines are intersecting lines.

## FAQs on Shortest Distance Between Two Lines

### What is the Equation of Line in 3D?

A vector equation of a line in 3D space is given by r = a + tv.

### What is the shortest path between two lines?

The shortest distance between two lines in space can be found by determining the distance between the parallel planes that contain these lines.

### What is the shortest distance between a point and a line?

Shortest distance between point P with coordinates (x1â€‹, y1â€‹, z1â€‹), and line represented by a vector equation r=a+tv, is given by d = âˆ£(Pâˆ’a)â‹…nâˆ£â€‹/âˆ£vâˆ£.

Previous
Next