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")
                        }
                }
        }
}

Python: def cross3(a, b, c):
    return (b[0] - a[0])*(c[1] - a[1]) - (b[1] - a[1])*(c[0] - a[0])
for line in open(0).readlines():
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split())
    p1 = (x1, y1); p2 = (x2, y2); p3 = (x3, y3); pp = (xp, yp)
    if cross3(p1, p2, p3) < 0:
        p1, p2 = p2, p1
    if cross3(p1, p2, pp) > 0 and cross3(p1, pp, p3) > 0 and cross3(p2, p3, pp) > 0:
        print("YES")
    else:
        print("NO")

Python: import sys

def isleft(ox, oy, ax, ay, px, py):
    oax, oay = ax - ox, ay - oy
    opx, opy = px - ox, py - oy
    if oax * opy > oay * opx:
        return 1
    else:
        return 0

for line in sys.stdin:
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split())
#    A, B, C, P = (x1, y1), (x2, y2), (x3, y3), (xp, yp)
#    if isleft(*A, *B, *P) == isleft(*B, *C, *P) == isleft(*C, *A, *P):
    if isleft(x1, y1, x2, y2, xp, yp) == isleft(x2, y2, x3, y3, xp, yp) == isleft(x3, y3, x1, y1, xp, yp):
        print("YES")
    else:
        print("NO")

Python: import math
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        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))
        cos = lambda a1,a2,b1,b2:(a1*b1+a2*b2)/((a1**2+a2**2)**0.5*(b1**2+b2**2)**0.5)
        if sum(math.acos(cos(x[i], y[i], x[i+1], y[i+1])) for i in range(3)) < 2 * math.pi:
            print('NO')
        else:
            print('YES')
    except:
        break

Python: if __name__ == '__main__':
	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: import numpy

while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        s1 = (x2-x1)*(yp-y1) - (y2-y1)*(xp-x1)
        s2 = (x3-x2)*(yp-y2) - (y3-y2)*(xp-x2)
        s3 = (x1-x3)*(yp-y3) - (y1-y3)*(xp-x3)
        if numpy.sign(s1) == numpy.sign(s2) and numpy.sign(s1) == numpy.sign(s3):
            print("YES")
        else:
            print("NO")
    except:
        break

Python: # -*- coding:utf-8 -*-

import sys
import math

def norm(x1,y1,x2,y2):
    r = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
    return r

def judge(x1,y1,x2,y2,x3,y3,xp,yp):
    r1 = norm(x1,y1,x2,y2)
    r2 = norm(x2,y2,x3,y3)
    r3 = norm(x3,y3,x1,y1)

    d1 = norm(xp,yp,x1,y1)
    d2 = norm(xp,yp,x2,y2)
    d3 = norm(xp,yp,x3,y3)

    if d1 > r1 or d1 > r3:
        print('NO')
    elif d2 > r1 or d2 > r2:
        print('NO')
    elif d3 > r3 or d3 > r2:
        print('NO')
    else:
        print('YES')

array = []
for i in sys.stdin:
    array.append(i)

for i in range(len(array)):
    tmp = array[i]
    x1,y1,x2,y2,x3,y3,xp,yp = map(float,tmp.split(' '))
    judge(x1,y1,x2,y2,x3,y3,xp,yp)

Python: import sys


def outer(vec_a, vec_b):
    return vec_a[0] * vec_b[1] - vec_a[1] * vec_b[0]

try:
    while True:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        vec_12 = [x2-x1, y2-y1]
        vec_23 = [x3-x2, y3-y2]
        vec_31 = [x1-x3, y1-y3]
        vec_1p = [xp-x1, yp-y1]
        vec_2p = [xp-x2, yp-y2]
        vec_3p = [xp-x3, yp-y3]
        if (outer(vec_12, vec_1p) > 0 and
                outer(vec_23, vec_2p) > 0 and
                outer(vec_31, vec_3p) > 0):
            print('YES')
        else:
            print('NO')

except:
    sys.exit()

Python: g=lambda a,b:a[0]*b[1]-a[1]*b[0]

while True:
    try:l=[float(i) for i in input().split()]
    except:break
    ba=[l[0]-l[2],l[1]-l[3]]
    ab=[-i for i in ba]
    cb=[l[2]-l[4],l[3]-l[5]]
    bc=[-i for i in cb]
    ca=[l[0]-l[4],l[1]-l[5]]
    ac=[-i for i in ca]
    ap=[l[6]-l[0],l[7]-l[1]]
    bp=[l[6]-l[2],l[7]-l[3]]
    cp=[l[6]-l[4],l[7]-l[5]]
    if g(ab,ac)<g(ab,ap) or g(ba,bc)<g(ba,bp):
        print("NO")
    else:
        print("YES")

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-5:
        print('YES')
    else:
        print('NO')

Python: def Cramer(a11, a12, a13, a21, a22, a23):
	den = a11 * a22 - a12 * a21
	return (a13 * a22 - a12 * a23) / den, (a11 * a23 - a13 * a21) / den

while True:
	try:
		x1, y1, x2, y2, x3, y3, xp, yp = [eval(item) for item in input().split()]
		u, v = Cramer(x3 - x1, x2 - x1, xp - x1, y3 - y1, y2 - y1, yp - y1)
		print('YES' if u >= 0.0 and v >= 0.0 and abs(u + v - 1.0) < 1e10 else '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, x2, x3, x1]
    y = [y1, y2, y3, y1]
    x = list(map(lambda i: i - xp, x))
    y = list(map(lambda i: i - yp, y))
    s = lambda a1, a2, b1, b2: abs(a1 * b2 - a2 * b1)
    sum = sum(s(x[i], y[i], x[i + 1], y[i + 1]) for i in range(3))
    S = s(x[1] - x[0], y[1] - y[0], x[2] - x[0], y[2] - y[0])
    if sum == S:
        print('YES')
    else:
        print('NO')

Python: if __name__ == '__main__':
    while True:
        try:
            x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
            ab = [x2-x1, y2-y1]
            bp = [xp-x2, yp-y2]
            bc = [x3-x2, y3-y2]
            cp = [xp-x3, yp-y3]
            ca = [x1-x3, y1-y3]
            ap = [xp-x1, yp-y1]
            c1 = ab[0]*bp[1] - ab[1]*bp[0]
            c2 = bc[0]*cp[1] - bc[1]*cp[0]
            c3 = ca[0]*ap[1] - ca[1]*ap[0]
            if (c1 > 0 and c2 > 0 and c3 > 0) or (c1 < 0 and c2 < 0 and c3 < 0):
                print("YES")
            else:
                print("NO")
        except EOFError:
            break