Advertisement
Raslboyy

440

Mar 29th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. //#pragma GCC optimize("O3")
  4. //#pragma GCC optimize("unroll-loops")
  5.  
  6. #define mp make_pair
  7. #define pb push_back
  8. #define eb emplace_back
  9. #define x first
  10. #define y second
  11. #define sz(x) (int)x.size()
  12. #define all(x) begin(x), end(x)
  13. #define rall(x) rbegin(x), rend(x)
  14. #define FOR(i,a,b) for (int i = (a); i < (b); i++)
  15. #define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
  16.  
  17. using namespace std;
  18.  
  19. typedef unsigned long long ull;
  20. typedef long long ll;
  21. typedef long double ld;
  22. typedef pair<int, int> pi;
  23. typedef pair<ld, ld> pld;
  24. typedef pair<ll, ll> pl;
  25. typedef vector<int> veci;
  26. typedef vector<bool> vecb;
  27. typedef vector<vector<int>> vvi;
  28. typedef vector<vector<bool>> vvb;
  29.  
  30. const int INF_I = 1e9;
  31. const ll INF_LL = 1e18;
  32. const int MOD = 1000000007;
  33. const double eps = 1e-6;
  34.  
  35. int main() {
  36.  
  37.     ios::sync_with_stdio(false);
  38.     cin.tie(nullptr);
  39.     cout.tie(nullptr);
  40.  
  41.     pld a, b, c;
  42.     cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
  43.     pld ab = {b.x-a.x, b.y-a.y};
  44.     pld ac = {c.x-a.x, c.y-a.y};
  45.     pld ch = {-ab.y, ab.x};
  46.     pld bh = {-ac.y, ac.x};
  47.     pld c1 = {c.x+ch.x, c.y+ch.y};
  48.     pld b1 = {b.x+bh.x, b.y+bh.y};
  49.     ld A1 = c.y-c1.y;
  50.     ld B1 = c1.x-c.x;
  51.     ld C1 = -(A1*c.x + B1*c.y);
  52.     ld A2 = b.y-b1.y;
  53.     ld B2 = b1.x-b.x;
  54.     ld C2 = -(A2*b.x+B2*b.y);
  55.     ld xx = -ld(C1*B2-C2*B1)/(A1*B2-A2*B1);
  56.     ld yy = -ld(A1*C2-A2*C1)/(A1*B2-A2*B1);
  57.     cout << fixed << xx << " " << yy << endl;
  58.  
  59.     return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement