Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Python: while True :
    try :
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        
        # 三角形の回転方向で判定する
        # 三角形PAB, PBC, PCAの回転が全て同じならば、
        # 点Pは三角形ABC内に存在する
        # 三角形ABCの回転の方向は、
        # x1(y2 - y3) + x2(y3 - y1) + x3(y1 - y2)
        # の符号で判断できる
        # 正なら左周り、負なら右回り
        
        a = xp * (y1 - y2) + x1 * (y2 - yp) + x2 * (yp - y1)
        b = xp * (y2 - y3) + x2 * (y3 - yp) + x3 * (yp - y2)
        c = xp * (y3 - y1) + x3 * (y1 - yp) + x1 * (yp - y3)
            
        if((a < 0 and b < 0 and c < 0) or (a > 0 and b > 0 and c > 0)) :
            print("YES")
        else :
            print("NO")
            
    except :
        break

Python: import math
def helon(x1, y1, x2, y2, x3, y3):
    a = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
    b = math.sqrt((x3 - x2)**2 + (y3 - y2)**2)
    c = math.sqrt((x1 - x3)**2 + (y1 - y3)**2)
    s = (a + b + c) / 2
    return(math.sqrt(s * (s - a) * (s - b) * (s - c)))
    
while(True):
    try:
        input = map(float, raw_input().split())
        S = []
        S.append(helon(input[0], input[1], input[2], input[3], input[4], input[5]))
        S.append(helon(input[0], input[1], input[2], input[3], input[6], input[7]))
        S.append(helon(input[0], input[1], input[4], input[5], input[6], input[7]))
        S.append(helon(input[2], input[3], input[4], input[5], input[6], input[7]))
        if(math.fabs(S[0] - S[1] - S[2] - S[3]) < 1e-7):
            print("YES")
        else:
            print("NO")
    except Exception:
        break

C++: #include <iostream>
using namespace std;
double x[4],y[4],px,py,ax,ay,bx,by;
int main()
{
	while(true)
	{
		for(int i = 1;i<=3;i++){cin >> x[i];cin >> y[i];}
		if(cin.eof())break;
		cin >> px;
		cin >> py;
		double m,n;
		ax = x[2]-x[1];
		ay = y[2]-y[1];
		bx = x[3]-x[1];
		by = y[3]-y[1];
		double det = ax*by-ay*bx;
		m = (by*px-bx*py)/det;
		n = (-ay*px+ax*py)/det;
		if(m>0 && m <1&& n > 0 && n < 1&& (m+n) < 1) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

class Point {
public:
  double x, y;
  Point(double x=0, double y=0) : x(x), y(y) {}
  Point operator -(Point p) {
    return Point(x-p.x, y-p.y);
  }
};
typedef Point Vector;

double cross(Vector a, Vector b) {
  return a.x*b.y - a.y*b.x;
}
Point p[3];
Point q;

bool solve() {
  int dir;
  double tmp;
  for(int i = 0; i < 3; i++) {
    int a = i;
    int b = (i+1)%3;

    tmp = cross(p[b]-p[a], q-p[a]);
    if(i == 0) {
      if(tmp > 0) dir = 1;
      else        dir = -1;
    } else {
      switch(dir) {
      case 1:
	if(!(tmp > 0)) return false;
	break;
      case -1:
	if(!(tmp < 0)) return false;
	break;
      }
    }
  }
  return true;
}

int main() {
  bool loop = true;
  while(1) {
    for(int i = 0; i < 3; i++) {
      cin >> p[i].x >> p[i].y;
      if(cin.eof()) {
	loop = false;
	break;
      }
    }
    if(!loop) break;
    cin >> q.x >> q.y;

    if(solve()) 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=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    b=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
    c=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
    if(a>x&&b>x&&c>x&&y<a&&y<b&&y<c){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef ostringstream OSS; typedef istringstream ISS;
typedef long long LL;
typedef pair<int, int> PII;  typedef pair<LL, LL> PLL;
typedef vector<int>    VI;   typedef vector<VI>   VVI;   typedef vector<VVI>   VVVI;
typedef vector<LL>     VLL;  typedef vector<VLL>  VVLL;  typedef vector<VVLL>  VVVLL;
typedef vector<double> VD;   typedef vector<VD>   VVD;   typedef vector<VVD>   VVVD;
typedef vector<string> VS;   typedef vector<VS>   VVS;   typedef vector<VVS>   VVVS;
typedef vector<bool>   VB;   typedef vector<VB>   VVB;   typedef vector<VVB>   VVVB;
typedef vector<PII>    VPII; typedef vector<VPII> VVPII; typedef vector<VVPII> VVVPII;
typedef vector<PLL>    VPLL; typedef vector<VPLL> VVPLL; typedef vector<VVPLL> VVVPLL;

typedef unsigned int  UI;
typedef vector<UI>    VUI;
typedef vector<VUI>   VVUI;

#define fst first
#define snd second
// #define Y first
// #define X second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x)  (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define MAXUD(orig, target) orig = max(orig, target)
#define MINUD(orig, target) orig = min(orig, target)
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a)   { OSS oss; oss << a; return oss.str(); };

template<typename T=int> inline void dump(vector<T> vs, bool ent=false) { rep(i, vs.size()) cout << vs[i] << (i+1==vs.size() ? '\n' : ' '); if (ent) cout << endl; }
template<typename T = int> inline void dump(vector<vector<T>> vs, bool ent = false) { rep(i, vs.size()) dump<T>(vs[i]); if (ent) cout << endl; }

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int    DX[] = {1,  0, -1, 0};
const int    DY[] = {0, -1,  0, 1};
const double EPS  = 1e-12;
// const double PI   = acos(-1.0);
// lambda: [](T1 x)->T2{return y;}
// simple lambda: [](T x){return x;}

#define X real()
#define Y imag()

typedef complex<double> P;

// a = b
bool eq(double a, double b) {
    return abs(a - b) < EPS;
}

// ?????¢
double distPP(P a, P b) {
    return abs(a - b);
}

// ??????????????¬???
double heron(double a, double b, double c) {
    double s = (a + b + c) / 2.;
    return sqrt(s * (s - a) * (s - b) * (s - c));
}

double heron(P a, P b, P c) {
    return heron(distPP(a, b), distPP(b, c), distPP(c, a));
}

// ????§???¢??¨??????????????????
bool inTriangle(P a, P b, P c, P p) {
    double s1 = heron(a, b, c);
    double s2 = heron(p, b, c) + heron(a, p, c) + heron(a, b, p);
    return eq(s1, s2);
}

int main(void) {
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        P a(x1, y1);
        P b(x2, y2);
        P c(x3, y3);
        P p(xp, yp);
        cout << (inTriangle(a, b, c, p) ? "YES" : "NO") << endl;
    }


    return 0;
}