Function Repository Resource:

Circumcircle3D

Source Notebook

Generate the circumcircle of a 3D triangle

Contributed by: Jan Mangaldan

ResourceFunction["Circumcircle3D"][{p1,p2,p3}]

returns a BSplineCurve representing the circumcircle of the triangle with corner points p1,p2, and p3.

ResourceFunction["Circumcircle3D"][{p1,p2,p3},property]

gives the value of the specified property.

Details

The following properties are supported:
"Association"association containing the circumcircle, circumcenter and circumradius
"Center"circumcenter
"Circle"BSplineCurve representing the circumcircle
"Radius"circumradius
ResourceFunction["Circumcircle3D"][poly] where poly is a Triangle or Polygon is equivalent to ResourceFunction["Circumcircle3D"][PolygonCoordinates[poly]].

Examples

Basic Examples (1) 

Circumcircle of a 3D triangle:

In[1]:=
Graphics3D[
 ResourceFunction[
  "Circumcircle3D"][{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}]]
Out[1]=

Scope (3) 

Show a triangle and its circumcircle together:

In[2]:=
tri = Triangle[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}];
Graphics3D[{{Directive[FaceForm[], EdgeForm[Red]], tri}, {Blue, ResourceFunction["Circumcircle3D"][tri]}}]
Out[2]=

Use Tube to render a circumcircle:

In[3]:=
Graphics3D[{Blue, Tube[ResourceFunction[
    "Circumcircle3D"][{{1, -1, 1}, {-2, 3, 0}, {1, -1, 2}}]]}]
Out[3]=

Return the circumcenter and circumradius:

In[4]:=
ResourceFunction[
 "Circumcircle3D"][{{1, -1, 1}, {-2, 3, 0}, {1, -1, 2}}, "Center"]
Out[4]=
In[5]:=
ResourceFunction[
 "Circumcircle3D"][{{1, -1, 1}, {-2, 3, 0}, {1, -1, 2}}, "Radius"]
Out[5]=

Neat Examples (1) 

Interlocking circumcircles of the faces of an icosahedron:

In[6]:=
Graphics3D[{Pink, Composition[Tube, ResourceFunction["Circumcircle3D"]] /@ N[PolyhedronData["Icosahedron", "Polygons"]]}]
Out[6]=

Version History

  • 1.0.0 – 14 June 2021

Source Metadata

Related Resources

License Information