SHARE
TWEET

Untitled

a guest Oct 15th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define _USE_MATH_DEFINES
  2.  
  3. #include <iostream>
  4. #include <vector>
  5. #include <algorithm>
  6. #include <map>
  7. #include <set>
  8. #include <string>
  9. #include <algorithm>
  10. #include <cmath>
  11. #include <queue>
  12. #include <stack>
  13. #include <numeric>
  14. #include <random>
  15. #include <ctime>
  16. #include <tuple>
  17.  
  18. using namespace std;
  19. //#define int long long
  20. double EPS = 1e-6;
  21.  
  22. struct Point{
  23.     double x, y;
  24.     Point(double a, double b){
  25.         x = a;
  26.         y = b;
  27.     }
  28.     bool operator ==(const Point &p) const{
  29.         return abs(p.x - x) < EPS && abs(p.y - y) < EPS;
  30.     }
  31. };
  32.  
  33. double cross_prod(Point a, Point b){
  34.     return a.x*b.y -a.y*b.x;
  35. }
  36.  
  37. double dot_prod(Point a, Point b){
  38.     return a.x*b.x + a.y*b.y;
  39. }
  40.  
  41. Point get_vec(Point a, Point b){
  42.     return Point(b.x - a.x, b.y - a.y);
  43. }
  44.  
  45. double getang(Point u, Point v){
  46.     return atan2(cross_prod(u, v), dot_prod(u, v));
  47. }
  48.  
  49. bool c_p(Point a, Point b, Point c){
  50.     Point t1 = get_vec(b, a), t2 = get_vec(b, c);
  51.     return abs(cross_prod(t1, t2)) < EPS;
  52. }
  53.  
  54. bool between(Point a, Point b, Point c){
  55.     Point u = get_vec(b, a), v = get_vec(b, c);
  56.     return dot_prod(u, v) < EPS;
  57. }
  58.  
  59.  
  60. signed main() {
  61. #ifdef LOCAL
  62.     freopen("in", "r", stdin);
  63.     freopen("out", "w", stdout);
  64. #endif
  65.     int n, m, k;
  66.     cin >> n >> m >> k;
  67. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top