SphereCircumscribed::usage="Given the vertices of a tetrahedron, the circumcenter, barycenter, the point of Monge and the circumscribed sphere are obtained. References: Function repository of Wolfram Mathematica; Personal.";
In[]:=
​​​​BarycenterCircumcenterMonge[tet={{ax_,ay_,az_},{bx_,by_,bz_},{cx_,cy_,cz_},{dx_,dy_,dz_}}]:=​​Module{},prueba=Det[{{1,ax,ay,az},{1,bx,by,bz},{1,cx,cy,cz},{1,dx,dy,dz}}];​​Ifprueba==0,Print[PasteButton["It's not a tetrahedron"]],​​ρ=ResourceFunction["Monge"][tet];​​G=
{ax,ay,az}+{bx,by,bz}+{cx,cy,cz}+{dx,dy,dz}
4
;​​Cir=2G-ρ[[1]];r=Norm[Cir-{ax,ay,az}];​​s=Grid[{{Barycenter(Black),Monge(Green),Circumcenter(Red),Circumradius},{G,ρ[[1]],Cir,r}},FrameAll];​​Print[s];​​Show[{Graphics3D[{Tube[#]&/@Subsets[tet,{2}],Green,Sphere[ρ[[1]],0.1],Opacity[.2],Red,Polygon/@Subsets[tet,{3}],Yellow,Opacity[.2],ρ[[2]]}],Graphics3D[{Blue,Opacity[0.1],Sphere[Cir,r]}],Graphics3D[{Red,Ball[Cir,0.1]}],Graphics3D[{Black,Ball[G,0.1]}],Graphics3D[{Black,Dashed,Thick,Line[{Cir,ρ[[1]]}]}]},AxesLabel->(Style[#,15,Blue]&/@{"X","Y","Z"}),AxesOrigin{0,0,0},AxesTrue,BoxedFalse,BoxRatiosAutomatic,PlotRangeAll​​]
Example 1:
In[]:=
BarycenterCircumcenterMonge[tet={{-1,0,3},{1,-1,1},{2,0,-2},{-2,-2,1}}]
Barycenter
Monge
Circumcenter
Circumradius
0,-
3
4
,
3
4


61
38
,-
63
19
,
43
19

-
61
38
,
69
38
,-
29
38

25739
38
Out[]=
Example 2:
In[]:=
BarycenterCircumcenterMonge[tet={{1,1,1},{3,6,0},{0,3,2},{2,3,7}}]
Barycenter
Monge
Circumcenter
Circumradius

3
2
,
13
4
,
5
2

-
159
118
,
201
59
,
217
118


513
118
,
365
118
,
373
118

282059
118
Out[]=
Example 3:
In[]:=
BarycenterCircumcenterMonge[tet={{1,1,1},{1,-1,-1},{-1,1,-1},{-1,-1,1}}]
Barycenter
Monge
Circumcenter
Circumradius
{0,0,0}
{0,0,0}
{0,0,0}
3
Out[]=
Example 4:
In[]:=
BarycenterCircumcenterMonge[tet={{1,0,0},{1,-1,-1},{-1,1,-1},{-1,-1,1}}]
Barycenter
Monge
Circumcenter
Circumradius
0,-
1
4
,-
1
4


1
2
,0,0
-
1
2
,-
1
2
,-
1
2

11
2
Out[]=