Tetrahedron Circumsphere
From CGAFaq
Let the tetrahedron vertices be ,
,
, and
. Let
denote the length of
, and let
denote the cross product of
and
. The radius
of the circumsphere is
The center of the circumsphere is
Some notes on stability:
- Note that the expression for
is purely a function of differences between coordinates. The advantage is that the relative error incurred in the computation of
is also a function of the differences between the vertices, and is not influenced by the absolute coordinates of the vertices. In most applications, vertices are usually nearer to each other than to the origin, so this property is advantageous.
- Similarly, the formula for
incurs roundoff error proportional to the differences between vertices, but not proportional to the absolute coordinates of the vertices until the final addition.
- These expressions are unstable in only one case: if the denominator is close to zero. This instability, which arises if the tetrahedron is nearly degenerate, is unavoidable. Depending on your application, you may want to use exact arithmetic to compute the value of the determinant. See http://www.geom.uiuc.edu/software/cglist/alg.html and http://www-2.cs.cmu.edu/~quake/robust.html.

