Computing inscribed radius and circumscribed radius

triangle with inscribed and circumscribed circles drawn

A few days ago I wrote about the law of cotangents. This law says that if we label the sides of a triangle a, b, c and label the angles opposite each side α. β, γ, then

\frac{\cot \alpha/2}{s - a} = \frac{\cot \beta/2}{s - b} = \frac{\cot \gamma/2}{s - c} = \frac{1}{r}

where s is the semi-parameter, i.e.

s = (a + b + c)/2

and r is the radius of the incircle, the largest circle that can be inscribed in the triangle. This is the red circle in the image above.

The law of sines is sort of a dual to the law of cotangents. Just as the law of cotangents gives you the radius of the inscribed circle, the law of sines gives you the radius of the circumcircle, the blue circle in the image above. That is,

\frac{\sin\alpha}{a} = \frac{\sin\beta}{b} = \frac{\sin\gamma}{c} = \frac{1}{d}

where d is the diameter of the circle through the vertices of the triangle.