Advertisement
Guest User

somuchbs

a guest
Nov 27th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <math.h>
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7. long double area(double x1, double y1, double x2, double y2, double x3, double y3)
  8. {
  9. return fabs(x1 * y2 + x3 * y1 + x2 * y3 - x3 * y2 - x1 * y3 - x2 * y1);
  10. }
  11.  
  12. int main()
  13. {
  14. long double PI = 3.141592653589793;
  15. double x1, y1, x2, y2, x3, y3;
  16.  
  17. while(cin>>x1>>y1>>x2>>y2>>x3>>y3)
  18. {
  19. cout<<setprecision(2)<<fixed<<hypot(x1-x2, y1-y2) * hypot(x2-x3, y2-y3) * hypot(x1-x3, y1-y3) * PI / area(x1, y1, x2, y2, x3, y3)<<endl;
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement