Given an integer a which is the side of a regular heptagon, the task is to find and print the length of its diagonal.
Input: a = 6
Input: a = 9
Approach: We know that the sum of interior angles of a polygon = (n – 2) * 180 where, n is the no. of sides in the polygon.
So, sum of interior angles of heptagon = 5 * 180 = 900 and each interior angle will be 128.58(Approx).
Now, we have to find BC = 2 * x. If we draw a perpendicular AO on BC, we will see that the perpendicular bisects BC in BO and OC, as triangles AOB and AOC are congruent to each other.
So, in triangle AOB, sin(64.29) = x / a i.e. x = 0.901 * a
Therefore, diagonal length will be 2 * x i.e. 1.802 * a.
Below is the implementation of the above approach:
- Diagonal of a Regular Hexagon
- Diagonal of a Regular Pentagon
- Diagonal of a Regular Decagon
- 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
- Apothem of a n-sided regular polygon
- Length of the Diagonal of the Octagon
- Area of a n-sided regular polygon with given Radius
- Program to find the Perimeter of a Regular Polygon
- Program to find the Circumcircle of any regular polygon
- Area of a circle inscribed in a regular hexagon
- Regular polygon using only 1s in a binary numbered circle
- Area of a square from diagonal length
- Find length of Diagonal of Hexagon
- Area of hexagon with given diagonal length