Largest hexagon that can be inscribed within an equilateral triangle | Function to find the side of the hexagon ; Side cannot be negative ; Side of the hexagon ; Driver code
< ? php function hexagonside ( $ a ) { if ( $ a < 0 ) return -1 ; $ x = $ a / 3 ; return $ x ; } $ a = 6 ; echo hexagonside ( $ a ) ; ? >