How to calculate the intersection of two planes ?
These are the planes and the result is gonna be a line in $\Bbb R^3$:
$x + 2y + z - 1 = 0$
$2x + 3y - 2z + 2 = 0$
How to calculate the intersection of two planes ?
These are the planes and the result is gonna be a line in $\Bbb R^3$:
$x + 2y + z - 1 = 0$
$2x + 3y - 2z + 2 = 0$
From the coefficients of x, y and z of the general form equations, the first plane has normal vector $\begin{pmatrix}1\\2\\1\end{pmatrix}$ and the second has normal vector $\begin{pmatrix}2\\3\\-2\end{pmatrix}$, so the line of intersection must be orthogonal to both of these. We know that the unique vector orthogonal to two linearly independent vectors $v_1,v_2$ is $v_1\times v_2$, so the direction vector of the line of intersection is $$\begin{pmatrix}1\\2\\1\end{pmatrix}\times \begin{pmatrix}2\\3\\-2\end{pmatrix}=\begin{pmatrix}-7\\4\\-1\end{pmatrix}$$Next, we need to find a particular point on the line. Here, since a line that isn't parallel to any coordinate plane passes through all three, you can check if it is parallel to one by using the directional vector. Since here, the line passes through all three planes, we can try $y=0$(since it passes through the $x-z$ plane) and solve the resulting system of linear equations:$$\begin{align}x+z-1&=&0\\2x-2z+2&=&0\end{align}$$ giving $x=0, z=1$, thus the line of intersection is $\lbrace{\begin{pmatrix}-7t\\4t\\1-t\end{pmatrix}:t\in \Bbb R\rbrace}$
In this question, we can find any point that will lie on the line intersecting the two planes, suppose $(a,b,0)$. Then we can simultaneously solve the the two planes equation by putting this point in it.
$$a+2b=1\qquad2a+3b=-3$$
After solving these two, we will get $a=-7$ and $b=4$. Now, we can find the direction of the line we need to find by taking cross product of normal vectors of two given planes.
$$(i,2j,k) × ( 2i,3j,-2k) = (-7i,4j,-k)$$
Thus equation of line is $-7(x+7)+4(y-4)-1(z-0)=0$.
Hence
$$7x-4y+z+65=0$$
Let $x$ be in the intersection of the planes \begin{equation*} \langle m, x-b \rangle = 0,\\ \langle n, x-c \rangle = 0 \end{equation*} and let $p = m \times n$.
Then for some $\lambda$, \begin{equation*} \begin{pmatrix} m_0 & m_1 & m_2 \\ n_0 & n_2 & n_3 \\ p_0 & p_1 & p_2 \\ \end{pmatrix} \begin{pmatrix} x_0 \\ x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} \langle m, b \rangle \\ \langle n, c \rangle \\ \lambda \end{pmatrix}. \end{equation*}
Using the vector identities \begin{equation*} \begin{split} u \times (v \times w) &= \langle u, w \rangle v - \langle u, v \rangle w, \\ \Vert u \times v \Vert^2 &= \Vert u \Vert^2 \Vert v \Vert^2 - \langle u, v \rangle^2, \end{split} \end{equation*} check that \begin{equation*} \begin{pmatrix} m_0 & m_1 & m_2 \\ n_0 & n_1 & n_2 \\ p_0 & p_1 & p_2 \\ \end{pmatrix} \begin{pmatrix} q_0 & r_0 & p_0 \\ q_1 & r_1 & p_1 \\ q_2 & r_2 & p_2 \\ \end{pmatrix} = \Vert p \Vert^2 I, \end{equation*} where \begin{equation*} \begin{split} q &= -n \times (n \times m), \\ r &= -m \times (m \times n). \end{split} \end{equation*}
If $p \ne 0$ (that is, if $m$ and $n$ are linearly independent), it follows that \begin{equation*} \begin{pmatrix} x_0 \\ x_1 \\ x_2 \end{pmatrix} = \frac{1}{\Vert p \Vert^2} \begin{pmatrix} q_0 & r_0 & p_0 \\ q_1 & r_1 & p_1 \\ q_2 & r_2 & p_2 \\ \end{pmatrix} \begin{pmatrix} \langle m, b \rangle \\ \langle n, c \rangle \\ \lambda \end{pmatrix}, \end{equation*} or \begin{equation*} x = a + \lambda \frac{p}{\Vert p \Vert^2} \end{equation*} where \begin{equation*} a = (\langle m, b \rangle q + \langle n, c \rangle r) / {\Vert p \Vert^2}. \end{equation*}
You have to solve the following system of equations: $$ x + 2y + z - 1 = 0 \\ 2x + 3y - 2z + 2 = 0. $$
Since these are two equations in three variables, so you don't have solution such as $(a,b,c)$ but you will have a parametric relation between variables. Let $x=t$, then we have
$$ t + 2y = 1-z \\ 2t + 3y = 2z-2. $$
Solving this system gives
$$ x=t,y=-\frac{4}{7}t,z= 1-\frac{1}{7}t$$
which is the parametrized equation of the required line.
I tried the systems of equations approach posted by multiple people, but dealing with division by zero made things really messy. So I came up with a more intuitive approach.
Start with the cross product of the normal vectors of the 2 planes (Normal1 and Normal2) to get a direction of the intersection line (Normal3):
Normal3 = Normal1 × Normal2
Now if we look at the existing planes from the perspective of that direction, our 2 planes look like 2 lines, because we're viewing them both edge-on. So we want to calculate what those 2 lines are. We can get the direction of each line as the cross product of our new plane's normal with the original normal:
line1dir = Normal1 × Normal3
line2dir = Normal2 × Normal3
So now we need the origin of each of these lines. That's just the normal times the offset:
line1start = Normal1 * Offset1
line2start = Normal2 * Offset2
That gives use two lines:
line1 = (line1start, line1start + line1dir)
line2 = (line2start, line2start + line2dir)
Now if we find the intersection of those two lines, it will give a point which occurs on both lines, which means it also occurs on both planes:
https://math.stackexchange.com/questions/270767/find-intersection-of-two-3d-lines/271366
Once you have the intersection point, combine it with the Normal3 we calculated at the beginning to get the intersection line.
While this problem has a great textbook answer, as @walcher explained, I don't think it's very elegant. This is because, the solution depends on picking an arbitrary point, which lacks geometric intuition. Ideally, we'd like this point to have some meaning, such as being close to the planes, or the line or etc.
For that, I'd like to remind you of a solution by John Krumm, which remains unnoticed by many. Let $\mathbf{p}=\{p_x,p_y,p_z\}$ and $\mathbf{n}=\{n_x,n_y,n_z\}$ compose the plane $\mathbf{P}=\{\mathbf{n},\mathbf{p}\}$. Let there be two planes $P_1$ and $P_2$, for which we'd like to compute the intersecting line $\mathbf{l}$. It's trivial to compute the direction as the cross-product: $$\mathbf{l}_d=\mathbf{n}_1 \times \mathbf{n}_2$$
If we additionally desire that the resulting point $\mathbf{p}$ is as close to the chosen point $\mathbf{p}_0$ as possible, we could write a distance : $$\lVert \mathbf{p}-\mathbf{p}_0 \rVert = (p_x-p_{0x})^2 + (p_y-p_{0y})^2 + (p_z-p_{0z})^2$$ Incorporating the other points in the similar fashion, and writing this constraint using Lagrange multipliers into an objective function results in: $$J=\lVert \mathbf{p}-\mathbf{p}_0 \rVert+\lambda(\mathbf{p}-\mathbf{p}_1)^2 + \mu(\mathbf{p}-\mathbf{p}_2)^2$$
Using the standard Lagrange framework (omitting the details), one establishes a nice matrix, in the form: $$ \mathbf{M}= \left[ {\begin{array}{ccc} 2 & 0 & 0 & n_{1x} & n_{2x}\\ 0 & 2 & 0 & n_{1y} & n_{2y}\\ 0 & 0 & 2 & n_{1z} & n_{2z} \\ n_{1x} & n_{1y} & n_{1z} & 0 & 0\\n_{2x} & n_{2y} & n_{2z} & 0 & 0 \end{array} } \right] $$ This matrix can now be used in a system of linear equations to solve for the unknown point, $\mathbf{p}$, as well as the Lagrange multipliers, $\{\lambda, \mu\}$.: $$ \mathbf{M}\left[ {\begin{array}{c} p_x \\ p_y \\ p_z \\ \lambda \\ \mu \end{array} } \right] = \left[ {\begin{array}{c} 2p_{0x} \\ 2p_{0y} \\ 2p_{0z} \\ \mathbf{p}_1 \cdot \mathbf{n}_1 \\ \mathbf{p}_2 \cdot \mathbf{n}_2 \end{array} } \right] $$ While the multipliers are not of particular interest they would be interesting for understanding configuration of points, or for different parameterizations.
I think this is a pretty neat approach giving a nice and simple method, with a geometrically interpretable results. I post the MATLAB code at my blog.
You need to solve the two equations $$ x + 2y + z - 1 = 0 \\ 2x + 3y - 2z + 2 = 0. $$
Notice that, these are two equations in three variables, so you have a free variable say $z=t$, then we have
$$ x + 2y = 1-t \\ 2x + 3y = 2t-2. $$
Solving the last system gives
$$ \left\{ x=-7+7\,t,y=4-4\,t \right\} .$$
Then the parametrized equation of the line is given by
$$ (x,y,z)= (-7+7t, 4-4t,t)=(-7,4,0)+(7,-4,1)t . $$