Go: package main

import (
	"fmt"
	"math"
)

func main() {
	n := scanInt()
	for i := 0; i < n; i++ {
		circleTriangle()
	}
}

func scanInt() int {
	var n int
	fmt.Scanf("%d", &n)
	return n
}

func circleTriangle() {
	var x1, y1, x2, y2, x3, y3 float64
	fmt.Scanf("%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3)
	a := 2 * (x1 - x2)
	b := 2 * (y1 - y2)
	c := 2 * (x1 - x3)
	d := 2 * (y1 - y3)
	e := x1*x1 - x2*x2 + y1*y1 - y2*y2
	f := x1*x1 - x3*x3 + y1*y1 - y3*y3

	px := (d*e - b*f) / (a*d - b*c)
	py := (a*f - c*e) / (a*d - b*c)

	r := math.Sqrt((x1-px)*(x1-px) + (y1-py)*(y1-py))
	fmt.Printf("%.3f %.3f %.3f\n", px, py, r)
}

Python: #encoding=utf-8
import math

x = input()
x1,y1,x2,y2,x3,y3 = map(float, raw_input().split())

p = ((y1 - y3)*(y1**2 - y1**2 + x1**2 - x2**2) - (y1 - y2)*(y1**2 - y3**2 + x1**2 - x3**2))/(2*(y1 - y3)*(x1 - x2) - 2*(y1 - y2)*(x1 - x3))
q = ((x1 - x3)*(x1**2 - x2**2 + y1**2 - y2**2) - (x1 - x2)*(x1**2 - x3**2 + y1**2 - y3**2))/(2*(x1 - x3)*(y1 - y2) - 2*(x1 - x2)*(y1 - y3))

print ("{0:.3f}".format(round(p, 3))),("{0:.3f}".format(round(q, 3))),round(math.sqrt((x1-p)**2 + (y1-q)**2),3)

Python: def perpendicular_bisector(p, q):
    x = (q[0] - p[0])
    y = (q[1] - p[1])
    return (2 * x, 2 * y, -x**2 - y**2)


def gauss_jordan_elimination(Array):
    # N???M??????Array
    N = len(Array)
    if N == 0:
        return (True, Array)
    else:
        M = len(Array[0])

    A = []
    for i in range(len(Array)):
        A.append(Array[i][:])

    pivot = 0
    L = min(N, M)
    while pivot < L:
        pivot_v = A[pivot][pivot]
        pivot_row = pivot
        for i in range(pivot + 1, L):
            v = max(A[i][pivot], -A[i][pivot])
            if pivot_v < v:
                pivot_row = i
                pivot_v = v
        if pivot_row > pivot:
            for i in range(M):
                A[pivot][i], A[pivot_row][i] = A[pivot_row][i], A[pivot][i]
        if pivot_v == 0:
            return ('False', A)
        inv_pivot = 1 / A[pivot][pivot]
        A[pivot][pivot] = 1
        for i in range(pivot + 1, M):
            A[pivot][i] *= inv_pivot
        for i in range(N):
            if i == pivot:
                continue
            t = -1 * A[i][pivot]
            A[i][pivot] = 0
            for j in range(pivot + 1, M):
                A[i][j] += t * A[pivot][j]
        pivot += 1
    return ('True', A)

n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = map(int, input().split())


    a = list(perpendicular_bisector((x1, y1), (x2, y2)))
    b = list(perpendicular_bisector((x1, y1), (x3, y3)))
    c = [a, b]
    state, c = gauss_jordan_elimination(c)
    x = c[0][2]
    y = c[1][2]
    r = ((x - x1)**2 + (y - y1)**2)**0.5
    print(round(x, 3), round(y, 3), round(r, 3))

Python: def circum(x1,x2,x3,y1,y2,y3):
    a1 = 2 * (x2 - x1)
    b1 = 2 * (y2 - y1)
    c1 = x1 ** 2 - x2 ** 2 + y1 **2 - y2 ** 2
    a2 = 2 * (x3 - x1)
    b2 = 2 * (y3 - y1)
    c2 = x1 ** 2 - x3 ** 2 + y1 **2 - y3 ** 2
    X = (b1 * c2 - b2 * c1)/(a1 * b2 - a2 * b1)
    Y = (c1 * a2 - c2 * a1)/(a1 * b2 - a2 * b1)
    R = ((x1 - X) ** 2 + (y1 - Y) ** 2) ** 0.5
    return map(lambda n: round(n,3), [X,Y,R])
N = int(input())
ans = []
for i in range(N):
    ans.append(circum(*list(map(float,input().split()))))
for i in range(N):
    print('{0:.3f} {1:.3f} {2:.3f}'.format(*ans[i]))

Python: def circum(x1,y1,x2,y2,x3,y3):
    a1 = 2 * (x2 - x1)
    b1 = 2 * (y2 - y1)
    c1 = x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2
    a2 = 2 * (x3 - x1)
    b2 = 2 * (y3 - y1)
    c2 = x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2
    X = (b1 * c2 - b2 * c1)/(a1 * b2 - a2 * b1)
    Y = (c1 * a2 - c2 * a1)/(a1 * b2 - a2 * b1)
    R = ((x1 - X) ** 2 + (y1 - Y) ** 2) ** 0.5
    return map(lambda n: round(n,3), [X,Y,R])
N = int(input())
ans = []
for i in range(N):
    ans.append(circum(*list(map(float,input().split()))))
for i in range(N):
    print('{0:.3f} {1:.3f} {2:.3f}'.format(*ans[i]))

Python: from decimal import Decimal
import math
for _ in range(int(input())):
    x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split()))
    a=x1-x3
    b=y2-y3
    c=x2-x3
    d=y1-y3
    e=y1-y2
    f=x1+x3
    g=x2+x3
    X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d)
    try:
        Y=-(a/d)*(X-f/2)+(y1+y3)/2
    except:
        Y=-(c/b)*(X-g/2)+(y2+y3)/2
    R=math.sqrt((x1-X)**2+(y1-Y)**2)
    print(" ".join(["{:.3f}".format(i) for i in [X,Y,R]]))

