Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given a line L in three-dimensional Cartesian space and a point P that is not in line L.

Assume that we trace a path from the point to the line by three axis-parallel segments, one segment along each dimension.

What is the point Q in line L so that the sum of segment lengths is minimal?

share|cite|improve this question
up vote 1 down vote accepted

Let the axes be X, Y and Z, and consider the 3 planes through P parallel respectively to the X and Y, X and Z, and Y and Z axes.

Let P(XY) be the point, if any, where L meets the XY plane, and S(XY) be the sum of the lengths of the two segments joining P and P(XY) in the X and Y dimensions. Define P(XZ), P(YZ), S(XZ) and S(YX) similarly. If L does not meet any one of the planes (ie it is parallel to the plane), ignore that plane.

Now let A and B be the axes such that S(AB) is the least of S(XY), S(XZ) and S(YZ). The corresponding point P(AB) is then the point Q in L that minimises the sum of the segment lengths from P.

To see that the sum of the segment lengths from P to any other point on L will be larger, note that, since L is linear, any such sum will be a positive linear combination of S(XY), S(XZ) and S(YZ), and therefore larger than the smallest of the three.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.