Take the 2-minute tour ×
MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

I seek a metric $d(\cdot,\cdot)$ between pairs of (infinite) lines in $\mathbb{R}^3$. Let $s$ be the minimum distance between a pair of lines $L_1$ and $L_2$. Ideally I would like these properties:

  • If $L_1$ and $L_2$ are parallel, then $d(L_1,L_2) = s$.

  • $d(L_1,L_2)$ increases with the degree of skewness between the lines, i.e., the angle $\theta$ between their projections onto a plane orthogonal to a segment that realize $s$, where $\theta=0$ for parallel lines and $\theta=\pi/2$ for orthogonal lines.

A natural definition (suggested in an earlier MSE question) is $d(L_1,L_2) = s + |\theta|$. But this is not a metric. For example, a sufficiently large value of $a$ below ensures the triangle inequality will be violated:
     Line Triangle Ineq
I would be interested to learn of metrics defined on lines in space, and whether or not any such metric satisfies the properties above. Perhaps the properties cannot be achieved by any metric?

Update. Here is my current understanding of the rich variety of the erudite answers provided. Apologies in advance if my summary is inaccurate.

First, there is no such metric, interpreting my second condition as (naturally) demanding invariance under Euclidean motions, as convincingly demonstrated by Robert Bryant, Vidit Nanda, and Pierre Simon. Second, a looser interpretation requires only that if we fix $L_1$, then $d(L_1,L_2)$ is monotonic with respect to $\theta$ as $L_2$ is spun "about their intersection point in the plane that contains them [Yoav Kallus]." Then, Will Swain's metric satisfies this condition. Here is an example of why this metric fails the more stringent condition—it depends on the relationship between the lines the origin:
The right lines could be further apart than the left lines (depending on $a$ and $b$).

share|improve this question
Your example shows more generally that there is no such metric which is invariant under the group of Euclidean motions, since that would always give you $d(x,y)=d(y,z)$ and $d(x,z)\leq 2d(x,y)$ regardless of the value of $a$. –  Pierre Simon Jul 20 '13 at 15:30
You might want to edit your summary so that "spun about their projected intersection point", is understood to mean spun about their intersection point in the plane that contains them. Since otherwise this is false (a rotation of L2 in a different plane can result in θ increasing while d decreases). –  Yoav Kallus Jul 24 '13 at 23:20
Not quite what you asked but, interestingly, the space of oriented lines in $\mathbb{R}^3$ can be considered as a split-signature Kähler manifold. –  Paul Reynolds Aug 8 '13 at 21:00
add comment

4 Answers

up vote 18 down vote accepted

There is no hope of making any such metric continuous with respect to $\theta$ at $s=0$ without violating the triangle inequality even in the plane. Consider parallel lines $L_1$ and $L_2$ which are some huge distance $s$ apart and a third line $L_3$ which intersects both at a very tiny angle $\theta$. Here's a picture:

Three lines

In order to make $d(L_1,L_2) = s$ huge, you would have to make $d(L_1,L_3) + d(L_2,L_3)$ also huge, even for arbitrarily small $\theta$ values. Thus there is no way, when two lines intersect, to force their distance to shrink to $0$ continuously as the angle between them reduces to $0$.

share|improve this answer
This is a clear demonstration, Vidit—Thanks! –  Joseph O'Rourke Jul 20 '13 at 21:10
add comment

Unfortunately, my original answer below was completely misguided (i.e., wrong), and the people who up-voted it should feel free to reverse their votes! I'm leaving the answer below so that people can see what it was, but I'm prefacing it with a correction. I'm not deleting it because then maybe people won't be able to see it and know that my answer was wrong.

In fact, there is no metric on the space $\Lambda$ of of lines (or oriented lines) in $\mathbb{R}^3$ that is invariant under the group $G$ of Euclidean motions and that induces the standard toplogy on $\Lambda$!

This follows from the arguments that Nanda made below. The point is that, if there were a $G$-invariant metric that induced the standard topology, then, when $x$ and $y$ are two (oriented) lines meeting at an angle $\theta\in[0,\pi]$, then $d(x,y) = f(\theta)$, where $f(0)=0$ but $f(\theta)>0$ when $\theta>0$. However, now if $x$ and $z$ are any distinct (oriented) parallel lines in space, then for any $\epsilon>0$ there will exist an oriented line $y$ that meets both $x$ and $z$ at an angle of $\epsilon$, so $d(x,z)\leq 2f(\epsilon)$ for all $\epsilon>0$. This implies that $d(x,z)=0$ for any parallel oriented lines, so $d$ cannot be a metric of the desired type.

The mistake I made that led to the incorrect answer below what that I forgot that the subgroup $H$ of $G$ that stabilizes a given line is not compact, and so that there does not have to exist a $G$-invariant metric on $\Lambda=G/H$. And, indeed, as the argument above shows, there is no such metric. There is a $G$-invariant measure, but that's a much weaker statement.

I'm very sorry for the error and would be happy to give up all of the reputation points that people have awarded to me for it. I don't know how to do that, though, without deleting the answer, and I think that it might be useful to some people to see that the naïve expecation that there should be such a metric is not actually borne out.

Original Answer

