Malfatti circles

Posted on January 16, 2020 by Stéphane Laurent
Tags: R, maths, geometry

The Malfatti cirlces of a triangle can be constructed using straightedge and compass.

Here we provide the analytical formulae of the Malfatti circles of a triangle \(ABC\).

Let \(I\) be the incircle of \(ABC\) and \(r\) its inradius. Let \(a = BC\), \(b = AC\) and \(c = AB\) be the edge lengths of \(ABC\), and \(s = \frac{1}{2}(a+b+c)\) be the semiperimeter. The radii of the Malfatti circles are given by \[ r_1 = \frac{r\bigl(s - r - (IB+IC-IA)\bigr)}{2(s-a)}, \] \[ r_2 = \frac{r\bigl(s - r - (IC+IA-IB)\bigr)}{2(s-b)}, \] \[ r_3 = \frac{r\bigl(s - r - (IA+IB-IC)\bigr)}{2(s-c)}. \] Now, the centers. Set \[ d_1 = \frac{r_1}{\tan\left(\dfrac{\arccos\left(\dfrac{(C-A).(B-A)}{bc}\right)}{2}\right)}, \] \[ d_2 = \frac{r_2}{\tan\left(\dfrac{\arccos\left(\dfrac{(C-B).(A-B)}{ac}\right)}{2}\right)}, \] \[ d_3 = \frac{r_3}{\tan\left(\dfrac{\arccos\left(\dfrac{(A-C).(B-A)}{ba}\right)}{2}\right)}, \] \[ w = d_1 + d_2 + \sqrt{r_1r_2}, \] \[ u = d_2 + d_3 + \sqrt{r_2r_3}, \] \[ v = d_3 + d_1 + \sqrt{r_3r_1}, \] \[ d = \frac{\sqrt{(-u+v+w)(u+v-w)(u-v+w)(u+v+w)}}{2}. \] Then the trilinear coordinates \(x:y:z\) of the center \(O_1\) are \[ x = \frac{d}{r_1} - (v+w), \quad y = u, \quad z = u. \] For \(O_2\), \[ x = v, \quad y = \frac{d}{r_2} - (u+w), \quad z = v. \] And for \(O_3\), \[ x = w, \quad y = w, \quad z = \frac{d}{r_3} - (u+v). \]

Here is a R code returning the Malfatti circles:

Try it: