Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func check(x, y, x1, y1, x2, y2 float64) float64 {
	return (x2-x1)*y - (y2-y1)*x + x1*y2 - x2*y1
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]float64, 8)
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		for j := 0; j < 8; j++ {
			a[j], _ = strconv.ParseFloat(info[j], 64)
		}
		if check(a[0], a[1], a[2],a[3], a[6], a[7])*check(a[4], a[5], a[2], a[3], a[6], a[7]) < 0 && check(a[6], a[7], a[0], a[1], a[4], a[5])*check(a[2],a[3], a[0], a[1], a[4], a[5]) < 0 {
			fmt.Println("YES")	
		} else {
			fmt.Println("NO")
		}
	}
}

Python: while True:
    try: ipt = input()
    except: break

    c = list(map(float, ipt.split(',')))
    x, y = c[::2], c[1::2]

    A_1 = (x[3]-x[1])*(y[2]-y[1]) - (y[3]-y[1])*(x[2]-x[1])
    A_2 = (x[0]-x[1])*(y[2]-y[1]) - (y[0]-y[1])*(x[2]-x[1])
    A = A_1 / A_2

    B_1 = (-(x[3]-x[1])*(y[0]-y[1])) + (y[3]-y[1])*(x[0]-x[1])
    B_2 = (x[0]-x[1])*(y[2]-y[1]) - (y[0]-y[1])*(x[2]-x[1])
    B = B_1 / B_2
    
    if A >= 0 and B >= 0 and A+B >= 1:
        print('YES')
    else:
        print('NO')

Python: import math
def get_data():
    xa,ya,xb,yb,xc,yc,xd,yd = map(float,input().split(','))
    return xa,ya,xb,yb,xc,yc,xd,yd

def dist(x1,y1,x2,y2):
    d = ((x2-x1)**2 + (y2-y1)**2)**0.5
    return d

def lin(x1,y1,x2,y2):
    m = (y1-y2)/(x1-x2)
    n = (x1*y2-x2*y1)/(x1-x2)
    return m,n

def p_l(x0,y0,m,n):
    d = abs(y0-m*x0-n)/math.sqrt(1+m**2)
    return d

def convex(xa,ya,xb,yb,xc,yc,xd,yd):
    ac = dist(xa,ya,xc,yc)
    bd = dist(xb,yb,xd,yd)
    
    m1,n1 = lin(xb,yb,xd,yd)
    d1 = p_l(xa,ya,m1,n1)
    if ac < d1:
        print('NO')
        return 0
    
    m2,n2 = lin(xb,yb,xd,yd)
    d2 = p_l(xc,yc,m2,n2)
    if ac < d2:
        print('NO')
        return 0

    m3,n3 = lin(xa,ya,xc,yc)
    d3 = p_l(xb,yb,m3,n3)
    if bd < d3:
        print('NO')
        return 0
    
    m4,n4 = lin(xa,ya,xc,yc)
    d4 = p_l(xd,yd,m4,n4)
    if bd < d4:
        print('NO')
        return 0
    else:
        print('YES')
    return 0

while True:
    try:
        xa,ya,xb,yb,xc,yc,xd,yd = get_data()
        convex(xa,ya,xb,yb,xc,yc,xd,yd)
    except EOFError:
        break

Python: EPS = 0.0001

# しきい値を決める際に、ベクトル演算をするのだが、
# line, a,b で計算したときESPの誤差を許容する必要がある


# a, b, はラインの同一側にあるか。　-1, 0, 1
def atSameSide(a, b, line):
    sa = (line[1].real-line[0].real)*(a.imag-line[0].imag) \
         + (line[1].imag-line[0].imag)*(line[0].real-a.real);
    sb = (line[1].real-line[0].real)*(b.imag-line[0].imag) \
         + (line[1].imag-line[0].imag)*(line[0].real-b.real);
    if -EPS <= sa and sa <= EPS: return 0          # a in line
    if -EPS <= sb and sb <= EPS: return 0          # b in line
    if sa*sb >= 0: return 1           # a,b at same side
    return -1;
 
while True:
    try: p = list(map(float, input().split(',')))
    except: break
     
    p1 = complex(p[0], p[1])
    p2 = complex(p[2], p[3])
    p3 = complex(p[4], p[5])
    p4 = complex(p[6], p[7])
    if atSameSide(p2, p4, [p1, p3]) == -1 and \
       atSameSide(p1, p3, [p2, p4]) == -1: print('YES')
    else: print('NO')

Python: from sys import stdin

while(True):
    try:
        xa,ya,xb,yb,xc,yc,xd,yd = map(float, stdin.readline().split(","))
        ab = [xb-xa,yb-ya]
        bc = [xc-xb,yc-yb]
        cd = [xd-xc,yd-yc]
        da = [xa-xd,ya-yd]
        cr1 = ab[0]*bc[1] - ab[1]*bc[0]
        cr2 = bc[0]*cd[1] - bc[1]*cd[0]
        cr3 = cd[0]*da[1] - cd[1]*da[0]
        cr4 = da[0]*ab[1] - da[1]*ab[0]
        if (cr1<0 and cr2<0 and cr3<0 and cr4<0) or (cr1>0 and cr2>0 and cr3>0 and cr4>0):
            print("YES")
        else:
            print("NO")
    except:
        break

