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: import math


class Triangle:
    def __init__(self, x1, y1, x2, y2, x3, y3):
        self.x1 = x1
        self.x2 = x2
        self.x3 = x3
        self.y1 = y1
        self.y2 = y2
        self.y3 = y3
        self.a = math.sqrt((x1-x2) ** 2 + (y1 - y2) ** 2)
        self.b = math.sqrt((x2-x3) ** 2 + (y2 - y3) ** 2)
        self.c = math.sqrt((x1-x3) ** 2 + (y1 - y3) ** 2)

    def get_acos_a(self):
        val = (-self.a ** 2 + self.b ** 2 + self.c ** 2) / (2 * self.b * self.c)
        return math.acos(val)


while(1):

    try:
        x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, input().split()))
        t1 = Triangle(x1, y1, x2, y2, xp, yp)
        t2 = Triangle(x2, y2, x3, y3, xp, yp)
        t3 = Triangle(x3, y3, x1, y1, xp, yp)

        def is_2pi(x):
            return math.fabs(x - math.pi*2) < 1.0e-10

        if is_2pi(t1.get_acos_a() + t2.get_acos_a() + t3.get_acos_a()):
            print("YES")
        else:
            print("NO")

    except:
        break

Python: import sys
def calc(x, y, xp, yp):
    a = [(y[i] - y[i -1]) * (xp - x[i]) - (x[i] - x[i - 1]) * (yp - y[i]) for i in range(3)]
    print("YES" if (a[0] > 0 and a[1] > 0 and a[2] > 0) or (a[0] < 0 and a[1] < 0 and a[2] < 0) else "NO")
for s in sys.stdin:
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, s.split())
    x = [x1, x2, x3]
    y = [y1, y2, y3]
    calc(x, y, xp, yp)

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

while True:
    try:t=input()
    except:break
    l=[float(i) for i in t.split()]
    b=[g(l[0:2],l[2:4],l[6:8]),g(l[2:4],l[4:6],l[6:8]),g(l[4:6],l[0:2],l[6:8])]
    if len([i for i in b if i>0])==3 or len([i for i in b if i<0])==3:
        print("YES")
    else:
        print("NO")

Python: import sys
def f(h,i,j,k):
 z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0]
for e in sys.stdin:
 p,q,r,s,t,u,x,y=map(float,e.split())
 print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])

Python: import sys
def f(h,i,j,k):
 z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0]
for e in sys.stdin:
 p,q,r,s,t,u,x,y=map(float,e.split())
 g=[p,q,r,s,t,u]
 print(['NO','YES'][f(*g[:4])==f(*g[2:6])==f(*g[4:],*g[:2])])

Python: import sys

lines = str(sys.stdin.read()).strip().split("\n")
for line in lines:
	data = line.split(" ")
	x1 = data[0]
	y1 = data[1]
	x2 = data[2]
	y2 = data[3]
	x3 = data[4]
	y3 = data[5]
	xp = data[6]
	yp = data[7]
	if xp > min(x1, x2, x3) and xp < max(x1, x2, x3) and yp > min(y1, y2, y3) and yp < max(y1, y2, y3):
		print("YES")
	else:
		print("NO")

Python: 
x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()]

x_vector_1to2=x2-x1;
y_vector_1to2=y2-y1;
x_vector_1to3=x3-x1;
y_vector_1to3=y3-y1;
x_vector_p=xp-x1;
y_vector_p=yp-y1;

def renritu(p,q,r,s,t,u):  # renritu(p,q,r,s,t,u) px + qy = r  sx+ty=u
    a=p; b=q; c=r; d=s; e=t; f=u;
    a1=a*d; b1=b*d; c1=c*d; d1=d*a; e1=e*a; f1=f*a;
    res_y=b1-e1;
    if res_y != 0 :
        res_y =(c1-f1)/res_y;
        res_x =(c-b*res_y)/a;
        return(res_x,res_y)
    else:
        return(-1,-1)
    
res=renritu(x_vector_1to2,x_vector_1to3,x_vector_p,y_vector_1to2,y_vector_1to3,y_vector_p)
if res[0] >=0 and res[1] >=0 and res[0]+res[1]<1:
    print("YES")
else:
    print("NO")

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

Python: import sys

def crossMulti(p1, p2):
    return p1[0] * p2[1] - p1[1] * p2[0]
           
lines = sys.stdin.readlines()
for line in lines:
    Zd = []
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split())
    Ps = [(x2-x1, y2-y1),(x3-x2, y3-y2),(x1-x3, y1-y3)]
    Px = [(xp-x1, yp-y1),(xp-x2, yp-y2),(xp-x3, yp-y3)]
    for p in range(3):
        Zd.append(crossMulti(Ps[p], Px[p]))
    Zd = [x > 0 for x in Zd]

    if (Zd[0] and Zd[1] and Zd[2]) or not(Zd[0] or Zd[1] or Zd[2]):
        print('Yes')
    else:
        print('No')

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')
        elif (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: 
x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()]

x_vector_1to2=x2-x1;
y_vector_1to2=y2-y1;
x_vector_1to3=x3-x1;
y_vector_1to3=y3-y1;
x_vector_p=xp-x1;
y_vector_p=yp-y1;

def renritu(p,q,r,s,t,u):  # renritu(p,q,r,s,t,u) px + qy = r  sx+ty=u
    a=p; b=q; c=r; d=s; e=t; f=u;
    a1=a*d; b1=b*d; c1=c*d; d1=d*a; e1=e*a; f1=f*a;
    res_y=b1-e1;
    if res_y != 0 :
        res_y =(c1-f1)/res_y;
        res_x =(c-b*res_y)/a;
        return(res_x,res_y)
    else:
        res_x=c/a;
        return(res_x,0)
    
res=renritu(x_vector_1to2,x_vector_1to3,x_vector_p,y_vector_1to2,y_vector_1to3,y_vector_p)
if res[0] >0 and res[1] >0 and res[0]+res[1]<1:
    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)) < math.pi:
            print('NO')
        else:
            print('YES')
    except:
        break

Python: import sys

lines = str(sys.stdin.read()).strip().split("\n")
for line in lines:
	data = line.split(" ")
	x1 = float(data[0])
	y1 = float(data[1])
	x2 = float(data[2])
	y2 = float(data[3])
	x3 = float(data[4])
	y3 = float(data[5])
	xp = float(data[6])
	yp = float(data[7])
	if xp > min(x1, x2, x3) and xp < max(x1, x2, x3) and yp > min(y1, y2, y3) and yp < max(y1, y2, y3):
		print("YES")
	else:
		print("NO")

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

while True:
    try:t=input()
    except:break
    l=[float(i) for i in t.split()]
    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) or g(ca,cb)<g(ca,cp):
        print("NO")
    else:
        print("YES")