noshin98

uva 438

Oct 12th, 2016
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. /*Bismillah*/
  2. #include<stdio.h>
  3. #include<math.h>
  4. #define pi 3.141592653589793
  5. int main()
  6. {
  7. double x1,x2,x3,y1,y2,y3,a,b,c,s,r,d,cir;
  8. while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)==6)
  9. {
  10. a=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
  11. b=sqrt(pow((x1-x3),2)+pow((y1-y3),2));
  12. c=sqrt(pow((x2-x3),2)+pow((y2-y3),2));
  13. s=(a+b+c)/2;
  14. r=a*b*c/(4*sqrt((s*(s-a)*(s-b)*(s-c))));
  15. cir=2*pi*r;
  16. printf("%.2lf\n",cir);
  17. }
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment