Largest right circular cone that can be inscribed within a sphere | Function to find the radius of the cone ; radius cannot be negative ; radius of the cone ; Function to find the height of the cone ; side cannot be negative ; height of the cone ; Driver code
< ? php function coner ( $ R ) { if ( $ R < 0 ) return -1 ; $ r = ( 2 * sqrt ( 2 ) * $ R ) / 3 ; return $ r ; } function coneh ( $ R ) { if ( $ R < 0 ) return -1 ; $ h = ( 4 * $ R ) / 3 ; return $ h ; } $ R = 10 ; echo ( " r ▁ = ▁ " ) ; echo coner ( $ R ) ; echo ( " , ▁ " ) ; echo ( " h ▁ = ▁ " ) ; echo ( coneh ( $ R ) ) ; ? >