Function Repository Resource:

# CayleyMengerMatrix

Evaluate the Cayley-Menger matrix of a simplex

Contributed by: Jan Mangaldan
 ResourceFunction["CayleyMengerMatrix"][{p1,…,pk}] gives the Cayley-Menger matrix of the simplex spanned by points pi. ResourceFunction["CayleyMengerMatrix"][reg] gives the Cayley-Menger matrix of the region reg.

## Details

The Cayley-Menger matrix of a simplex is the matrix of squared distances between each pair of vertices of the simplex, bordered by 1s at left and on top, and 0 in the upper left corner.
For ResourceFunction["CayleyMengerMatrix"][reg], reg can be any valid Triangle, Tetrahedron or Simplex.

## Examples

### Basic Examples (2)

The Cayley-Menger matrix of a triangle represented as a list of its vertices:

 In[1]:=
 Out[1]=

The Cayley-Menger matrix of a Triangle:

 In[2]:=
 Out[2]=

### Scope (3)

The Cayley-Menger matrix of a tetrahedron, specified by its vertex list:

 In[3]:=
 Out[3]=

The Cayley-Menger matrix of a tetrahedron, specified as a Tetrahedron:

 In[4]:=
 Out[4]=

The Cayley-Menger matrix of a tetrahedron, specified as a Simplex:

 In[5]:=
 Out[5]=

### Applications (3)

Use the Cayley-Menger matrix to evaluate the content of a simplex:

 In[6]:=

Compute the area of a triangle:

 In[7]:=
 Out[7]=

Compute the volume of a tetrahedron:

 In[8]:=
 Out[8]=

Compute the content of a four-dimensional simplex:

 In[9]:=
 Out[9]=

Use the Cayley-Menger matrix to obtain the circumsphere of a simplex:

 In[10]:=

Circumcenter and circumradius of a triangle:

 In[11]:=
 In[12]:=
 Out[12]=

Compare with the result of Circumsphere:

 In[13]:=
 Out[13]=

Circumcenter and circumradius of a tetrahedron:

 In[14]:=
 In[15]:=
 Out[15]=

Compare with the result of Circumsphere:

 In[16]:=
 Out[16]=

Use the Cayley-Menger matrix to obtain the insphere of a simplex:

 In[17]:=

Incenter and inradius of a triangle:

 In[18]:=
 In[19]:=
 Out[19]=

Compare with the result of Insphere

 In[20]:=
 Out[20]=

Incenter and inradius of a tetrahedron:

 In[21]:=
 In[22]:=
 Out[22]=

Compare with the result of Insphere:

 In[23]:=
 Out[23]=

### Properties and Relations (1)

The Cayley-Menger matrix is symmetric:

 In[24]:=
 Out[24]=

## Version History

• 1.0.0 – 06 January 2021