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 sys

def to_f(e):
  return float(e)

while True:
  line = sys.stdin.readline()
  if not line: break
  x1, y1, x2, y2, x3, y3, xp, yp = map(to_f, line.split(" "))
  a = (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)
  b = (xp-x1)*(y3-y1)-(x3-x1)*(yp-y1)
  c = (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)
  s = b/a
  t = c/a
  if s>0 and t>0 and 0<s+t and s+t<1:
    print("YES")
  else:
    print("NO")

Python: import sys
def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0
 
for s in sys.stdin:
  x = map(float, s.split())
  p1 = x[0:2]
  p2 = x[2:4]
  p3 = x[4:6]
  p0 = x[6:]
  print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0))]

Python: import math
lm=lambda x,y,xa,ya,xb,yb:abs((yb-ya)/(xb-xa)*xa+xa - y + (yb-ya)/(xb-xa)*x) / math.hypot((yb-ya)/(xb-xa),-1) if (xb-xa)!=0 else abs(x-xb)
while True:
    r=input()
    if r=="":break
    x1,y1,x2,y2,x3,y3,xp,yp=[float(i) for i in r.split()]
    if lm(x1,y1,x2,y2,x3,y3)<lm(xp,yp,x2,y2,x3,y3) or lm(x2,y2,x1,y1,x3,y3)<lm(xp,yp,x1,y1,x3,y3) or lm(x3,y3,x1,y1,x2,y2)<lm(xp,yp,x1,y1,x2,y2):
        print("NO")
    else:
        print("YES")

Python: def cross_product(a,b):
  return (a.conjugate()*b).imag
try:
    while True:
        P = list(map(float,input().split()))
        a, b, c, p = [complex(P[i*2],P[i*2+1]) for i in range(4)]
        S = cross_product(p-a,p-b)
        T = cross_product(p-b,p-c)
        U = cross_product(p-c,p-a)
        if S*T > 0 and T*U >0:
            print('YES')
        else:
            print('NO')
except EOFError:
    pass

Python: # ????§???¢???????????????????????????sgn?????????

from sys import stdin
for line in stdin:
    x1,y1,x2,y2,x3,y3,xp,yp = [float(i) for i in line.split()]
    ab_cross_ap = (x2-x1)*(y1-yp)-(y2-y1)*(x1-xp)
    bc_cross_bp = (x3-x2)*(y2-yp)-(y3-y2)*(x2-xp)
    ca_cross_cp = (x1-x3)*(y3-yp)-(y1-y3)*(x3-xp)
    if ab_cross_ap < 0 and bc_cross_bp < 0 and ca_cross_cp:
        print("YES")
    else:
        print("NO")

Python: def f(x):
    x1, y1, x2, y2, x3, y3, xp, yp = x
    if not x2 == x1:
        a1 = ((y2 - y1) / (x2 - x1)) * (xp -x1) + y1
    else:
        a1 = x1
    if not x3 == x1:
        a2 = ((y3 - y1) / (x3 - x1)) * (xp - x1) + y1
    else:
        a2 = x1
    if not x3 == x2:
        a3 = ((y3 - y2) / (x3 - x2)) * (xp - x2) + y2
    else:
        a3 = x2

    if (yp > a1 and yp < a2 and yp < a3) or (yp < a1 and yp > a2 and yp < a3) or (yp < a1 and yp < a2 and yp > a3):
        print('YES')
    else:
        print('NO')
while True:
    try:
        point = list(map(float, input().split()))
        f(point)
    except EOFError:
        break

Python: def cross_product(a, b):
    ax, ay = a
    bx, by = b
    return ax * by - ay * bx


def sub(a, b):
    a1, a2 = a
    b1, b2 = b
    return b1 - a1, b2 - a2


def judge(p1, p2, p3, pp):
    for a, b in ((p1, p2), (p2, p3), (p3, p1)):
        vec1 = sub(a, b)
        vec2 = sub(a, pp)
        if cross_product(vec2, vec1) >= 0:
            print("NO")
            return
    print("YES")


if __name__ == '__main__':
    inputs = [float(s) for s in input().split()]
    p1 = (inputs.pop(0), inputs.pop(0))
    p2 = (inputs.pop(0), inputs.pop(0))
    p3 = (inputs.pop(0), inputs.pop(0))
    pp = (inputs.pop(0), inputs.pop(0))

    judge(p1, p2, p3, pp)

Python: # A Point in a Triangle
import math
def simul_eq(a,b,c,d,e,f):
    # A = [[a,b],[d,e]]
    C = [c,f]
    detA = a*e - b*d
    # if detA == 0: raise # det(A) == 0.
    At = [[e,-b],[-d,a]]
    x = sum(map((lambda x,y: x*y), At[0], C)) / detA
    y = sum(map((lambda x,y: x*y), At[1], C)) / detA
    return (x,y)
ss = input().split()
while 1:
    x1,y1,x2,y2,x3,y3,xp,yp = map(float,ss)
    s,t = simul_eq(x2-x1, x3-x1, xp-x1, y2-y1, y3-y1, yp-y1)
    if 0 < s < 1 and 0 < t < 1 and 0 < s + t < 1:
        print('YES')
    else:
        print('NO')
    try: ss = input().split()
    except EOFError: break

Python: def tri(x1, y1, x2, y2, x3, y3):
    return abs((x2-x1)*(y3-y1) - (y2-y1)*(x3-x1)) / 2
 
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
    except:
        break
    abc = tri(x1, y1, x2, y2, x3, y3)
    abp = tri(x1, y1, x2, y2, xp, yp)
    acp = tri(x1, y1, x3, y3, xp, yp)
    bcp = tri(x2, y2, x3, y3, xp, yp)
    x, y = int(abc*pow(10, 5)), int((abp+acp+bcp)*pow(10, 5))
    print("YES" if x >= y else "NO")

Python: # coding=utf-8


def direction_vector(p1: list, p2: list)->list:
    return [p2[0]-p1[0], p2[1]-p1[1]]


def cross_product(v1: list, v2: list)->float:
    return v1[0]*v2[1] - v1[1]*v2[0]


if __name__ == '__main__':
    while True:
        try:
            points_receive = list(map(float, input().split()))
        except EOFError:
            break

        points_list = [[points_receive[2*i], points_receive[2 * i + 1]] for i in range(4)]
        p1_to_p2 = direction_vector(points_list[0], points_list[1])
        p2_to_p3 = direction_vector(points_list[1], points_list[2])
        p3_to_p1 = direction_vector(points_list[2], points_list[0])
        p1_to_pp = direction_vector(points_list[0], points_list[3])
        p2_to_pp = direction_vector(points_list[1], points_list[3])
        p3_to_pp = direction_vector(points_list[2], points_list[3])
        cp1 = cross_product(p1_to_p2, p1_to_pp)
        cp2 = cross_product(p2_to_p3, p2_to_pp)
        cp3 = cross_product(p3_to_p1, p3_to_pp)

        if cp1 > 0 and cp2 > 0 and cp3 > 0:
            print('YES')
        elif cp1 < 0 and cp2 < 0 and cp3 < 0:
            print('YES')
        else:
            print('NO')

Python: while(true):

    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 sys
def f(a,b,c,d):z=(c-a)*(y-d)-(d-b)*(x-c);return[-1*(z==0),1][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: 
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;
    
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")