# Equation of a plane passing through 3 points

It should be simple, but I'm having trouble.

The three points are $$A(1,-2,1)\qquad B(4,-2,-2)\qquad C(4,1,4)$$ The plane I get is $$x+2y+z+6=0$$ but it obviously does not pass through the three points $A,B,C$.

• When you find the normal via $$\vec n=(\vec B-\vec A)\times(\vec C-\vec A)$$ check that $$\vec n\cdot(\vec B-\vec A)=\vec n\cdot(\vec C-\vec A)=0$$. Commented Mar 11, 2018 at 16:35
• If you expect someone to show you where you went wrong instead of simply handing you a solution, you should show your work.
– amd
Commented Mar 11, 2018 at 23:58
• @amd, 'showing your work' would just litter the webpage space. This is not a site for students and teachers, it doesn't matter whether the author can solve it or not! It matters whether the question can be useful to others. Commented Aug 7, 2020 at 21:03

Here's one way to get the requisite plane:

1. Get two different vectors which are in the plane, such as $B-A=(3,0,-3)$ and $C-A=(3,3,3)$.
2. Compute the cross product of the two obtained vectors: $(B-A)×(C-A)=(9,-18,9)$. This is the normal vector of the plane, so we can divide it by 9 and get $(1,-2,1)$.
3. The equation of the plane is thus $x-2y+z+k=0$. To get $k$, substitute any point and solve; we get $k=-6$.

The final equation of the plane is $x-2y+z-6=0$.

• Just a query, why divide by 9? Or is it just to make calculations easier? Commented Jan 26, 2022 at 19:40
• @SreenikethanI That's a normal vector; only direction matters and I prefer having small numbers in there. Commented Jan 27, 2022 at 3:46

You’re looking for an equation of the form $$ax+by+cz+d=0$$. Plugging the coordinates of the known points into this generic equation gives you the following system of linear equations: \begin{align} a-2b+c+d&=0 \\ 4a-2b-2c+d&=0 \\ 4a+b+4c+d&=0.\end{align} Solve this system for the unknown coefficients $$a$$, $$b$$, $$c$$ and $$d$$. The solution won’t be unique, but if all goes well (you haven’t made a mistake and the points aren’t colinear) the solution space will be one-dimensional. That’s to be expected since you can multiply the equation of a plane by any nonzero constant to get another equation for the same plane.

The above system can be written as the matrix equation $$\begin{bmatrix}1&-2&1&1\\4&-2&-2&1\\4&1&4&1\end{bmatrix} \begin{bmatrix}a\\b\\c\\d\end{bmatrix} = 0$$ from which it’s evident that the coefficients of the equation of the plane are the components of any nonzero element of the null space of the matrix on the left. The first three columns are just the $$x$$-, $$y$$- and $$z$$-coordinates of the three points, therefore one can find the equation of the plane through three noncolinear points by computing the null space of $$\begin{bmatrix}x_1&y_1&z_1&1\\x_2&y_2&z_2&1\\x_3&y_3&z_3&1\end{bmatrix}.$$ In fact, it’s possible to do better and write down an equation of the plane directly. Every other point $$(x,y,z)$$ on the plane also generates a linear equation in the coefficients of the plane equation. In order to add it to the above system without reducing the dimension of the solution set, it must be dependent on the other equations, i.e., it must be a linear combination of the other three. This means that for any point $$(x,y,z)$$ on the plane, the rows of $$A = \begin{bmatrix}x&y&z&1\\x_1&y_1&z_1&1\\x_2&y_2&z_2&1\\x_3&y_3&z_3&1\end{bmatrix}$$ must be linearly dependent, but that means that $$\det A=0$$ is an equation of the plane. Applying this idea to the three points in your problem produces the equation $$9x-18y+9z-54=0$$, which becomes $$x-2y+z-6=0$$ after eliminating the common factor of $$9$$. This method is applicable to a wide variety of curves and surfaces.

• Really clear explanation. To sum up: make the coefficients be the unknowns of the linear equation system, substituting the known points into the system. Commented Dec 2, 2019 at 6:37
• Just saw an answer that like, directly jumped to the conclusion that det(A) = 0. Of course I know the rows must be linearly dependent since the XYZs are coplanar but I didn't get where those 1s came from. Your answer explained it using the equation representation of a plane which is perfect. Maybe there is an alternative possible explanation on this matrix from the perspective of cross product and duality. Commented Jun 26 at 19:51

I wish to expand @amd s answer more verbosly since it omits some logic. Also my answer can be more geometry-centric which is more intuitive.

First consider the equation we use to describe a plane:

$$ax + by + cz + d = 0$$

Why is it this way? let's first imagine a way to describe the point set of a plane: a plane must have a normal vector, and an “offset” to determine its exact position. What about the points on it? All the points are the same distance away from origin point $$(0,0)$$.

It turned out that $$N = (a, b, c)$$ is the normal while $$d$$ is a scalar used to describe the distance from the plane to origin point. Then we have (assume Normal is normalized): $$[a, b, c]\cdot[x,y,z] = d \implies Normal \cdot Point = distance$$ which means if you translate the plane in the direction of $$Normal$$ vector by $$distance$$, the plane will incident with origin point.

Now we have the coordinations of 3 points, we want a equation for all the points on that coplanar plane, which means for all $$p = (x,y,z), Normal \cdot p = distance$$.

Now let's look at the matrix $$M = \begin{bmatrix}x&y&z&1\\x_1&y_1&z_1&1\\x_2&y_2&z_2&1\\x_3&y_3&z_3&1\end{bmatrix}$$

This is, in fact, not a direct result, and the conclusion that $$det(A) = 0$$ is also not trivial. We can split the question into steps:

1. Whose (what matrix) determinant is zero?
2. How do we get it?

1. if the plane contains point origin, we can think of the coords of points on the plane directly as vectors, the matrix of those vectors will have a determinant of zero since they are 2D in a 3D world.
2. We can translate any plane (a.k.a. the points on it) so that it incident with origin point.

To do translations, everything must be written in homogeneous coordinate. The matrix to translate a plane is: $$T = \begin{bmatrix}1&0&0&a*d\\0&1&0&b*d\\0&0&1&c*d\\0&0&0&1\end{bmatrix}$$ and $$det(T) = 1$$ since it's triangular. When $$d=0$$, no translation is needed, in this case it just falls back to the identity matrix $$I$$.

Lets write the points in columns for later translations:

$$P = \begin{bmatrix}x&x_1&x_2&x_3\\y&y_1&y_2&y_3\\z&z_1&z_2&z_3\\1&1&1&1\end{bmatrix}$$

They are written in homogeneous coordinate also, with $$w = 1$$, because they are points.

We have $$TP=P'$$ where $$det(P')=0$$

$$P'$$ looks like this which is not good for us: $$P' = \begin{bmatrix}x+a&x_1+a&x_2+a&x_3+a\\y+b&y_1+b&y_2+b&y_3+b\\z+c&z_1+c&z_2+c&z_3+c\\1&1&1&1\end{bmatrix}$$

But we have $$det(AB) = det(A)det(B)$$, and $$det(T) = 1$$ which is non-zero, so we have $$det(P)= \begin{vmatrix}x&x_1&x_2&x_3\\y&y_1&y_2&y_3\\z&z_1&z_2&z_3\\1&1&1&1\end{vmatrix}=0$$.

Note $$P = M^{T}$$ and we have $$det(M)=det(M^{T})$$, thats why we can jump into thinking $$det(M) = 0$$.