Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9. int x1,y1,x2,y2,x3,y3;
  10. double a,b,c,s,p,r;
  11. cin >>x1>>y1>>x2>>y2>>x3>>y3;
  12. a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
  13. b = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
  14. c = sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
  15. p =(a + b + c)/2;
  16. s = sqrt(p * (p - a) * (p - b) * (p - c));
  17. r = (a*b*c)/(4*s);
  18. cout.setf(ios::fixed | ios::showpoint);
  19. cout.precision(3);
  20. if(s == 0)
  21. {
  22. cout << 3.141592653589793238462643383279 *(max(max(a,b),max(a,c))) <<endl;
  23. return 0;
  24. }
  25. cout << 2 * 3.141592653589793238462643383279 * r << endl;
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement