# Law of cotangents

A triangle, showing the "incircle" and the partitioning of the sides. The angle bisectors meet at the incenter, which is the center of the incircle.
By the above reasoning, all 6 parts are as shown.

In trigonometry, the law of cotangents[1] relates the radius of the inscribed circle of a triangle (the inradius) to its sides and angles.

## Statement

Using the usual notations for a triangle (see the figure at the upper right), where $a, b, c$ are the lengths of the three sides, $A, B, C$ are the angles opposite those three respective sides, $s$ is the semi-perimeter, that is, $s = (a+b+c)/2$, and $r$ is the radius of the inscribed circle, the law of cotangents states that

$\frac{\cot(A/2)}{s-a} = \frac{\cot(B/2)}{s-b} = \frac{\cot(C/2)}{s-c} = \frac{1}{r}\,$

and furthermore that the inradius is given by

$r = \sqrt{\frac{(s-a)(s-b)(s-c)}{s}}\,.$

## Proof

In the upper figure, the points of tangency of the incircle with the sides of the triangle break the perimeter into 6 segments, in 3 pairs. In each pair the segments are of equal length. For example, the 2 segments adjacent to vertex A are equal. If we pick one segment from each pair, their sum will be the semiperimeter s. An example of this is the segments shown in color in the figure. The two segments making up the red line add up to a, so the blue segment must be of length s−a. Obviously, the other 5 segments must also have lengths s−a, s−b, or s−c, as shown in the lower figure.

By inspection of the figure, using the definition of the cotangent function, we have

$\cot(A/2) =\frac{s-a}{r}\,$

and similarly for the other two.

To get the inradius, note that the area of the triangle is also divided into 6 smaller triangles, also in 3 pairs, with the triangles in each pair having the same area. For example, the two triangles near vertex A, being right triangles of width s−a and height r, each have an area of $\tfrac{1}{2}r(s-a)$. So those two triangles together have an area of $r(s-a)\,$, and the area of the whole triangle is therefore

\begin{align} \text{Area }&= r(s-a) + r(s-b) + r(s-c) = r(s-a + s-b + s-c) \\[8pt] &= r(3s - (a+b+c)) = r(3s - 2s) = rs \\[8pt] \end{align}

By Heron's formula, the area is also

$\sqrt{s(s-a)(s-b)(s-c)}\,$

so

$r = \sqrt{\frac{(s-a)(s-b)(s-c)}{s}}\,$

## Some proofs using the Law of cotangents

A number of other results can be derived from the law of cotangents.

${\frac {\sin \left( \alpha/2-\beta/2 \right) }{\sin \left( \alpha/2+\beta/2 \right) }}= {\frac {\cot \left( \beta/2 \right) -\cot \left( \alpha/2 \right) }{\cot \left( \beta/2 \right) +\cot \left( \alpha/2 \right) }}= {\frac {a-b}{2s-a-b}}$.
This gives the result: ${\dfrac {a-b}{c}}={\dfrac {\sin \left( \alpha/2-\beta/2 \right)}{\cos \left( \gamma/2 \right) }}$ as required.
${\frac {\cos \left( \alpha/2-\beta/2 \right) }{\cos \left( \alpha/2+\beta/2 \right) }} = {\frac {\cot \left( \alpha/2 \right) \cot \left( \beta/2 \right) +1}{\cot \left( \alpha/2 \right) \cot \left( \beta/2 \right) -1}} = {\frac {\cot \left( \alpha/2 \right) +\cot \left( \beta/2 \right) +2\,\cot \left( \gamma/2 \right) }{\cot \left( \alpha/2 \right) +\cot \left( \beta/2 \right) }} = {\frac {4\,s-a-b-2\,c}{2\,s-a-b}}$.
Here, an extra step is required to transform a product into a sum, according to the sum/product formula.
This gives the result: $\dfrac {b+a}{c} = \dfrac{\cos \left( \alpha/2-\beta/2 \right) }{\sin \left( \gamma/2 \right) }$ as required.