Largest hexagon that can be inscribed within a square | Function to return 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 = 0.5176 * $ a ; return $ x ; } $ a = 6 ; echo hexagonside ( $ a ) ; ? >