Advertisement
Guest User

butit'sperfect

a guest
Nov 27th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <math.h>
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7.  
  8. long double PI = 3.141592653589793;
  9.  
  10. long double area(double x1, double y1, double x2, double y2, double x3, double y3)
  11. {
  12. return fabs(x1 * y2 + x3 * y1 + x2 * y3 - x3 * y2 - x1 * y3 - x2 * y1);
  13. }
  14.  
  15. int main()
  16. {
  17. double x1, y1, x2, y2, x3, y3;
  18. int n;
  19.  
  20. cin>>n;
  21.  
  22. for(int i=0; i<n; i++)
  23. {
  24. cin>>x1>>y1>>x2>>y2>>x3>>y3;
  25.  
  26. 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;
  27. }
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement