Given an ellipse, with major axis length 2a & 2b. The task is to find the area of the largest rectangle that can be inscribed in it.
Input: a = 4, b = 3 Output: 24 Input: a = 10, b = 8 Output: 160
Let the upper right corner of the rectangle has co-ordinates (x, y),
Then the area of rectangle, A = 4*x*y.
Equation of ellipse, (x2/a2) + (y2/b2) = 1
Thinking of the area as a function of x, we have
dA/dx = 4xdy/dx + 4y
Differentiating equation of ellipse with respect to x, we have
2x/a2 + (2y/b2)dy/dx = 0,
dy/dx = -b2x/a2y,
dAdx = 4y – (4b2x2/a2y)
Setting this to 0 and simplifying, we have y2 = b2x2/a2.
From equation of ellipse we know that,
y2=b2 – b2x2/a2
Thus, y2=b2 – y2, 2y2=b2, and y2b2 = 1/2.
Clearly, then, x2a2 = 1/2 as well, and the area is maximized when
x= a/√2 and y=b/√2
So the maximum area Area, Amax = 2ab
Below is the implementation of the above approach:
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse
- Largest ellipse that can be inscribed within a rectangle which in turn is inscribed within a semicircle
- Area of the biggest ellipse inscribed within a rectangle
- Area of the Largest square that can be inscribed in an ellipse
- Find the area of largest circle inscribed in ellipse
- Area of largest triangle that can be inscribed within a rectangle
- Area of a circle inscribed in a rectangle which is inscribed in a semicircle
- Ratio of area of a rectangle with the rectangle inscribed in it
- Largest triangle that can be inscribed in an ellipse
- Area of the biggest possible rhombus that can be inscribed in a rectangle
- Largest rectangle that can be inscribed in a semicircle
- Area of the largest Rectangle without a given point
- Area of largest Circle that can be inscribed in a SemiCircle
- Area of the Largest Triangle inscribed in a Hexagon
- Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.