2
$\begingroup$

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$?

  • 0
    It is not hard to implement it yourself. Use [Gauss' algorithm](http://en.wikipedia.org/wiki/Gaussian_elimination#Pseudocode) to bring it to row echelon form and then use [back-substitution](http://en.wikipedia.org/wiki/Triangular_matrix#Forward_and_back_substitution).2012-12-23

1 Answers 1

2

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).