simplex-circumsphere
implements the computation of the n-simplex
circumsphere.
A writeup may be found on my website [6].
center-radius vertices => center radius
Compute the center coordinates and radius of the simplex circumsphere given its vertices.
vertices
: Array of vertices coordinates, eg#(#(1 1) #(5 1) #(1 4))
center
: Array of coordinates, eg#(3 5/2)
radius
: Radius of the circumsphere, eg2.5
Will return nil if the simplex is degenerate.
simplex-circumsphere
:simplex-circumsphere/test
:
Launch tests with:
(asdf:test-system "simplex-circumsphere")
I used the nice Geogebra sample by Steve Phelps to generate a test case for a tetrahedron [1].
There is an alternative method for the simplex circumsphere highlighted by Westendorp [3] from a work by Coxeter [5]. It involves the inverse of the matrix used in the Cayley-Menger determinant (which is the volume of a simplex [4]). I believe the method I implemented is more efficient than this alternative method if we start from a set of vertices coordinates (please refer to the writeup [6]).
- Simplex circumsphere in Geogebra by Steve Phelps
- Gautam Manohar: Inspheres and Circumspheres of Simplices
- G. Westendorp: A formula for the N-circumsphere of an N-simplex
- Wikipedia: Cayley-Menger determinant
- H. S. M. Coxeter, “The Circumradius of the General Simplex,” The Mathematical Gazette 15(210), 229–231 (1930). DOI
- n-Simplex circumsphere writeup