Largest square that can be inscribed within a hexagon which is inscribed within an equilateral triangle | Function to find the side of the square ; Side cannot be negative ; side of the square ; Driver code
< ? php function squareSide ( $ a ) { if ( $ a < 0 ) return -1 ; $ x = 0.423 * $ a ; return $ x ; } $ a = 8 ; echo squareSide ( $ a ) ; ? >