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: 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(float, 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: import math
from decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP

n = int(input())

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

    a2 = (x2-x3)**2 + (y2-y3)**2
    b2 = (x1-x3)**2 + (y1-y3)**2
    c2 = (x1-x2)**2 + (y1-y2)**2
    area = ((x2-x1) * (y3-y1) - (x3-x1) * (y2-y1)) / 2

    x = (a2*(b2+c2-a2)*x1 + b2*(c2+a2-b2) *
         x2 + c2*(a2+b2-c2)*x3) / (16*area*area)
    y = (a2*(b2+c2-a2)*y1 + b2*(c2+a2-b2) *
         y2 + c2*(a2+b2-c2)*y3) / (16*area*area)
    r = ((x1-x)**2 + (y1-y)**2)**0.5

    x = Decimal(str(x)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)
    r = Decimal(str(r)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)

    print(x, y, r)

Python: from math import sqrt, fabs


def calcu_cirucumcenter(x1, y1, x2, y2, x3, y3):
    """
   ??????O?????§?¨????(x, y)??¨????????¨
   (x-x1)**2 + (y-y1)**2 = (x-x2)**2 + (y-y2)**2
   x**2 -2*x1*x + x1**2 + y**2 -2*y1*y + y1**2 = ... -2*x2*x, x2**2, -2*y2*y, y2**2
   ?????¨????????¨ (-2*x1 + 2*x2)x + (-2y1 + 2*y2)y + (x1**2 + y1**2 - x2**2 - y2**2) = 0
   x1, x3???????????????????§????
   (-2*x1 + 2*x3)x + (-2y1 + 2*y3)y + (x1**2 + y1**2 - x3**2 - y3**2) = 0
   
   ??????????????¢????????\????????¢???????????£???????¨??????¨???????§£???
   | a b | = |e|
   | c d |   |f|
   """
    a = -2 * x1 + 2 * x2
    b = -2 * y1 + 2 * y2
    c = -2 * x1 + 2 * x3
    d = -2 * y1 + 2 * y3
    e = -1* (x1 ** 2 + y1 ** 2 - x2 ** 2 - y2 ** 2)
    f = -1 * (x1 ** 2 + y1 ** 2 - x3 ** 2 - y3 ** 2)

    x = 1 / (a * d - b * c) * (d * e - b * f)
    y = 1 / (a * d - b * c) * (-c * e + a * f)
    return x, y


if __name__ == '__main__':
    epsilon = 1e-9

    # ??????????????\???
    num = int(input())
    for i in range(num):
        x1, y1, x2, y2, x3, y3 = [float(x) for x in input().split(' ')]

        # ?????\????????????(??????)????±???????
        x, y = calcu_cirucumcenter(x1, y1, x2, y2, x3, y3)
        # ?¨????????????¨?????? -0.0 ???????????´???????????¶?????? 0.0 ?????????
        if fabs(x) < epsilon:
            x = 0.0
        if fabs(y) < epsilon:
            y = 0.0

        # ????????????????????§????????¢?????????
        r = sqrt((x - x1)**2 + (y - y1)**2)

        print('{0:.3f} {1:.3f} {2:.3f}'.format(x, y, r))

Python: import math

def simultaneous_equasion(a, b, c, d, e, f):
    "??£???????¨????"
    det = a * d - b * c
    a11 = d / det
    a12 = - b / det
    a21 = - c / det
    a22 = a / det
    return a11 * e + a12 * f, a21 * e + a22 * f

n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3 = map(float, input().split())
    # ?????????O??¨????????¨???OP1 ^ 2 = OP2 ^ 2
    # (x - x1) ^ 2 + (y - y1) ^ 2 = (x - x2) ^ 2 + (y - y2) ^ 2
    # - 2 * x * x1 + x1 ^ 2 - 2 * y * y1 + y1 ^ 2 = - 2 * x * x2 + x2 ^ 2 - 2 * y * y2 + y2 ^ 2
    # 2 * (x1 - x2) * x + 2 * (y1 - y2) * y = x1 ^ 2 + y2 ^ 2 - x2 ^ 2 - y2 ^ 2
    a = 2 * (x1 - x2)
    b = 2 * (y1 - y2)
    c = 2 * (x1 - x3)
    d = 2 * (y1 - y3)
    e = x1 ** 2 + y1 ** 2 - x2 ** 2 - y2 ** 2
    f = x1 ** 2 + y1 ** 2 - x3 ** 2 - y3 ** 2
    px, py = simultaneous_equasion(a, b, c, d, e, f)
    r = math.sqrt((px - x1) ** 2 + (py - y1) ** 2)
    print("%.3f %.3f %.3f" % (round(px, 3), round(py, 3), round(r, 3)))

Python: import math

n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3 = map(float,input().split())
    a1,b1,c1 = 2*(x2-x1),2*(y2-y1), (x1**2 - x2 **2 + y1 ** 2 - y2 ** 2)
    a2,b2,c2 = 2*(x3-x1), 2*(y3-y1), (x1**2 - x3 **2 + y1 ** 2 - y3 ** 2)

    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)


    print("%03.3f %03.3f %03.3f " %(p1,p2,r))

