[Math] Given 4 corner points of a rectangle in 3d space, how to find its “plane” equation

3dgeometry

Context:

A BoundingPolytope defines a polyhedral bounding region using the intersection of four or more half spaces. The region defined by a BoundingPolytope is always convex and must be closed.
Each plane in the BoundingPolytope specifies a half-space defined by the equation:

Ax + By + Cz + D <= 0

source: from a javadoc, this is for programming purpose


I need the value of A, B, C, and D for a plane as in that equation and all I have is corner points of a rectangle that lies in that plane.

Best Answer

You only need $3$ of these corner points. Let these corner points be denoted $\vec{v_1}$, $\vec{v_2}$, and $\vec{v_3}$, treated as vectors from the origin to the point.

Then, the equation of your plane is: $$\left((x, y, z)-\vec{v_1}\right) \cdot \left[(\vec{v_3}-\vec{v_1})\times(\vec{v_2}-\vec{v_1})\right] = 0$$

Where $\times$ is the cross product, $\cdot$ is the dot product, and $(x, y, z)$ are the free variables describing the plane.