Saturday, October 22, 2011

[UVa] 10432 - Polygon inside a circle

#include <stdio.h>
#include <math.h>
#define PI (2*acos(0))
int main()
{
    double area, r, n;
    while (scanf("%lf %lf",&r,&n)==2)
    {
        area = r*r*sin(2*PI/n)/2.0;
        printf("%.3lf\n",area*n);
    }
    return 0;
}

No comments:

Post a Comment

Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...