UVa 10432 – Polygon Inside A Circle

Problem Link


Full Circle= 2*pi;

if n-gon is inside the circle then it is make a triangle for each division if we attach the

nodes,so that for each triangle the angle will be 2*pi/n;

for each triangle the area will be A=r*r*sin(2*P/n)/2)

total area =n*A

For extra info,Click here!


<Source Code>

#include<stdio.h>
#define P 2*acos(0.0)
int main()
{double n,r;
while(scanf(“%lf %lf”,&r,&n)!=EOF)
{printf(“%.3lf\n”,r*r*n*sin(2*P/n)/2);
}

return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s