Given a regular polygon of N sides with radius(distance from the center to any vertex) R. The task is to find the area of the polygon.
Input : r = 9, N = 6 Output : 210.444 Input : r = 8, N = 7 Output : 232.571
In the figure, we see that the polygon can be divided into N equal triangles.
Looking into one of the triangles, we see that the whole angle at the centre can be divided into = 360/N parts.
So, angle t = 180/N.
Looking into one of the triangles, we see,
h = rcost a = rsint
area of the triangle = (base * height)/2 = r2sin(t)cos(t) = r2*sin(2t)/2
So, area of the polygon:
A = n * (area of one triangle) = n*r2*sin(2t)/2 = n*r2*sin(360/n)/2
Below is the implementation of the above 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.
- Area of a n-sided regular polygon with given side length
- Area of largest Circle inscribe in N-sided Regular polygon
- Program to find Area of Triangle inscribed in N-sided Regular Polygon
- Find area of the larger circle when radius of the smaller circle and difference in the area is given
- Apothem of a n-sided regular polygon
- Length of Diagonal of a n-sided regular polygon
- Central angle of a N sided Regular Polygon
- Regular polygon using only 1s in a binary numbered circle
- Program to find the Circumcircle of any regular polygon
- Program to find the Perimeter of a Regular Polygon
- Angle between 3 given vertices in a n-sided regular polygon
- Check whether two convex regular polygon have same center or not
- Determine the position of the third person on regular N sided polygon
- Side of a regular n-sided polygon circumscribed in a circle
- Find the angle of Rotational Symmetry of an N-sided regular polygon
- Minimum side of square embedded in Regular polygon with N sides
- Program to find the Interior and Exterior Angle of a Regular Polygon
- Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
- Area of Equilateral triangle inscribed in a Circle of radius R
- Area of a polygon with given n ordered vertices
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.