I'm sure we've all heard the classic vector algebra problem: "Find the shortest distance from the line y=mx+b to the point (x_{0}, y_{0})". I'm interested in a variation on this problem that I've been bashing my head against for a couple days now.

I'm not concerned with the shortest distance, but the point on the line where that shortest distance occurs. To make the problem worse, I'm dealing with three dimensions.

For example, I have a line defined by two points, let's say (0,1,2) and (6,2,7). I want to find the point on this line closest to the point (3,-7,-4).

I'm comfortable with vector math, including dot and cross products, normalizing, addition, all that. I'm just not sure what combination of operations will get me the point I'm looking for.