Associated Topics || Dr. Math Home || Search Dr. Math

### 3D Geometry

```
Date: 11/17/97 at 10:10:54
From: Tim Fallon
Subject: 3d geometry

Given two lines in 3space, you can draw a line of minimum distance
between the two. This line will be perpendicular to both lines.
I know how to get the distance and direction of this line, but I want
to locate the line in 3space so that I can find its midpoint.

Thank you very much.
Tim Fallon
```

```
Date: 11/17/97 at 16:44:28
From: Doctor Anthony
Subject: Re: 3d geometry

The general method is perhaps best illustrated by working through an
example.

Find the shortest distance between the given lines, and the points of
closest approach on each line.

x     y-3     z                  x-5     y-8     z-2
--- =  ---  = ---   = s   and    ----- = ----- = ------ = t
1      1      -1                  3       7       -1

The common perpendicular is obtained from the vector product

| i   j    k |    = i(6) -j(2) + k(4)
| 1   1   -1 |
| 3   7   -1 |

So common perpendicular is the vector (3, -1, 2) which can be written
as a unit vector in the form  1/(sqrt(14)[3, -1, 2]

The vector connecting the given point on line (1) with the given point
on line (2) is  [(5-0), (8-3), (2-0)] = (5, 5, 2)

The scalar product of this with the common perpendicular in unit
vector form is

5 x 3 + 5 x (-1) + 2 x 2        14
-------------------------  =  -------   =  sqrt(14)
sqrt(14)              sqrt(14)

So the shortest distance is sqrt(14).

Now to find the points of closest approach, we have:

line (1) is  r = (0, 3, 0) + s(1, 1, -1)  =  [s, (3+s), -s]
line (2) is  r = (5, 8, 2) + t(3, 7, -1)  =  [(5+3t), (8+7t), (2-t)]

and we must find s and t.

Line joining a general point on line(1) to a general point on line(2)
is the vector

[(5+3t-s), (8+7t-3-s), (2-t+s)]

[(5+3t-s), (5+7t-s), (2-t+s)]

and if s and t are points of closest approach this must be parallel to
the vector (3, -1, 2)

5+3t-s     5+7t-s     2-t+s
so   ------  = -------- =  ------
3           -1        2

From these equations s = -1  and  t = -1

The points of closest approach are therefore

on line(1)  (-1, 2, 1)      and on line(2)   (2, 1, 3)

Check that shortest distance is sqrt(14)

shortest distance = sqrt((2+1)^2 + (1-2)^2 + (3-1)^2)

= sqrt(9 + 1 + 4)  =  sqrt(14)

If you require the mid-point of these points, you get

-1+2  2+1   1+3
----, ----, ----  =  [1/2, 3/2, 2]
2    2     2

-Doctor Anthony,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```
Associated Topics:
College Higher-Dimensional Geometry
College Linear Algebra
High School Higher-Dimensional Geometry
High School Linear Algebra

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search