Here's how the formula is derived :
Since the radius, r, of the incircle can be drawn to meet each side of the larger triangle at right angles, then we can construct three triangles by connecting each vertex of the larger triangle to its incenter. And each of these triangles has a height of r and a side as a base.
So.....the total area, A, of the the larger triangle is
(1/2) r ( a + b + c) = A where a,b,c are the side lengths
Multiply both sides by 2
r (a + b + c) = 2A
Divide both sides by (a + b + c)
r = 2A / (a + b + c)
But (a + b + c) is the perimeter = P
So....
r = 2A / P
