Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

template <typename T>
double angle(pair<T, T> a, pair<T, T> b) {
    double costheta = (a.first*b.first + a.second*b.second)/(sqrt(a.first*a.first+a.second*a.second)*sqrt(b.first*b.first+b.second*b.second));
    double ang = acos(costheta);
    while (ang >= M_PI) {
        ang -= M_PI;
    }
    return ang;
}

template <typename T>
double norm(pair<T, T> a) {
    return sqrt(a.first*a.first + a.second*a.second);
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    vector<string> anslist;

    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        pair<double, double> a, b, p;
        a.first = x2 - x1;
        a.second = y2 - y1;
        b.first = x3 - x1;
        b.second = y3 - y1;
        p.first = xp - x1;
        p.second = yp - y1;
        double theta = angle(a, b);
        double phi = angle(a, p);
        double psi = angle(b, p);
        
        if (norm(p) > norm(a) || norm(p) > norm(b)) {
            anslist.push_back("NO");
            break;
        }
        if (phi > theta || psi > theta) {
            anslist.push_back("NO");
            break;
        }
        anslist.push_back("YES");
    }

    for(auto ans : anslist) {
        cout << ans << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<vector>
int main()
{
	std::vector<bool>result;
	for (double x1, y1, x2, y2, x3, y3, xp, yp; std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;)
	{
		double k = ((x2 - x3)*(y3 - y1) - (x3 - x1)*(y2 - y3)) / ((x2 - x3)*(yp - y1) - (xp - x1)*(y2 - y3));
		double s = ((x1 - x3)*(yp - y1) - (xp - x1)*(y1 - y3)) / ((x2 - x3)*(yp - y1) - (xp - x1)*(y2 - y3));
		result.push_back(1 < k && 0 < s && s < 1);
	}
	for (auto i : result)
	{
		std::cout << (i ? "YES" : "NO") << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

double calcSide(double a, double b, double l, double m){
  double side;
  double x, y;
  x = fabs(l - a);
  y = fabs(m - b);
  side = sqrt(x * x + y * y);
  return side;
}

double calcArea(double AB, double AC, double BC){
  double Area;
  double s = (AB + AC + BC) / 2;
  Area = sqrt(s * (s - AB) * (s - AC) * (s - BC));
  return Area;
}

int main(){
  double ax, ay, bx, by, cx, cy, px, py;;
  double ABC, APB, APC, BPC;
  double AB, AC, BC, AP, BP, CP;
  
  while(cin >> ax >> ay >> bx >> by >> cx >> cy >> px >> py){
    
    AB = calcSide(ax, ay, bx, by);
    AC = calcSide(ax, ay, cx, cy);
    BC = calcSide(bx, by, cx, cy);

    AP = calcSide(ax, ay, px, py);
    BP = calcSide(bx, by, px, py);
    CP = calcSide(cx, cy, px, py);

    ABC = calcArea(AB, AC, BC);
    APB = calcArea(AP, AB, BP);
    APC = calcArea(AP, AC, CP);
    BPC = calcArea(BP, BC, CP);

    if(fabs(APB + APC + BPC - ABC) < 0.000000001) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
  double x1,x2,x3,y1,y2,y3,x,y;
  double a,b,c,s,ans;
  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&x2,&x3,&y1,&y2,&y3,&x,&y)!=EOF){
    a=x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
    b=x*(y-y1)+x1*(y1-y2)+x2*(y2-y);
    c=x*(y-y2)+x2*(y2-y3)+x3*(y3-y);
    s=x*(y-y3)+x3*(y3-y1)+x1*(y1-y);
    if(a<b && a<c && a<s || a>b && a>c && a>s){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<complex>
using namespace std;
typedef complex<double> xy_t;
double x[4],y[4];
xy_t d[4];
double a[3]; 
double cross_product(xy_t a,xy_t b){
  return (conj(a)*b).imag();
}
int main(){
  while(1){
    for(int i=0;i<4;i++)cin>>x[i]>>y[i];
    if(!cin)break;
    for(int i=0;i<4;i++)d[i]=xy_t(x[i],y[i]);
    for(int i=0;i<3;i++){
      a[i]=cross_product(d[3]-d[i],d[3]-d[(i+1)%3]);
    }
    if(a[0]<0&&a[1]<0&&a[2]<0){
      cout<<"YES"<<endl;
    }else if(a[0]>0&&a[1]>0&&a[2]>0){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cstdio>

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 1000000007


double vector_2nd(double a,double b){

    return b-a;
}



int main(){

    //A(x1,y1) B(x2,y2) C(x3,y3) P(xp,yp)
    double x1,x2,x3,xp,y1,y2,y3,yp;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
        double CA_X,CA_Y;
        double AP_X,AP_Y;
        double BC_X,BC_Y;
        double CP_X,CP_Y;
        double AB_X,AB_Y;
        double BP_X,BP_Y;
        CA_X = vector_2nd(x1,x3);
        CA_Y = vector_2nd(y1,y3);
        AP_X = vector_2nd(xp,x1);
        AP_Y = vector_2nd(yp,y1);
        BC_X = vector_2nd(x3,x2);
        BC_Y = vector_2nd(y3,y2);
        CP_X = vector_2nd(xp,x3);
        CP_Y = vector_2nd(yp,y3);
        AB_X = vector_2nd(x2,x1);
        AB_Y = vector_2nd(y2,y1);
        BP_X = vector_2nd(xp,x2);
        BP_Y = vector_2nd(yp,y2);

        double outer_product_1 = CA_X*AP_Y-CA_Y*AP_X;
        double outer_product_2 = BC_X*CP_Y-BC_Y*CP_X;
        double outer_product_3 = AB_X*BP_Y-AB_Y*BP_X;

        if((outer_product_1 > 0 && outer_product_2 > 0 && outer_product_3 > 0) || (outer_product_1 < 0 && outer_product_2 < 0 && outer_product_3 < 0)){

            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }




        




    }
    return 0;
}