Given a regular hexagon of side length a, the task is to find the length of it’s diagonal.
Input : a = 4 Output : 8 Input : a = 7 Output : 14
From the diagram, it is clear that the triangle ABC is an equilateral triangle, so
AB = AC = BC = a.
also it is obvious, diagonal = 2*AC or 2*BC
So the length of diagonal of the hexagon = 2*a
Below is the implementation of the above approach:
- Area of hexagon with given diagonal length
- Diagonal of a Regular Hexagon
- Length of the Diagonal of the Octagon
- Area of a square from diagonal length
- Length of Diagonal of a n-sided regular polygon
- Filling diagonal to make the sum of every row, column and diagonal equal of 3x3 matrix
- Find the diagonal of the Cube
- Program to find Length of Bridge using Speed and Length of Train
- Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
- Find a Symmetric matrix of order N that contain integers from 0 to N-1 and main diagonal should contain only 0's
- Area of a Hexagon
- Count of 0s in an N-level hexagon
- Largest hexagon that can be inscribed within a square
- Largest Square that can be inscribed within a hexagon
- Number of coloured 0's in an N-level hexagon
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.