Largest ellipse that can be inscribed within a rectangle which in turn is inscribed within a semicircle | Java Program to find the biggest ellipse which 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
class GFG { static float ellipsearea ( float r ) { if ( r < 0 ) return - 1 ; float a = ( float ) ( ( 3.14f * r * r ) / 4 ) ; return a ; } public static void main ( String [ ] args ) { float r = 5 ; System . out . println ( ellipsearea ( r ) ) ; } }