The standard way of doing this is to regard the space $\Lambda$ of lines in (or oriented lines) $\mathbb{R}^3$ as a homogeneous space of the group $G$ of Euclidean motions. Then there is a natural $G$-invariant Riemannian metric on $\Lambda$, and you take the metric from that. I could calculate that explicitly if you are having trouble with it.

Another method is to note that the space of oriented lines is naturally equivalent to the tangent bundle of $S^2$, namely, given a line $l$, you let $u(l)\in S^2$ be the oriented direction of the line, and you let $v(l)\in u(l)^\perp$ be the point on $l$ that is closest to the origin. Then the mapping $l\to \bigl(u(l),v(l)\bigr)$ embeds the space of oriented lines in the space $S^2\times\mathbb{R}^3$ and you can take the induced metric, for example.

share|improve this answer
Thank you very much, Robert! Your 2nd suggestion is especially attractive to me. –  Joseph O'Rourke Jul 20 '13 at 15:29
+1 for the corrected answer. –  Theo Johnson-Freyd Jul 21 '13 at 4:51
Perhaps it is worthwhile to add that there is a natural "ultrahyperbolic" metric on the space of lines in $\mathbb{R}^3$ that comes up naturally in the geometry of line congruences and in integral geometry. –  alvarezpaiva Jul 21 '13 at 7:44
Thanks, Robert. Your magnanimous explanation sheds further light on the issue. Much appreciated! –  Joseph O'Rourke Jul 21 '13 at 17:12
add comment

This is probably obvious for everybody who contributed here, but I thought it bares saying explicitly. If you forego invariance with respect to isometries of $\mathbf{R}^3$, you can still have a metric that respects isometries that preserve the origin. For example, if you think of lines in $\mathbf{R}^3$ as a subset of lines in $\mathbf{RP}^3$, you can take the metric induced by some metric on the Grassmannian $G(4,2)$ of 2-planes through the origin in $\mathbf{R}^4$ (each 2-plane corresponds to the line where it intersects $\lbrace(x,y,z,1)\rbrace$). Sure, this metric will not satisfy any of your conditions, but there is an argument to be made that this is the most natural metric you can put on lines in $\mathbf{R}^3$, especially considering the arguments in the other answers here.

share|improve this answer
It'd be nice to have a metric whose volume form is the Haar measure under the Euclidean group. Do you know if this one works? –  Mariano Suárez-Alvarez Jul 24 '13 at 2:29
Since the Grassmanian is correct, any induced metric from it will be finite volume, while the Haar measure is infinite volume. –  Will Sawin Jul 24 '13 at 2:37
Good point! IMO that was a natural condition for a metric to be the most natural one :-) –  Mariano Suárez-Alvarez Jul 24 '13 at 2:43
@Mariano: I believe my example does satisfy your condition (if you differentiate it to make it a Riemannian metric). The unique Haar volume form is invariant to rotations around $0$, and is scaled by the scaling map at $0$. But there is a unique form with these properties that does not vanish on lines through $0$, since that group action is transitive on a dense subset, and the nonvanishing at $0$ handles the ambiguity of the scaling factor. But my metric's volume form is clearly invariant and scales, so it must be the same. –  Will Sawin Jul 24 '13 at 3:06
add comment

Such a metric does exist. Simply let $d(L_1,L_2)$ equal the angle between $L_1$ and $L_2$ plus the distance between $P_1$ and $Q_1$, where $P_1$ is the closest point in $L_1$ to $0$ and $Q_2$ is the closest point in $L_2$ to $0$.

This is a metric because it is a sum of two pseudometrics and the distance between distinct lines is $0$. We easily verify that the two bullet points are satisfied, because parallel lines have their closest point to $0$ in the plane which is perpendicular to the lines and passes through $0$.

It dodges Vidit's proof because it is not, as Robert notes, invariant under the group of Euclidean motions.

share|improve this answer
This also dodges the fact that the sum of the distances of the closest points on two parallel lines to the origin does not in general equal the distance between those two lines, thus failing the first requirement of the original question. –  Vidit Nanda Jul 24 '13 at 3:06
Can you show me a counterexample? It seems that the closest points on two parallel lines to the origin lie on the same plane, and so their distance is the same as the distance between the lines. –  Will Sawin Jul 24 '13 at 3:07
$(1,1,0) + t(0,0,1)$ and $(1,-1,0) + t(0,0,1)$ will do: the distance between them is $2$ but the sum of the distances to the origin is $2\sqrt{2}$: being on the same plane doesn't help when the closest points are not collinear. –  Vidit Nanda Jul 24 '13 at 3:09
It's not the sum of the distances of the origin, sorry for the confusion. It's the distance between the two (closest points to the origin) of the two different lines. –  Will Sawin Jul 24 '13 at 3:10
Very clever, Will! I see now that the discrepancy lies in my ambiguous second condition, "$d(L_1,L_2)$ increases with the degree of skewness between the lines." Your metric has the property that lines at, say, $\pi/2$ can be closer than lines at $\pi/4$, depending on how they sit w.r.t. the origin. But if you fix $L_1$ and rotate $L_2$, the distance is monotonic in $\theta$. So it satisfies the 2nd condition in one interpretation and fails in another. –  Joseph O'Rourke Jul 24 '13 at 11:51
add comment

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.