You are given the length of the diagonal of a hexagon, d. Your task is to find the area of that hexagon.
Input : 5 Output : Area of Hexagon: 16.238 Input : 10 Output : Area of Hexagon: 64.9519
Hexagon is a regular polygon having six equal sides and all equal angles. The interior angles of Hexagon are of 120 degrees each and the sum of all angles of a Hexagon is 720 degrees.
Let d be the diagonal of Hexagon, then the formula to find the area of Hexagon given by
How does above formula work?
We know that area of hexagon with side length a = (3 √3(a)2 ) / 2. Since all sides are of same size and angle is 120 degree, d = 2a or a = d/2. After putting this value, we get area as (3 √3(d)2 ) / 8.
Below is the implementation .
Area of Hexagon: 64.952
Time Complexity: O(1)
- Find length of Diagonal of Hexagon
- Area of a square from diagonal length
- Diagonal of a Regular Hexagon
- Area of a Hexagon
- Area of the Largest Triangle inscribed in a Hexagon
- Area of a circle inscribed in a regular hexagon
- Calculate area of pentagon with given diagonal
- Length of the Diagonal of the Octagon
- Area of a square inscribed in a circle which is inscribed in a hexagon
- Length of Diagonal of a n-sided regular polygon
- Area of a n-sided regular polygon with given side length
- Largest hexagon that can be inscribed within a square
- Largest Square that can be inscribed within a hexagon
- Largest hexagon that can be inscribed within an equilateral triangle
- Calculate Volume, Curved Surface Area and Total Surface Area Of Cylinder
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.