# Metrics for lines in $\mathbb{R}^3$?

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: 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 Sawin'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 and the origin: The right lines could be further apart than the left lines (depending on $a$ and $b$).

• 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$. Jul 20, 2013 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). Jul 24, 2013 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. Aug 8, 2013 at 21:00

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: 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$.

• This is a clear demonstration, Vidit—Thanks! Jul 20, 2013 at 21:10

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.

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.

• Thank you very much, Robert! Your 2nd suggestion is especially attractive to me. Jul 20, 2013 at 15:29
• +1 for the corrected answer. Jul 21, 2013 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. Jul 21, 2013 at 7:44
• Thanks, Robert. Your magnanimous explanation sheds further light on the issue. Much appreciated! Jul 21, 2013 at 17:12

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.

• 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? Jul 24, 2013 at 2:29
• Since the Grassmanian is correct, any induced metric from it will be finite volume, while the Haar measure is infinite volume. Jul 24, 2013 at 2:37
• Good point! IMO that was a natural condition for a metric to be the most natural one :-) Jul 24, 2013 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. Jul 24, 2013 at 3:06

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.

• 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. Jul 24, 2013 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. Jul 24, 2013 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. Jul 24, 2013 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. Jul 24, 2013 at 11:51