Largest right circular cone that can be inscribed within a sphere which is inscribed within a cube | Python3 Program to find the biggest right circular cone that can be inscribed within a right circular cone which in turn is inscribed within a cube ; Function to find the biggest right circular cone ; side cannot be negative ; radius of right circular cone ; height of right circular cone ; volume of right circular cone ; Driver code
import math NEW_LINE def cone ( a ) : NEW_LINE INDENT if ( a < 0 ) : NEW_LINE INDENT return - 1 ; NEW_LINE DEDENT r = ( a * math . sqrt ( 2 ) ) / 3 ; NEW_LINE h = ( 2 * a ) / 3 ; NEW_LINE V = 3.14 * math . pow ( r , 2 ) * h ; NEW_LINE return V ; NEW_LINE DEDENT a = 5 ; NEW_LINE print ( cone ( a ) ) ; NEW_LINE