Largest ellipse that can be inscribed within a rectangle which in turn is inscribed within a semicircle | Function to find the area of the biggest ellipse ; the radius cannot be negative ; area of the ellipse ; Driver code
< ? php function ellipsearea ( $ r ) { if ( $ r < 0 ) return -1 ; $ a = ( 3.14 * $ r * $ r ) / 4 ; return $ a ; } $ r = 5 ; echo ellipsearea ( $ r ) . " STRNEWLINE " ; ? >