Python: import fractions


def calc(x1, y1, x2, y2):
    return 2 * (x2 - x1), 2 * (y2 - y1), x2 ** 2 + y2 ** 2 - x1 ** 2 - y1 ** 2


n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = map(float, input().split())
    cx1, cy1, z1 = calc(x1, y1, x2, y2)
    cx2, cy2, z2 = calc(x1, y1, x3, y3)
    gcd = fractions.gcd(cx1, cx2)
    r1, r2 = cx2 // gcd, cx1 // gcd
    dcy = r1 * cy1 - r2 * cy2
    dz = r1 * z1 - r2 * z2
    y = dz / dcy
    x = (z1 - cy1 * y) / cx1
    r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5
    print(*map(lambda x: '{:.3f}'.format(round(x, 3)), (x, y, r)))

Python: for _ in[0]*int(input()):
 a,b,c,d,e,f=map(float,input().split())
 s,t,u=a*a+b*b,c*c+d*d,e*e+f*f
 x=(s*(d-f)+t*(f-b)+u*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d))
 y=(s*(c-e)+t*(e-a)+u*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c))
 print('%.3f %.3f %.3f'%(x,y,((x-a)**2+(y-b)**2)**.5))

Python: from math import acos
from math import sin

def ang(ax, ay, ox, oy, bx, by):
    oax, oay = ax - ox, ay - oy
    obx, oby = bx - ox, by - oy
    r1, r2 = oax ** 2 + oay ** 2, obx ** 2 + oby ** 2
    return acos((oax * obx + oay * oby) / (r1 * r2) ** 0.5)

def circumcircle(x1, y1, x2, y2, x3, y3):
    s2A = sin(2 * ang(x3, y3, x1, y1, x2, y2))
    s2B = sin(2 * ang(x1, y1, x2, y2, x3, y3))
    s2C = sin(2 * ang(x2, y2, x3, y3, x1, y1))
    px = (s2A * x1 + s2B * x2 + s2C * x3) / (s2A + s2B + s2C) + 0.
    py = (s2A * y1 + s2B * y2 + s2C * y3) / (s2A + s2B + s2C) + 0.
    r = (((x2 - x3) ** 2 + (y2 - y3) ** 2) ** 0.5) / (2 * sin(ang(x2, y2, x1, y1, x3, y3))) + 0.
    return px, py, r

n = int(input())
for i in range(n):
    print("{0[0]:.3f} {0[1]:.3f} {0[2]:.3f}".format(
          circumcircle(*tuple(map(float, input().split())))))

Python: # coding: utf-8
# Here your code !
import math
 
num = int(input())
for i in range(num):
    x1,y1,x2,y2,x3,y3 = map(float,input().split())
    a1 = 2*(x2-x1)
    b1 = 2*(y2-y1)
    c1 = (x1*x1 - x2*x2 + y1*y1 - y2*y2)
    a2 = 2*(x3-x1)
    b2 = 2*(y3-y1)
    c2 = (x1*x1 - x3*x3 + y1*y1 - y3*y3)
 
    p1 = (b1*c2 - b2*c1) / (a1*b2 - a2*b1)
    p2 = (c1*a2 - c2*a1) / (a1*b2 - a2*b1)
    r = math.hypot(x1-p1, y1-p2)
    temp = [p1,p2,r]
    ans = map(lambda x:round(x,3),temp)
    print("%03.3f %03.3f %03.3f"%(temp[0],temp[1],temp[2]))

Python: def pp(x):
    if x==0:
        x=0
    return "{0:.3f}".format(round(x,3))


n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3=map(float, input().split())

    a=2*(x2-x1)
    b=2*(y2-y1)
    c=( x2**2 + y2**2 ) - ( x1**2 + y1**2 )
    d=2*(x3-x1)
    e=2*(y3-y1)
    f=( x3**2 + y3**2 ) - ( x1**2 + y1**2 )
    x=(c*e-b*f)/(a*e-b*d)
    y=(a*f-c*d)/(a*e-b*d)
    r=( (x-x1)**2 + (y-y1)**2 )**0.5
 
    print(pp(x), pp(y), pp(r))