1 | initial version |
That's more a mathematics question than a question about sage. References to and derivations of a nice formula that express the radius of the incircle in terms of the area and perimeter of the triangle are easy to find. Once you have the formulas, it's easy to type them into sage. If you're interested in making pictures of triangles and their incircles, geogebra is probably a better tool.