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: length=[float(0) for i in range(3)]
while 1:
    try:
        x1,y1,x2,y2,x3,y3,x4,y4=[float(i) for i in input().split( )]
        x12=x1-x2
        y12=y1-y2
        x23=x2-x3
        y23=y2-y3
        x31=x3-x1
        y31=y3-y1
        x14=x1-x4
        y14=y1-y4
        x24=x2-x4
        y24=y2-y4
        x34=x3-x4
        y34=y3-y4
        gai1=x12*y14-x14*y12
        gai2=x23*y24-x24*y23
        gai3=x31*y34-x34*y31
        if (((gai1>0)and(gai2>0)and(gai3>0))or((gai1<0)and(gai2<0)and(gai3<0))):
            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: import sys
  
for s in sys.stdin:
    x1,y1,x2,y2,x3,y3,xp,yp = [ float(x) for x in s.split() ]

    v12 = (x2-x1, y2-y1)
    v23 = (x3-x2, y3-y2)
    v31 = (x1-x3, y1-y3)
    v1p = (xp-x1, yp-y1)
    v2p = (xp-x2, yp-y2)
    v3p = (xp-x3, yp-y3)
    cp1 = v12[0]*v1p[1] - v1p[0]*v12[1]
    cp2 = v23[0]*v2p[1] - v2p[0]*v23[1]
    cp3 = v31[0]*v3p[1] - v3p[0]*v31[1]

    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: try:
    while True:
        li = [float(x) for x in input().split()]
        lix = [li[i] for i in range(6) if i % 2 == 0]
        liy = [li[i] for i in range(6) if i % 2 != 0]
        x, y = li[6], li[7]
        if min(lix) <= x <= max(lix) and min(liy) <= y <= max(liy):
            print("YES")
        else:
            print("NO")
except EOFError:
    pass

Python: def cross(a,b):
    return (a.conjugate()*b).imag
def is_in_triangle(X1,Y1,X2,Y2,X3,Y3,Xp,Yp):
    z1 = complex(X1-Xp,Y1-Yp)
    z2 = complex(X2-Xp,Y2-Yp)
    z3 = complex(X3-Xp,Y3-Yp)
    if cross(z1,z2) * cross(z2,z3) > 0:
        if cross(z2,z3) * cross(z3,z1) > 0:
            return True
    else:
        return False
lst = []
try:
    while True:
        P = tuple(map(float,input().strip().split()))
        lst.append(P)
except EOFError:
    pass
N = len(lst)
for i in range(N):
    if is_in_triangle(*lst[i]):
        print("YES")
    else:
        print("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