Given four sides of quadrilateral a, b, c, d, find the maximum area of the quadrilateral possible from the given sides .
Input : 1 2 1 2 Output : 2.00 It is optimal to construct a rectangle for maximum area .
According to Bretschneider’s formula, the area of a general quadilateral is given by
Here a, b, c, d are the sides of a quadilateral, s is the semiperimeter of a quadilateral and angles are two opposite angles.
So, this formula is maximized only when opposite angles sum to pi(180) then we can use a simplified form of Bretschneider’s formula to get the (maximum) area K.
This formula is called as Brahmagupta’s formula .
Below is the implementation of given approach
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.
- Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
- Program to find the angles of a quadrilateral
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Check whether Quadrilateral is valid or not if angles are given
- Number of quadrilateral formed with N distinct points on circumference of Circle
- Length of Diagonals of a Cyclic Quadrilateral using the length of Sides.
- Circumradius of a Cyclic Quadrilateral using the length of Sides
- Calculate Volume, Curved Surface Area and Total Surface Area Of Cylinder
- Find area of the larger circle when radius of the smaller circle and difference in the area is given
- Maximum area of triangle having different vertex colors
- Maximum area rectangle by picking four sides from array
- Maximum of smallest possible area that can get with exactly k cut of given rectangular
- Number of squares of maximum area in a rectangle
- Rectangle with Maximum Area using Java Pair
- Maximum area of rectangle possible with given perimeter
- Maximum area of rectangle inscribed in an equilateral triangle
- Maximum area of a Rectangle that can be circumscribed about a given Rectangle of size LxW
- Find maximum volume of a cuboid from the given perimeter and area
- Area of a polygon with given n ordered vertices
- Find all sides of a right angled triangle from given hypotenuse and area | Set 1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.
Improved By : vt_m