Program to find the side of the Octagon inscribed within the square | Function to find the side of the octagon ; side cannot be negative ; side of the octagon ; Get he square side ; Find the side length of the square
< ? php function octaside ( $ a ) { if ( $ a < 0 ) return -1 ; $ s = $ a / ( sqrt ( 2 ) + 1 ) ; return $ s ; } $ a = 4 ; echo octaside ( $ a ) ; ? >