Python: def distance(ax,ay,bx,by):
    return (ax-bx)**2+(ay-by)**2

def yogen(plist, st):
    a = distance(plist[st], plist[st+1], plist[st+2], plist[st+3])
    b = distance(plist[st+2], plist[st+3], plist[st+4], plist[st+5])
    c = distance(plist[st+4], plist[st+5], plist[st], plist[st+1])
    return a+b-c >= 0

while True:
    try:
        points = list(map(float, input().split(",")))
        points.extend(points)
        if yogen(points, 0) and yogen(points, 2) and yogen(points, 4) and yogen(points, 6): print("YES")
        else: print("NO")

    except EOFError: break

Python: import sys
for e in sys.stdin:
 e=list(map(float,e.split(',')));f=0
 for i in range(0,8,2):
  s=(e[i]-e[(2+i)%8])*(e[(4+i)%8]-e[(2+i)%8])+(e[1+i]-e[(3+i)%8])*(e[(5+i)%8]-e[(3+i)%8])
  if s<0:f+=1
 print(['YES','NO'][f%4>0])

Python: class Vector2:
    """
    A simple 2D vector class.
    @Author:whitestone0811(Vir_MeL0)
    """
    def __init__(self,x,y):
        self.x=x
        self.y=y
    def __add__(self,other):
        return Vector2(self.x+other.x,self.y+other.y)
    def __sub__(self,other):
        return Vector2(self.x-other.x,self.y-other.y)
    def __mul__(self,other):
        if isinstance(other, Vector2):
            return self.x*other.x+self.y*other.y
        else:
            return Vector2(self.x*other,self.y*other)
    def __rmul__(self,other):
        if not isinstance(other,Vector2):
            return Vector2(self.x*other,self.y*other)
    def abs(self):
        return (self.x**2+self.y**2)**0.5
    def cos(self,other):
        return (self*other)/(self.abs()*other.abs())
    def __str__(self):
        return "[{0},{1}]".format(self.x,self.y)
    def __neg__(self):
        return Vector2(-self.x,-self.y)
#  
import sys  
lines=sys.stdin
for _in in lines:
    cors=[float(cor)for cor in _in.split(',')]
    vAB=Vector2(cors[2]-cors[0],cors[3]-cors[1])
    vBC=Vector2(cors[4]-cors[2],cors[5]-cors[3])
    vCD=Vector2(cors[6]-cors[4],cors[7]-cors[5])
    vDA=Vector2(cors[0]-cors[6],cors[1]-cors[7])
    cnv_a=True if(vAB-vDA)*(vAB+vBC)>0 else False
    cnv_b=True if(vBC-vAB)*(vBC+vCD)>0 else False
    cnv_c=True if(vCD-vBC)*(vCD+vDA)>0 else False
    cnv_d=True if(vDA-vCD)*(vDA+vAB)>0 else False
    print("YES" if cnv_a and cnv_b and cnv_c and cnv_d else "NO")

Python: import sys
for e in sys.stdin:
 e=list(map(float,e.split(',')));n=0
 for i in range(0,8,2):
  if(e[i]-e[(2+i)%8])*(e[(5+i)%8]-e[(3+i)%8])-(e[1+i]-e[(3+i)%8])*(e[(4+i)%8]-e[(2+i)%8])>0:n+=1
 print(['YES','NO'][n%4>0])

Python: def is_on_the_same_side(p0, p1, p2, p3):
    s2 = (p1[0]-p0[0]) * (p2[1]-p0[1]) - (p2[0]-p0[0]) * (p1[1]-p0[1])
    s3 = (p1[0]-p0[0]) * (p3[1]-p0[1]) - (p3[0]-p0[0]) * (p1[1]-p0[1])
    if s2 * s3 > 0:
        return True
    else:
        return False

while True:
    try:
        data = list(map(float, input().split(',')))
        a = data[0:2]
        b = data[2:4]
        c = data[4:6]
        d = data[6:8]

        if not is_on_the_same_side(a, c, b, d) and is_on_the_same_side(b, c, a, d) and is_on_the_same_side(a, b, c, d):
            print('YES')
        else:
            print('NO')
    except:
        break

Python: import sys
for line in sys.stdin():
    p = list(map(float, line.split(',')))
    v = [p[i] - p[(i + 2) % 8] for i in range(8)]
    ip = [v[j] * v[(j + 3) % 8] - v[j + 1] * v[(j + 2) % 8] > 0 for j in range(0,8,2)]
    if sum(ip) == 0 or sum(ip) == 4:
        print('YES')
    else:
        print('NO')