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: # coding: utf-8

while True:
	try:
		x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split())
#		print(x1)
#		print(x2)
#		print(x3)
#		print(y1)
#		print(y2)
#		print(y3)

		xg = 1./3 * (x1 + x2 + x3)
		yg = 1./3 * (y1 + y2 + y3)
#		print("xg = {:}, yg = {:}".format(xg, yg))
		
		def line(xi, yi, xj, yj, x, y):
			return (yi-yj)*x/(xi-xj) + (xi*yj-xj*yi)/(xi-xj)
		
		if x1 != x2:
			def line12(x, y):
				if y < line(x1, y1, x2, y2, x, y):
#					print("2")
					return 2
				elif y > line(x1, y1, x2, y2, x, y):
#					print("3")
					return 3
				else:
#					print("0")
					return 0
		else:
			def line12(x, y):
				if x1 < x:
#					print("2")
					return 2
				elif x1 > x:
#					print("3")
					return 3
				else:
#					print("0")
					return 0

		if x2 != x3:
			def line23(x, y):
				if y < line(x2, y2, x3, y3, x, y):
#					print("5")
					return 5
				elif y > line(x2, y2, x3, y3, x, y):
#					print("7")
					return 7
				else:
#					print("0")
					return 0
		else:
			def line23(x, y):
				if x2 < x:
#					print("5")
					return 5
				elif x2 > x:
#					print("7")
					return 7
				else:
#					print("0")
					return 0

		if x1 != x3:
			def line13(x, y):
				if y < line(x1, y1, x3, y3, x, y):
#					print("11")
					return 11
				elif y > line(x1, y1, x3, y3, x, y):
#					print("13")
					return 13
				else:
#					print("0")
					return 0
		else:
			def line13(x, y):
				if x1 < x:
#					print("11")
					return 11
				elif x1 > x:
#					print("13")
					return 13
				else:
#					print("0")
					return 0

		if line12(xp, yp)*line23(xp, yp)*line13(xp, yp) == line12(xg, yg)*line23(xg, yg)*line13(xg, yg):
			print("YES")
		else:
			print("NO")

	except EOFError:
		break

Python: import math
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
    except:
        break
    x = [x1, x3, x3, x1]
    y = [y1, y2, y3, y1]
    x = list(map(lambda x: x - xp, x))
    y = list(map(lambda y: y - yp, y))
    s = lambda a1, a2, b1, b2: abs(a1 * b2 - a2 * b1)
    if abs(sum(s(x[i], y[i], x[i + 1], y[i + 1]) for i in range(3)) - s(x[1] - x[0], y[1] - y[0], x[2] - x[0], y[2] - y[0])) < 1e-15:
        print('YES')
    else:
        print('NO')

Python: global r

def checker(x1,y1,x2,y2,xp,yp):
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		return 1
	elif vec < 0:
		return -1

while True:
	try:
		x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
		r = 0
		r = r + checker(x1,y1,x2,y2,xp,yp)
		r = r + checker(x2, y2, x3, y3, xp, yp)
		r = r + checker(x3, y3, x1, y1, xp, yp)
		if r == 3 or r == -3:
			print("YES")
		else:
			print("NO")
	except EOFError:
		break

Python: # coding: utf-8

def linecheck(x1, y1, x2, y2, xp, yp):
	if yp - y1 > (xp - x1) * (y2 - y1) / (x2 - x1):
		return 1
	elif yp - y1 < (xp - x1) * (y2 - y1) / (x2 - x1):
		return -1

while True:
	try:
		x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split())

		if x1 == x2:
			if (x1 < xp and xp < x3) or (x1 > xp and xp > x3):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x3, y3, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		elif x2 == x3:
			if (x1 < xp and xp < x3) or (x1 > xp and xp > x3):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x1, y1, x3, y3, xp, yp)
		elif x3 == x1:
			if (x1 < xp and xp < x2) or (x1 > xp and xp > x2):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		else:
			judge = linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x1, y1, x3, y3, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)

		if judge > 0:
			print("YES")
		elif judge < 0:
			print("NO")

	except EOFError:
		break

Python: import sys

def tri(x1,x2,y1,y2,z1,z2,p1,p2):
    a = (x1 - y1) * (y2 - p2) - (y1 - p1) * (x2 - y2)
    b = (y1 - z1) * (z2 - p2) - (z1 - p1) * (y2 - z2)
    c = (z1 - x1) * (x2 - p2) - (x1 - p1) * (z2 - x2)
    if(((a < 0) & (b < 0) & (c < 0)) | ((a > 0) & (b > 0) & (c > 0))):
        return 'YES'
    return 'NO'

ans = []
for i in sys.stdin:
    ans.append(tri(*map(float,i.split())))
print('\n'.join(map(str,ans)))

Python: def r(a, b, c, d, e, f):
    return a * (d-f) + c * (f-b) + e * (b-d) > 0
  
while True:
    try: line = list(map(float, input().split()))
    except: break
      
    x1, y1, x2, y2, x3, y3, xp, yp = line
    abc = r(x1, y1, x2, y2, x3, y3)
    pab = r(xp, yp, x1, y1, x2, y2)
    pbc = r(xp, yp, x2, y2, x3, y3)
    pca = r(xp, yp, x3, y3, x1, y1)
  
    print('YES' if abc == pab == pbc == pca else 'NO')

Python: try:
    while True:
        P= list(map(float,input().split()))
        a, b, c, q = [complex(P[i*2],P[i*2+1]) for i in range(4)]
        x,y,z= a-q,b-q,c-q
        xx= (x.conjugate()*y).imag
        yy= (y.conjugate()*z).imag
        zz= (z.conjugate()*x).imag
        if (xx>0 and yy>0 and zz>0) or (xx<0 and yy<0 and zz<0):
            print("YES")
        else:
            print("NO")
except EOFError: 
    pass

Python: while True:
    try:
        x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
        r = 0
        vec = (x2-x1) * (yp-y1) - (y2-y1) * (xp-x1)
        if vec > 0:
            r += 1
        elif vec < 0:
            r -= 1
        vec = (x3-x2) * (yp-y2) - (y3-y2) * (xp-x2)
        if vec > 0:
            r += 1
        elif vec < 0:
            r -= 1
        vec = (x1-x3) * (yp-y3) - (y1-y3) * (xp-x3)
        if vec > 0:
            r += 1
        elif vec < 0:
            r -= 1
        if r == 3 or r == -3:
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

Python: from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin
from operator import attrgetter
from collections import namedtuple

Point = namedtuple('Point', 'x y')

def linear(p1, p2):
    gradient = (p1.y - p2.y) / (p1.x - p2.x)
    y_intercept = p1.y - gradient * p1.x
    return lambda x: gradient * x + y_intercept

def takeout(seq):
    gen = (Point(next(seq), next(seq)) for _ in xrange(3))
    for p in sorted(gen, key=attrgetter('x')):
        yield p
    yield Point(next(seq), next(seq))

for line in stdin:
    A, B, C, P = takeout(float(s) for s in line.split())

    if A.x == B.x or B.x <= P.x <= C.x:
        L = (linear(B, C), linear(A, C))
    elif B.x == C.x or A.x <= P.x <= B.x:
        L = (linear(A, B), linear(A, C))
    else:
        print('NO')
        continue

    y1, y2 = sorted(f(P.x) for f in L)
    if y1 < P.y < y2:
        print('YES')
    else:
        print('NO')