Python: from math import sqrt
for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3= map(float, input().split())
    a= sqrt((x3-x2)**2 + (y3-y2)**2)
    b= sqrt((x3-x1)**2 + (y3-y1)**2)
    c= sqrt((x2-x1)**2 + (y2-y1)**2)
    numerator, denominator= 2*b*c, b**2 + c**2 - a**2
    cosA= denominator / numerator
    sinA= sqrt(1 - (cosA)**2)
    r= a / (2*sinA)
    px= (x2-x1) / 2
    py= (y3-y1) / 2
    print("{0:.3f} {1:.3f} {2:.3f}".format(px, py, r))

Python: from math import *
def g(x):
    y = (int((1000 * abs(x)) * 2 + 1) // 2) / 1000
    if x < 0:
        y *= -1
    return y
'''
def f(x):
    a = (x[2] - x[4]) * (x[1] - x[3]) - (x[0] - x[2]) * (x[3] - x[5])
    b = (x[0] - x[2]) * (x[4] - x[0]) - (x[5] - x[1]) * (x[1] - x[3])
    l = 0.5 * b / a
    X = 0.5 * x[2] + 0.5 * x[4] + l * (x[3] - x[5])
    Y = 0.5 * x[3] + 0.5 * x[5] + l * (x[4] - x[2])
    R = sqrt((X - x[0]) ** 2 + (Y - x[1]) ** 2)
    X = g(X)
    Y = g(Y)
    R = g(R)
    print("{0:.3f} {1:.3f} {2:.3f}".format(X, Y, R))
'''
def f(x):
    x1, y1, x2, y2, x3, y3 = x
    X1 = x1 - x3
    Y1 = y1 - y3
    X2 = x2 - x3
    Y2 = y2 - y3
    k  = (X2 ** 2 + Y2 ** 2 -X1 * X2 - Y1 * Y2) / (2 * (X2 * Y1 - X1 * Y2))
    X  = X1 / 2 + k * Y1 + x3
    Y  = Y1 / 2 - k * X1 + y3
    R = sqrt((X - x1) ** 2 + (Y - y1) ** 2)
    X = g(X)
    Y = g(Y)
    R = g(R)
    print("{0:.3f} {1:.3f} {2:.3f}".format(X, Y, R))

n = int(input())
a = []
for _ in range(n):
    a.append(list((map(float, input().split()))))
for i in a:
    f(i)

Python: import sys,math
if sys.version_info[0]>=3: raw_input=input
N=int(raw_input())
for i in range(N):
	x1,y1,x2,y2,x3,y3=[float(e) for e in raw_input().split()]
	a1=2*x2-2*x1
	b1=2*y2-2*y1
	c1=x1*x1-x2*x2+y1*y1-y2*y2
	a2=2*x3-2*x1
	b2=2*y3-2*y1
	c2=x1*x1-x3*x3+y1*y1-y3*y3
	x=(b1*c2-b2*c1)/(a1*b2-a2*b1)
	y=(c1*a2-c2*a1)/(a1*b2-a2*b1)
	print('%.3f %.3f %.3f'%(x,y,math.hypot(x1-x,y1-y)))