rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Problem Solution 438 - The Circumference of A Circle

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Problem Solution 438 - The Circumference of A Circle

#include<stdio.h>
#include<math.h>
#define pi 3.141592653589793
int main()
{
double x1,x2,x3,y1,y2,y3,a,b,c,s,r,d,cir;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)==6)
{
a=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
b=sqrt(pow((x1-x3),2)+pow((y1-y3),2));
c=sqrt(pow((x2-x3),2)+pow((y2-y3),2));
s=(a+b+c)/2;
r=a*b*c/(4*sqrt((s*(s-a)*(s-b)*(s-c))));
cir=2*pi*r;
printf("%.2lf\n",cir);
}
return 0;
}

No comments:

Post a Comment