Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a computer graphics library, and I'd like to compute the plane that passes through three arbitrary points, $p$, $q$ and $r$. I'm defining the plane in the form of $Ax + By + Cz + D = 0$.

My algebra is rather rusty, but I suspect this is a job for some simultaneous equations I'll need to solve a system of equations:

$$0 = \begin{cases} Ax_p + By_p + Cz_p + D \\ Ax_q + By_q + Cz_q+ D \\ Ax_r + By_r + Cz_r + D \end{cases}$$

How would I efficiently find the values of $A$, $B$, $C$ and $D$ with respect to $p$, $q$ and $r$?

share|cite|improve this question
The problem is called "solving a system of linear equations" and it is easy to find libraries which do this for you. Alternatively, you can implement this algorithm yourself. – Fabian Dec 23 '12 at 5:29
Cheers. I updated the question and am looking at you link. I'm using an obscure new language, hence me having to write the library myself. – bjz Dec 23 '12 at 5:36
It is not hard to implement it yourself. Use Gauss' algorithm to bring it to row echelon form and then use back-substitution. – Fabian Dec 23 '12 at 5:40

Consider the points $p$, $q$, $r$.

step 1 Construct the line from $p$ to $q$, i.e. $PQ=q-p$ and line from $p$ to $r$, i.e. $PR=r-p$

step 2 Find the cross product of lines $PQ=(x_1 , x_2 , x_3)$ and $PR=(y_1 , y_2 , y_3)$ \begin{align} n=\begin{vmatrix}i & j & k \\ x_1 & x_2 & x_3 \\ y_1 & y_2 & y_3\end{vmatrix} \end{align} This will be the normal line to the plane (perpendicular). $i,j,k$ are the co-ordinate axes. So if you get $n_1i+n_2j+n_3k$, then $(n_1,n_2,n_3)$ is the desired normal point.

step 3 Construct the normal equation of the plane \begin{align} n_1(x-a)+n_2(y-b)+n_3(x-c)=0 \end{align} where $(a,b,c)$ can be the co-ordinates of any of the points $p,q,r$(reference point).

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.