plane_coefficients - calculate the coefficient form for a plane |
#include <matvec.h> void plane_coefficients (const float *p, const float *q, const float *r, float *co); |
Given three points, not colinear, which naturally form a plane, calculate the 4-vector form for the plane coefficients. The three points are passed as p, q and r. The coefficients are returned in vector co. |
The four coefficients returned are respectively a, b, c and d in the standard plane equation: |
a x + b y + c z + d = 0 |
(Note that many texts use - d, so be warned). |
The normal (perpendicular) vector to the plane may be derived immediately: it is just (a, b, c). Note that the normal vector is not normalized! |
Planes are unbounded: they stretch off to infinity in all directions. If what you really want are bounded convex polygons, then you need to use a c2lib "face". |
Richard Jones <rich@annexia.org> |
GNU LGPL (see http://www.gnu.org/) |
c2lib-1.2.13 |