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$
On
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}$
On
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*}
On
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.
On
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.
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 . $$