Given a rectangle of dimensions L and W. The task is to find the maximum area of a rectangle that can be circumscribed about a given rectangle with dimensions L and W.
Input: L = 10, W = 10
Input: L = 18, W = 12
Approach: Let below is the given rectangle EFGH of dimensions L and W. We have to find the area of rectangle ABCD which is circumscribing rectangle EFGH.
In the above figure:
Now, The area of rectangle ABCD is given by:
Area = AB * AD
Area = (AE + EB)*(AH + HD) …..(1)
According to the projection rule:
AE = L*sin(X)
EB = W*cos(X)
AH = L*cos(X)
HD = W*sin(X)
Substituting the value of the above projections in equation (1) we have:
Now to maximize the area, the value of sin(2X) must be maximum i.e., 1.
Therefore after substituting sin(2X) as 1 we have,
Below is the implementation of the above approach:
Time Complexity: O(1)
Auxiliary Space: O(1)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Area of a Circumscribed Circle of a Square
- Area of square Circumscribed by Circle
- Minimum volume of cone that can be circumscribed about a sphere of radius R
- Find the number of rectangles of size 2*1 which can be placed inside a rectangle of size n*m
- Ratio of area of a rectangle with the rectangle inscribed in it
- Side of a regular n-sided polygon circumscribed in a circle
- Area of the biggest possible rhombus that can be inscribed in a rectangle
- Area of Largest rectangle that can be inscribed in an Ellipse
- Area of largest triangle that can be inscribed within a rectangle
- Maximum area of rectangle possible with given perimeter
- Maximum area rectangle by picking four sides from array
- Number of squares of maximum area in a rectangle
- Length and Breadth of rectangle such that ratio of Area to diagonal^2 is maximum
- Rectangle with Maximum Area using Java Pair
- Maximum area of rectangle inscribed in an equilateral triangle
- Find minimum area of rectangle with given set of coordinates
- Area of the largest Rectangle without a given point
- Area of the largest rectangle possible from given coordinates
- Area of the largest rectangle formed by lines parallel to X and Y axis from given set of points
- Maximum of smallest possible area that can get with exactly k cut of given rectangular
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.