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 getTriangleArea(x1, y1, x2, y2, x3, y3): # returns the area of triangle determined by provided 3 points
  ux = x2-x1
  uy = y2-y1
  vx = x3-x1
  vy = y3-y1
  return abs(ux*vy-vx*uy)/2

inputs=[]
while True:
  try:
    inputs.append(list(map(float,input().split())))
  except EOFError:
    break

for i in inputs:
  x1, y1, x2, y2, x3, y3, xp, yp = i
  if getTriangleArea(x1, y1, x2, y2, x3, y3)==getTriangleArea(x1, y1, x2, y2, xp, yp)+getTriangleArea(x2, y2, x3, y3, xp, yp)+getTriangleArea(x3, y3, x1, y1, xp, yp):
    print("YES")
  else:
    print("NO")

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: def r(a, b, c, d, e, f):
    return a * (d-f) + c * (f-b) + e * (b-d) > 0
 
while True:
    try: line = list(map(float, input().split()))
    except: break
     
    x1, y1, x2, y2, x3, y3, xp, yp = line
    abc = r(x1, y1, x2, y2, x3, y3)
    pab = r(xp, yp, x1, y1, x2, y2)
    pbc = r(xp, yp, x2, y2, x3, y3)
    pca = r(xp, yp, x3, y3, x1, y1)
 
    print('YES' if abc == pab == pbc == pca else 'NO')

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: class vector(object):
    def __init__(self,a,b):
        self.x=b.x-a.x
        self.y=b.y-a.y
    @staticmethod
    def cross_product(a,b):
        return a.x*b.y-a.y*b.x
class vertex(object):
    def __init__(self,a):
        self.x=a[0]
        self.y=a[1]
class circle(object):
    def __init__(self,p,r):
        self.px=p.x
        self.py=p.y
        self.r=r
class triangle(object):
    def __init__(self,a,b,c):
        self.a=a
        self.b=b
        self.c=c
        import math
        self.ab=math.sqrt((self.a.x-self.b.x)**2+(self.a.y-self.b.y)**2)
        self.bc=math.sqrt((self.b.x-self.c.x)**2+(self.b.y-self.c.y)**2)
        self.ca=math.sqrt((self.c.x-self.a.x)**2+(self.c.y-self.a.y)**2)
        c=self.ab
        a=self.bc
        b=self.ca
        self.cosA=(b**2+c**2-a**2)/(2*b*c)
        self.cosB=(a**2+c**2-b**2)/(2*a*c)
        self.cosC=(b**2+a**2-c**2)/(2*b*a)
        self.sinA=math.sqrt(1-self.cosA**2)
        self.sinB=math.sqrt(1-self.cosB**2)
        self.sinC=math.sqrt(1-self.cosC**2)
        self.sin2A=2*self.sinA*self.cosA
        self.sin2B=2*self.sinB*self.cosB
        self.sin2C=2*self.sinC*self.cosC
    def area(self):
        import math
        s=(self.ab+self.bc+self.ca)/2
        S=math.sqrt(s*(s-self.ab)*(s-self.bc)*(s-self.ca))
        return S
    def circumscribed(self):
        R=self.ab/(2*self.sinC)
        px=(self.sin2A*self.a.x+self.sin2B*self.b.x+self.sin2C*self.c.x)/(self.sin2A+self.sin2B+self.sin2C)
        py=(self.sin2A*self.a.y+self.sin2B*self.b.y+self.sin2C*self.c.y)/(self.sin2A+self.sin2B+self.sin2C)
        px=round(px,3)
        py=round(py,3)
        R=round(R,3)
        p=vertex((px,py))
        return circle(p,R)
    def isin(self,p):
        AB=vector(self.a,self.b)
        BC=vector(self.b,self.c)
        CA=vector(self.c,self.a)
        AP=vector(self.a,p)
        BP=vector(self.b,p)
        CP=vector(self.c,p)
        if (vector.cross_product(AB,AP)>0 and vector.cross_product(BC,BP)>0 and vector.cross_product(CA,CP)>0)or(vector.cross_product(AB,AP)<0 and vector.cross_product(BC,BP)<0 and vector.cross_product(CA,CP)<0):
            return 'YES'
        else:return 'NO'
A=[]
B=[]
C=[]
p=[]
import sys
for line in sys.stdin:
    a,b,c,d,e,f,g,h=list(map(float,line.split()))
    A.append(vertex((a,b)))
    B.append(vertex((c,d)))
    C.append(vertex((e,f)))
    p.append(vertex((g,h)))
for i in range(len(A)):
    Triangle=triangle(A[i],B[i],C[i])
    print(Triangle.isin(p[i]))

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):

    cnt = 0
    for a, b in ((p1, p2), (p2, p3), (p3, p1)):
        vec1 = sub(a, b)
        vec2 = sub(a, pp)
        if cross_product(vec2, vec1) >= 0:
            cnt += 1
    if cnt == 0 or cnt == 3:
        print("YES")
    else:
        print("NO")


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: g=lambda a,b:abs(a[0]*b[1]-a[1]*b[0])

while True:
    t=input()
    if t=="":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 0:
        print("NO")
    else:
        print("YES")