def inexact(pa, pb, pc, pd):
    """Tests whether pd is in circle defined by the 3 points pa, pb and pc
    """
    adx = pa[0] - pd[0]
    bdx = pb[0] - pd[0]
    cdx = pc[0] - pd[0]
    ady = pa[1] - pd[1]
    bdy = pb[1] - pd[1]
    cdy = pc[1] - pd[1]
    bdxcdy = bdx * cdy
    cdxbdy = cdx * bdy
    alift = adx * adx + ady * ady
    cdxady = cdx * ady
    adxcdy = adx * cdy
    blift = bdx * bdx + bdy * bdy
    adxbdy = adx * bdy
    bdxady = bdx * ady
    clift = cdx * cdx + cdy * cdy
    det = alift * (bdxcdy - cdxbdy) + \
            blift * (cdxady - adxcdy) + \
            clift * (adxbdy - bdxady)
    return det