Given a n-sided polygon with side length a. The task is to find the area of the cicumcircle of the polygon.
Input: n = 10, a = 3 Output: 1.99737 Input: n = 5, a = 6 Output: 3.02487
Approach: A regular n-gon divides the circle into n pieces, so the central angle of the triangle is a full circle divided by n: 360 deg/n.
Applying the law of cosines for the three side lengths of the triangle, we get
c2 = a2 + b2 – 2ab cos C
or, a2 = r2 + r2 – 2rr cos (360/n)
or, a2 = 2r2 – 2r2 cos (360/n)
or, c2 = r2 (2 – 2 cos (360/n))
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.
- Polygon with maximum sides that can be inscribed in an N-sided regular polygon
- Area of the circumcircle of any triangles with sides given
- Program to find the Interior and Exterior Angle of a Regular Polygon
- Program to find the Perimeter of a Regular Polygon
- Program to find Area of Triangle inscribed in N-sided Regular Polygon
- Program to calculate area of Circumcircle of an Equilateral Triangle
- Find if a point lies inside, outside or on the circumcircle of three points A, B, C
- Find the angle of Rotational Symmetry of an N-sided regular polygon
- Area of Circumcircle of a Right Angled Triangle
- Area of Circumcircle of an Equilateral Triangle using Median
- Check if given polygon is a convex polygon or not
- Regular polygon using only 1s in a binary numbered circle
- Side of a regular n-sided polygon circumscribed in a circle
- Area of a n-sided regular polygon with given side length
- Area of a n-sided regular polygon with given Radius
- Length of Diagonal of a n-sided regular polygon
- Apothem of a n-sided regular polygon
- Area of largest Circle inscribe in N-sided Regular polygon
- Determine the position of the third person on regular N sided polygon
- Angle between 3 given vertices in a n-sided regular polygon
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.