Function Repository Resource:

MalfattiCircles

Source Notebook

Construct the Malfatti circles of a triangle

Contributed by: Minh Trinh Xuan

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

constructs the Malfatti circles of the triangle with corner points p1,p2, and p3.

Details

The three Malfatti circles of a triangle are tangent to the sides of the triangle and each other.
ResourceFunction["MalfattiCircles"][Triangle[{p1,p2,p3}]] is equivalent to ResourceFunction["MalfattiCircles"][{p1,p2,p3}].

Examples

Basic Examples (2) 

Find the Malfatti circles of a triangle:

In[1]:=
circ = RootReduce[
  ResourceFunction["MalfattiCircles"][{{0, 0}, {4, 0}, {4, 3}}]]
Out[1]=

Show the circles:

In[2]:=
Graphics[{{Directive[FaceForm[], EdgeForm[Blue]], Triangle[{{0, 0}, {4, 0}, {4, 3}}]}, {Red, circ}}]
Out[2]=

Scope (2) 

Find the Malfatti circles of a Triangle object:

In[3]:=
ResourceFunction["MalfattiCircles"][
  Triangle[{{0, 0}, {4, 0}, {4, 3}}]] // RootReduce
Out[3]=

Malfatti circles with integer coordinates and radii:

In[4]:=
ResourceFunction["MalfattiCircles"][SSSTriangle[28392, 21000, 25872]]
Out[4]=

Properties and Relations (1) 

The inradius of a triangle can be expressed in terms of the radii of the Malfatti circles:

In[5]:=
tri = Triangle[{{0, 0}, {4, 0}, {0, 3}}];
rads = Last /@ Simplify[ResourceFunction["MalfattiCircles"][tri]]
Out[6]=
In[7]:=
Last[Insphere[tri]] == (2 Sqrt[Apply[Times, rads]])/(
  Total[Sqrt[rads]] - Sqrt[Total[rads]]) // FullSimplify
Out[7]=

Neat Examples (2) 

Show the Malfatti circles of an arbitrary triangle in a Manipulate:

In[8]:=
Manipulate[
 Graphics[{InfiniteLine /@ Subsets[{AA, BB, CC}, {2}], {EdgeForm[Blue], LightBlue, Triangle[{AA, BB, CC}]}, {Red, ResourceFunction["MalfattiCircles"][{AA, BB, CC}]}}, PlotRange -> 6],
 {{AA, {1, 3}}, {-4, -4}, {4, 4}, Locator},
 {{BB, {-3, -1}}, {-4, -4}, {4, 4}, Locator},
 {{CC, {2, -1}}, {-4, -4}, {4, 4}, Locator}, SaveDefinitions -> True]
Out[8]=

Iteratively form the Malfatti circles of the triangle formed by the centers of the excircles:

In[9]:=
NestList[
  ResourceFunction["MalfattiCircles"][
    First /@ ResourceFunction["Exspheres"][First /@ #]] &, ResourceFunction["MalfattiCircles"][
   First /@ ResourceFunction["Exspheres"][Triangle[CirclePoints[3] // N]]], 3] // Graphics
Out[9]=

Publisher

Trinh Xuan Minh

Version History

  • 1.0.0 – 22 August 2022

Related Resources

License Information