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

I know of a formula to determine shortest line segment between two given line segments, but that works only when endpoints are included. I'd like to know if there is a solution when endpoints are not included or if I'm mixing disciplines incorrectly.

Example : Line segment $A$ is from $(1, 1)$ to $(1, 4)$ and line segment $B$ is from $(0, 0)$ to $(0, 2)$, so shortest segment between them would be $(0, 1)$ to $(1, 1)$. But of line segment $A$ did not include those end points, how would that work since $(1, 1)$ is not part of line segment $A$?

share|cite|improve this question
I thank the quick comments from Millikan, Nicolas, and Smith. This is for a software library, and I'm finding the line segments without end points to be not working well. – MJ5 Jun 25 '12 at 20:55

There would not be a shortest line segment. Look at line segments from $(0,1)$ to points very close to $(1,1)$ on the segment that joins $(1,1)$ and $(1,4)$. These segments get shorter and shorter, approaching length $1$ but never reaching it.

share|cite|improve this answer

In your example, if the endpoints are not included in $A$ and $B$, then there is no shortest line segment connecting the two, since for any supposedly shortest path someone gives you, you can just slide the top end a teeny bit more downward in the direction of $(1,1)$.

In general, if the endpoints of the given line segments are not included, you can either still get a segment connecting the two that is as short as the one you would be able to get had the endpoints been included, or you can get arbitrarily close to that distance.

share|cite|improve this answer

In this case. there is no shortest segment. If you make the segment from $(0,1)$ to $(1,1+ \epsilon)$, a shorter one is from $(0,1)$ to $(1,1+ \epsilon /2)$

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.