[Math] Given a tetrahedron, how to find the outward surface normals for each side

3dcomputational geometrygeometrypolyhedra

Say I have a triangle in $3$D space. I can get the surface normal by calculating the vector cross product of two of the edges.

But, lets say I make this a tetrahedron. How can I work out the outward surface normal for each side?

Best Answer

For a given face $f,$ let its surface normal be $\vec{n}.$ The outward direction normal will be either $\vec{n}$ or $-\vec{n}.$ To determine which, let the $4$th vertex of the tertrahedron (the apex opposite to the $f$) be $v,$ and let one of the vertices of the face $f$ be $p.$

Thanks to Rahul Narain's hint: now, consider the $2$ vectors $\vec{n}$ and $\vec{pv} = v - p.$ If they're both on the same side (with respect to $f$), then $\vec{n} \cdot \vec{pv} $ is positive$^\dagger$ and $\vec{n}$ is facing inwards. If $\vec{n}$ is facing outward, then $\vec{n} \cdot \vec{pv} $ is negative. Based on the sign of $\vec{n} \cdot \vec{pv} $ you can know whether $\vec{n}$ or $-\vec{n}$ is the outward vector you're after.

$^\dagger$ recall the dot product $a\cdot b = \| a \| \| b \| \cos \theta_{ab}.$