# Homework Help: Vectors: Distance between 3D object and line

1. Jan 30, 2010

### MarcMTL

1. The problem statement, all variables and given/known data
a) Find the shortest distance between the surface A: (x+2)^2+(y-3)^2+(z-5)^2=9 and the line that passes by the points P0:(9,8,10) and P1:(16,6,14).

b)Find the coordinates of a point on the line and a point on the surface that are nearest to each other.

2. Relevant equations
Surface is a sphere, centered around PC:(-2, 3, 5).

Distance Line-Point = $$\frac {||P0P1 x P0PC||}{||POP1||}$$

3. The attempt at a solution
I found the distance between the line and the center of the sphere, then substracted by the radius (3) of the sphere, to find a distance of approx. 7.355 units.

However, how can I now find the Vector that defines the line of the shortest distance between the sphere and the line? Once I have the equation of that line, I can solve for b) by finding the intersects.

I know I'm looking for a perpendicular line to the one that is defined by POP1, so that the scalar product must equal 0, however in 3D, there is an infinite answer of perpendicular lines.

Thanks.

2. Jan 31, 2010

### HallsofIvy

You are looking for a line that is perpendicular to both given line and given sphere. Of course, any line perpendicular to a sphere lies along a diameter and passes through the center of the sphere.

The line through P0:(9,8,10) and P1:(16,6,14) has "direction vector" <16- 9, 6- 8, 14- 10>= <7, -2, 4> and so has perpendicular plane $7(x- x_0)- 2(y- y_0)+ 4(z- z_0)= 0$ where $(x_0, y_0, z_0)$ is any point in that plane. The plane we want must contain the center of the circle, (-2, 3, 5) and so is $7(x+ 2)- 2(y- 3)+ 4(z- 5)= 0$.

Find the point where the given line crosses that plane and you will have the point where the perpendicular line touches the given line. Once you have that, find where the line through that point and (-2, 3, 5) crosses the sphere. The distance between those two points is the distance from sphere to line.