makrusak

Untitled

Sep 4th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.21 KB | None | 0 0
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <string>
  6. #include <queue>
  7. #include <map>
  8. #include <set>
  9. #include <cmath>
  10. #include <sstream>
  11. #include <stack>
  12. #include <cassert>
  13.  
  14. #define pb push_back
  15. #define mp make_pair
  16. #define PI 3.1415926535897932384626433832795
  17. #define sqr(x) (x)*(x)
  18. #define pw(x) (1 << x)
  19. #define forn(i, n) for(int i = 0; i < n; ++i)
  20. #define ALL(x) x.begin(), x.end()
  21. #define X first
  22. #define Y second
  23. typedef long long ll;
  24. typedef unsigned long long ull;
  25. typedef long double ld;
  26. using namespace std;
  27. typedef pair<int,int> pii;
  28. typedef pair<long double, long double> pldd;
  29. typedef pair<double, double> pdd;
  30. const int INF = 2147483647;
  31. const ll LLINF = 9223372036854775807LL;
  32.  
  33. double ax,ay,bx,by,cx,cy;
  34. double ta,tb,tc;
  35. double la,lb,lc;
  36.  
  37. int main() {
  38.   cin >> ax >> ay >> bx >> by >> cx >> cy;
  39.  
  40.   la=sqr(bx-cx)+sqr(by-cy);
  41.   lb=sqr(ax-cx)+sqr(ay-cy);
  42.   lc=sqr(ax-bx)+sqr(ay-by);
  43.  
  44.   ta=acos((lb+lc-la)/(2*sqrt(lb)*sqrt(lc)));
  45.   tb=acos((la+lc-lb)/(2*sqrt(la)*sqrt(lc)));
  46.   tc=acos((la+lb-lc)/(2*sqrt(la)*sqrt(lb)));  
  47.  
  48.   cout << la << " "<< lb << " " << lc << "\n";
  49.   //printf("%f %f %f\n",ta,tb,tc);
  50.   cin >> cx;
  51.   return 0;  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment