1

This answer to an old question details a good method to find the equation of the line of intersection of two planes, but it's slightly unclear about the last part; finding a random point on the line, with which the line equation is to be found. The user seems to have substituted $y=0$ and solved for x and z, but while you could tell if each plane passes through y=0 (and they do), how can you tell if the actual line passes through y=0 without knowing the line equation? I could solve and find the symmetric line equation, but that totally defeats the purpose; moreover, this method seems to work otherwise fine, and looks much faster than actually solving the equations.

(I'm unsure about MSE policy on getting clarification on old questions through brand new posts, but the user who wrote the answer I'm asking about hasn't been online since 2014, and multiple people have commented asking about the same thing, so I guess it's okay.)

harry
  • 1,114
  • Perhaps it would be clearer if you just stated the problem and asked your question about it. – John Douma Apr 23 '21 at 03:45
  • 2
    Unless a line in three-dimensional space is parallel to any of the coordinate planes, it must intersect all three of them. So you are free to set any of the three coordinates equal to zero and will obtain a point on the line. –  Apr 23 '21 at 03:55
  • @boojum: that makes sense, but that's exactly the point; how would you know it isn't parallel? The specific case I was imagining was two planes intersecting in the first octant, giving a line parallel to the x-y plane. Without working out the line equation (which would presumably give z= some constant value), how would we know it's not parallel to a coordinate plane? – harry Apr 23 '21 at 04:03
  • 1
    If the line is parallel to a coordinate plane, its equation will be "missing" a coordinate variable. A line parallel to the $ \ xy-$ plane has a constant value for $ \ z \ $ . The cross-product from the two plane normal vectors would have a $ \ z-$ component of zero. The line of intersection would then have a parametrization with $ \ z \ = \ 0·t + z_0 \ \ . $ –  Apr 23 '21 at 04:14
  • Right, thinking about it in directional vector terms answers it. – harry Apr 23 '21 at 04:17
  • 1
    When we go from lines in $ \ \mathbb{R}^2 \ $ to those in $ \ \mathbb{R}^3 \ $ (or beyond), we have coefficients which can be "normalized" to produce "direction cosines", which give us information about the angle at which the line meets each coordinate plane. A line parallel to a coordinate plane "loses" one of those numbers. (We are sort of doing that in plane analytic geometric with $ \ Ax + By = C \ , $ but it is just easier to convert this to a line with a single "slope" to characterize the line, except for when $ \ B = 0 \ \ . $ ) –  Apr 23 '21 at 04:26
  • @boojum: oh, direction cosines can also be expressed as the angles between the line and the planes? I only knew of the definition with the angles between the line and the axes, thanks. – harry Apr 23 '21 at 04:41
  • @boojum: wait, isn't the angle between, say, the y-z plane and a vector the angle it makes with the x-axis? – harry Apr 23 '21 at 23:25
  • 1
    It would be the complement of that angle. The direction cosine comes from the dot product of a direction vector with a coordinate axis, so the complementary angle is that between the direction vector and the coordinate plane to which that axis is orthogonal. For the example in the above, a direction vector with a zero $ \ z-$ component is perpendicular to the $ \ z-$ axis, and so is parallel to the $ \ xy-$ plane. –  Apr 24 '21 at 03:02

1 Answers1

1

Let's see if this clarifies the situation.

Point $\vec{p}$ is on the plane with normal $\vec{n}_1$ and signed distance $d_1$ from origin, if and only if $$\vec{p} \cdot \vec{n}_1 - d_1 = 0 \tag{1}\label{G1}$$ In $\mathbb{R}^3$, vector cross product yields a vector that is perpendicular to both vector terms. That is, given $$\vec{\ell} = \vec{n}_1 \times \vec{n}_2 \tag{2}\label{G2}$$ vector $\vec{\ell}$ is perpendicular to both $\vec{n}_1$ and $\vec{n}_2$ (or a zero vector). So, if $\vec{n}_1$ and $\vec{n}_2$ represent the normals of two planes, then $\vec{\ell}$ is parallel to both planes (or a zero vector, if $\vec{n}_1 \parallel \vec{n}_2$), and is therefore parallel to the plane intersection line.

Therefore, we can describe the plane intersection line (when the two planes do intersect, i.e. are not parallel to each other) as points $\vec{p}$, $$\vec{p} = \vec{\ell}_0 + \lambda \vec{\ell} = \vec{\ell}_0 + \lambda \left( \vec{n}_1 \times \vec{n}_2 \right) \tag{3}\label{G3}$$ where $\lambda$ is the free parameter ($\lambda \in \mathbb{R}$), and $\vec{\ell}_0$ is a point on the line of intersection of two planes.

The direction cosines of this line are given by $$\hat{\ell} = \frac{\vec{\ell}}{\left\lVert\vec{\ell}\right\rVert} \tag{4}\label{G4}$$ but because its magnitude only changes the scale of $\lambda$, and $\lambda$ covers all real values, there is no particular need to normalize the direction vector; you can instead consider (the unnormalized) $\vec{\ell}$ as the direction coefficients: similar to direction cosines, but scaled by some arbitrary nonzero real (the magnitude of $\vec{\ell}$, i.e. $\lVert\vec{\ell}\rVert$).

Similarly, $\vec{\ell}_0$ may be anywhere on the line, as it only fixes the point where $\lambda = 0$; but it too can be freely chosen, without affecting the actual line at all.

To find a point on the intersection of two planes, with $\vec{\ell} = (\ell_x, \ell_y, \ell_z)$, we immediately know that:

  • If $\ell_x \ne 0$, the line will intersect $x = \chi$ (where $\chi$ is any real constant, $\chi \in \mathbb{R}$).

    If $\ell_x = 0$, the line has constant $x$.

  • If $\ell_y \ne 0$, the line will intersect $y = \gamma$ (where $\gamma$ is any real constant, $\gamma \in \mathbb{R}$).

    If $\ell_y = 0$, the line has constant $y$.

  • If $\ell_z \ne 0$, the line will intersect $z = \zeta$ (where $\zeta$ is any real constant, $\zeta \in \mathbb{R}$).

    If $\ell_z = 0$, the line has constant $z$.

When $\vec{\ell} = \vec{0}$ (i.e., $\ell_x = \ell_y = \ell_z = 0$), the two planes are parallel, and do not intersect. Therefore, at most two components of $\vec{\ell}$ can be zero, for the two planes to intersect (and the line to exist).

In other words, a nondegenerate line (one with $\vec{\ell} \ne \vec{0}$), will always have at least one nonzero component.


Let's see what an algorithm for calculating the intersection between planes $\vec{n}_1$, $d_1$ and $\vec{n}_2$, $d_2$ would look like. We initially only know $$\vec{n}_1 = \left[ \begin{matrix} x_1 \\ y_1 \\ z_1 \end{matrix} \right] ,\quad \vec{n}_2 = \left[ \begin{matrix} x_2 \\ y_2 \\ z_1 \end{matrix} \right]$$ and that $x_1, y_1, z_1, d_1 \in \mathbb{R}$, $x_2, y_2, z_2, d_2 \in \mathbb{R}$.

First we find the direction vector (using $\eqref{G2}$): $$\vec{\ell} = \left[\begin{matrix}\ell_x \\ \ell_y \\ \ell_z \end{matrix} \right] = \vec{n}_1 \times \vec{n}_2 = \left[ \begin{matrix} y_1 z_2 - z_1 y_2 \\ z_1 x_2 - x_1 z_2 \\ x_1 y_2 - y_1 x_2 \end{matrix} \right]$$

If $\ell_x = \ell_y = \ell_z = 0$, the two planes are parallel, and do not intersect.

Otherwise, if $\ell_x \ne 0$, we can find a point $\vec{\ell}_0 = \left[\begin{matrix} x_0 \\ y_0 \\ z_0 \end{matrix}\right]$ on the intersection line using $x_0 = 0$ in the two plane equations $\eqref{G1}$: $$\left\lbrace\begin{aligned} x_0 &= 0 \\ x_0 x_1 + y_0 y_1 + z_0 z_1 - d_1 &= 0 \\ x_0 x_2 + y_0 y_2 + z_0 z_2 - d_2 &= 0 \\ \end{aligned}\right.$$ which has exactly one solution; and similarly for the two other Cartesian coordinate axes:

  • If $\ell_x \ne 0$, then $\left\lbrace\begin{aligned} x_0 &= 0 \\ y_0 &= \displaystyle \frac{d_1 z_2 - d_2 z_1}{y_1 z_2 - y_2 z_1} \\ z_0 &= \displaystyle \frac{y_1 d_2 - d_1 y_2}{y_1 z_2 - y_2 z_1} \\ \end{aligned}\right.$

    Otherwise,

  • If $\ell_y \ne 0$, then $\left\lbrace\begin{aligned} x_0 &= \displaystyle \frac{d_1 z_2 - d_2 z_1}{x_1 z_2 - x_2 z_1} \\ y_0 &= 0 \\ z_0 &= \displaystyle \frac{x_1 d_2 - x_2 d_1}{x_1 z_2 - x_2 z_1} \\ \end{aligned}\right.$

    Otherwise,

  • $\ell_z \ne 0$, and $\left\lbrace\begin{aligned} x_0 &= \displaystyle \frac{d_1 y_2 - d_2 y_1}{x_1 y_2 - x_2 y_1} \\ y_0 &= \displaystyle \frac{x_1 d_2 - x_2 d_1}{x_1 y_2 - x_2 y_1} \\ z_0 &= 0 \\ \end{aligned}\right.$

Note that the three solutions above for $\vec{\ell}_0 = \left[\begin{matrix} x_0 \\ y_0 \\ z_0 \end{matrix}\right]$ are different points (unless the line intersects with origin, in which case all three yield the same solution, point at origin). This is perfectly acceptable, because it does not matter which point on the line you pick as $\vec{\ell}_0$. So, it is important that you only pick one of the three.

In a computer program, it makes sense to pick the coordinate axis with the largest magnitude component in $\vec{\ell}$; i.e, $x_0 = 0$ if $\lvert\ell_x\rvert\ge\lvert\ell_y\rvert$ and $\lvert\ell_x\rvert\ge\lvert\ell_z\rvert$; $y_0 = 0$ if $\lvert\ell_y\rvert\gt\lvert\ell_x\rvert$, $\lvert\ell_y\rvert\ge\lvert\ell_z\rvert$; and $z_0 = 0$ otherwise ($\lvert\ell_z\rvert\gt\lvert\ell_x\rvert$, $\lvert\ell_z\rvert\gt\lvert\ell_y\rvert$).

Glärbo
  • 241