Function Repository Resource:

SphericalIncircle

Source Notebook

Generate the incircle of a spherical triangle

Contributed by: Jan Mangaldan

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

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

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

gives the value of the specified property.

Details

The points pi are taken to be unit vectors (i.e., on a unit sphere centered at the origin).
The following properties are supported:
"Association"association containing the incircle, incenter and inradius
"Center"center of the incircle (in Cartesian coordinates)
"Circle"BSplineCurve representing the incircle
"Radius"inradius (spherical distance)

Examples

Basic Examples (3) 

Generate the vertices of a spherical triangle:

In[1]:=
tri = RandomPoint[Sphere[], 3]
Out[2]=

Show the incircle as a BSplineCurve object:

In[3]:=
ResourceFunction["SphericalIncircle"][tri]
Out[3]=

Visualize the spherical triangle and its incircle together:

In[4]:=
Graphics3D[{Sphere[],
  {Directive[Red, AbsolutePointSize[8]], Point[tri]},
  {FaceForm[], ResourceFunction["SphericalPolygon"][tri, "EdgeStyle" -> Directive[Red, AbsoluteThickness[3]], "ShowEdges" -> True]}, {Directive[AbsoluteThickness[2], Blue], ResourceFunction["SphericalIncircle"][tri]}},
 Boxed -> False, ViewPoint -> {-2.4, 1.3, -2.}]
Out[4]=

Scope (2) 

Generate the vertices of a spherical triangle:

In[5]:=
tri = RandomPoint[Sphere[], 3]
Out[6]=

Return the incenter and inradius:

In[7]:=
ResourceFunction["SphericalIncircle"][tri, "Center"]
Out[7]=
In[8]:=
ResourceFunction["SphericalIncircle"][tri, "Radius"]
Out[8]=

Version History

  • 1.0.0 – 15 July 2022

Related Resources

License Information