def circumcircle(a, b, c):
    P = Vector(a[0], a[1])
    Q = Vector(b[0], b[1])
    R = Vector(c[0], c[1])

    mPQ = (P + Q) * .5
    mQR = (Q + R) * .5

    numer = -(- mPQ.y * R.y + mPQ.y * Q.y + mQR.y * R.y - mQR.y * Q.y
              - mPQ.x * R.x + mPQ.x * Q.x + mQR.x * R.x - mQR.x * Q.x)
    denom = (-Q.x * R.y + P.x * R.y - P.x * Q.y +
             Q.y * R.x - P.y * R.x + P.y * Q.x)

    t = numer / denom

    cx = -t * (Q.y - P.y) + mPQ.x
    cy = t * (Q.x - P.x) + mPQ.y

    return ((cx, cy), (P - (cx, cy)).length())
Computes the circumcircle of a triangle defined by a, b, c.
dataset/ETHPy150Open kivy/kivy/kivy/geometry.py/circumcircle