Archive for the ‘Geometry’ Category

UVA – 10432 – Polygon Inside A Circle   1 comment


#include <stdio.h>
#include <math.h>
int main()
{
	double r,s,PI;
	PI = 4*atan(1);
	while(scanf("%lf %lf",&r,&s)==2)
		printf("%.3lf\n",r*s*r*sin((2.00*PI)/s)/2.00);
	return 0;
}
Advertisements

Posted August 23, 2011 by epicrado in Geometry