Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct point{
- double x,y;
- } A, B, C, D;
- double s1, s2, s3, s;
- double sqr(double x) {
- return x*x;
- }
- double dist(point A, point B){
- return sqrt(sqr(B.x-A.x)+sqr(B.y-A.y));
- }
- double tr(point A, point B, point C){
- double a,b,c,p;
- a=dist(A,B);
- b=dist(B,C);
- c=dist(A,C);
- p=(a+b+c)/2;
- return sqrt(p*(p-a)*(p-b)*(p-c));
- }
- int main()
- {
- cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y >> D.x >> D.y;
- s=tr(A,B,C);
- s1=tr(A,B,D);
- s2=tr(B,C,D);
- s3=tr(A,C,D);
- cout << ((s>s1+s2+s3-0.0001)?"In":"Out");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement