Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. struct Point {
  4.     int x, y;
  5.     Point() {}
  6. };
  7. struct GeomitryVector {
  8.     int x, y;
  9.     GeomitryVector() {}
  10.     GeomitryVector(Point A, Point B) {
  11.         x = A.x - B.x;
  12.         y = A.y - B.y;
  13.     }
  14.     int operator * (GeomitryVector &A) {
  15.         return x * A.y - A.x * y;
  16.     }
  17. };
  18. bool checkPoint(Point a, Point b, Point c, Point d) {
  19.     GeomitryVector f(a, b);
  20.     GeomitryVector s(a, c);
  21.     GeomitryVector t(a, d);
  22.     return((f*s < 0 && f*t < 0) || (f*s > 0 && f*t > 0));
  23. }
  24. int main() {
  25.     Point a, b, c, d;
  26.     cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y;
  27.     if (checkPoint(a, b, c, d)) cout << "Yes";
  28.     else cout << "No";
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement