Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- double M_PI = acos(-1);
- struct point
- {
- double x, y;
- };
- using namespace std;
- int main()
- {
- int N;
- cin >> N;
- vector<double> out;
- point mas[3];
- long double alpha, beta;
- for (int j = 0; j < N; j++)
- {
- for (int i = 0; i < 3; i++)
- {
- std::cin >> mas[i].x >> mas[i].y;
- }
- mas[1].x = mas[1].x - mas[0].x;
- mas[1].y = mas[1].y - mas[0].y;
- mas[2].x = mas[2].x - mas[0].x;
- mas[2].y = mas[2].y - mas[0].y;
- if (mas[1].y < 0) alpha = 2*M_PI + atan2l(mas[1].y, mas[1].x);
- else alpha = atan2l(mas[1].y, mas[1].x);
- if (mas[2].y < 0) beta = 2 * M_PI + atan2l(mas[2].y, mas[2].x);
- else beta = atan2l(mas[2].y, mas[2].x);
- //std::cout << '\n' << alpha << ' ' << beta << '\n';
- out.push_back(abs(alpha - beta));
- }
- cout << fixed;
- cout.precision(12);
- for (int i = 0; i < out.size(); i++)
- {
- cout << out[i] << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement