10432 - Polygon Inside A Circle
Calculate the area of a polygon having equal sides inside a circle.
The length of each side of the polygon are same. So if we add the n vertex of the polygon to the center of the circle, then we get n triangles all having same area. Now the angle created at center by any triangle is exactly and the length of both arms of triangle is r. So the area of any triangle is . So, area of polygon is .
2 * acos (0)
(in C / C++) to calculate the value of pi. Otherwise precision error may occur.
2 2000 10 3000 5 100
12.566 314.159 78.488