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
function ellipsearea ( r ) { if ( r < 0 ) return - 1 ; var a = ( ( 3.14 * r * r ) / 4 ) ; return a ; } var r = 5 ; document . write ( ellipsearea ( r ) ) ;