human
Program to find the Radius of the incircle of the triangle | Function to find the radius of the incircle.
the sides cannot be negative.
semi - perimeter of the circle.
area of the triangle.
Radius of the incircle.
Return the radius.
Driver code.
Get the sides of the triangle.
Find the radius of the incircle"
How can the above be solved in Python?
assistant
#Here is code to program to find the Radius of the incircle of the triangle and the other steps required.
 def findRadiusOfIncircle ( a , b , c ) :
	if ( a < 0 or b < 0 or c < 0 ) :
		return - 1
	p = ( a + b + c ) / 2
	area = sqrt ( p * ( p - a ) * ( p - b ) * ( p - c ) )
	radius = area / p
	return radius
if __name__ == " _ _ main _ _ " :
	a , b , c = 2 , 2 , 3
	print ( round ( findRadiusOfIncircle ( a , b , c ) , 6 ) )