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 Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

def CP(p1, p2, p3):
    ax = p2.x-p1.x
    ay = p2.y-p1.y
    bx = p3.x-p1.x
    by = p3.y-p1.y
    return ax*by - ay*bx

def Judge(a,b,c):
    if a > 0 and b > 0 and c > 0:
        print("YES")
    elif a < 0 and b < 0 and c < 0:
        print("YES")
    else:
        print("NO")

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    x1,y1,x2,y2,x3,y3,xp,yp = [float(i) for i in N[l].split()]
    P1 = Point(x1,y1)
    P2 = Point(x2,y2)
    P3 = Point(x3,y3)
    PP = Point(xp,yp)

    cp1 = CP(PP, P1, P2)
    cp2 = CP(PP, P2, P3)
    cp3 = CP(PP, P3, P1)

    Judge(cp1,cp2,cp3)

Python: import math
import sys


def get_triangle_area(x1, y1, x2, y2, x3, y3):
    l1 = math.sqrt(abs(x1-x2)**2+abs(y1-y2)**2)
    l2 = math.sqrt(abs(x2-x3)**2+abs(y2-y3)**2)
    l3 = math.sqrt(abs(x3-x1)**2+abs(y3-y1)**2)
    s = (l1+l2+l3)/2
    return math.sqrt(s*(s-l1)*(s-l2)*(s-l3))


for l in sys.stdin:
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, l.split())
    s1 = get_triangle_area(x1, y1, x2, y2, x3, y3)
    s2 = get_triangle_area(xp, yp, x1, y1, x2, y2)
    s2 += get_triangle_area(xp, yp, x2, y2, x3, y3)
    s2 += get_triangle_area(xp, yp, x3, y3, x1, y1)
    print("YES" if round(s1, 10) == round(s2, 10) else "NO")

Python: while 1:
    x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()]
    d_max=max((x2-x1)**2+(y2-y1)**2,(x3-x2)**2+(y3-y2)**2,(x3-x1)**2+(y3-y1)**2)
    d1,d2,d3=(x2-x1)**2+(y2-y1)**2,(x3-x2)**2+(y3-y2)**2,(x3-x1)**2+(y3-y1)**2;
    
    if max(d_max,d1,d2,d3) > d_max:
        print("No")
    else:
        print("Yes")

Python: import math

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 math.copysign(1, s1) == math.copysign(1, s2) and math.copysign(1, s1) == math.copysign(1, s3):
            print("YES")
        else:
            print("NO")
    except:
        break

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 = list(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):
        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):
        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 - 1e-5:
            print('NO')
        else:
            print('YES')
    except:
        break

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: # -*- coding: utf-8 -*-
import math
import cmath

class Point(object):
    def __init__(self, x, y):
        self.point = complex(x, y)

    def __str__(self):
        return "x = {0}, y = {1}".format(self.point.real, self.point.imag)


class Triangle(Point):
    def __init__(self, a, b, c):
        self.a = a
        self.b = b
        self.c = c

        # ３辺の長さ
        self.edgeA = abs(b.point-c.point)
        self.edgeB = abs(c.point-a.point)
        self.edgeC = abs(a.point-b.point)

        # ３角の大きさ
        self.angleA = Triangle.angle(self.edgeA, self.edgeB, self.edgeC)
        self.angleB = Triangle.angle(self.edgeB, self.edgeC, self.edgeA)
        self.angleC = Triangle.angle(self.edgeC, self.edgeA, self.edgeB)

    # 角度を求める
    def angle(A, B, C):
        return cmath.acos( (B*B+C*C-A*A)/(2*B*C) ).real


eps = 0.0001
while True:
    line = input()
    if line == "":
        break
    line = [float(x) for x in line.split()]
    p1 = Point(line[0], line[1])
    p2 = Point(line[2], line[3])
    p3 = Point(line[4], line[5])
    P  = Point(line[6], line[7])
    t1 = Triangle(p1, p2, P)
    t2 = Triangle(p2, p3, P)
    t3 = Triangle(p3, p1, P)
    if (math.degrees(t1.angleC + t2.angleC + t3.angleC) <= 360+eps) and (math.degrees(t1.angleC + t2.angleC + t3.angleC) >= 360-eps):
        print("YES")
    else:
        print("NO")

Python: import math


def tri(x1, y1, x2, y2, x3, y3):
    return math.fabs((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)) / 2

while True:
    try:
        x1, y1, x2, y2, x3, y3, x, y = map(float, input().split())
    except:
        break
    abc = tri(x1, y1, x2, y2, x3, y3)
    abp = tri(x1, y1, x2, y2, x, y)
    acp = tri(x1, y1, x3, y3, x, y)
    bcp = tri(x2, y2, x3, y3, x, y)
    x, y = int(abc * pow(10, 5)), int((abp + acp + bcp) * pow(10, 5))
    print("YES" if x >= y else "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)==side(p3, p1, p0))]

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 - 1e-3:
            print('NO')
        else:
            print('YES')
    except:
        break