Go: package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	n := r.nextInt()

	type Vec struct {
		x, y float64
	}
	vec := func(a, b Vec) Vec { return Vec{b.x - a.x, b.y - a.y} }
	unv := func(a Vec) Vec { return Vec{-a.y, a.x} }
	cdot := func(a, b Vec) float64 { return a.x*b.x + a.y*b.y }
	times := func(t float64, a Vec) Vec { return Vec{t * a.x, t * a.y} }
	add := func(a, b Vec) Vec { return Vec{a.x + b.x, a.y + b.y} }
	for i := 0; i < n; i++ {

		r.Scan(true)
		nextFloat64 := func() (ret float64) { fmt.Sscanf(r.nextString(), "%f", &ret); return }
		a1, a2, a3 := Vec{nextFloat64(), nextFloat64()}, Vec{nextFloat64(), nextFloat64()}, Vec{nextFloat64(), nextFloat64()}
		unv23 := unv(vec(a2, a3))
		v12 := vec(a1, a2)
		v31 := vec(a3, a1)
		s := cdot(v12, v31) / 2 / cdot(v12, unv23)
		c := add(times(.5, add(a2, a3)), times(s, unv23))
		v1c := vec(a1, c)
		fmt.Fprintf(stdout, "%.3f %.3f %.3f\n", c.x, c.y, math.Sqrt(v1c.x*v1c.x+v1c.y*v1c.y))
	}
}

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def distance(x1, y1, x2, y2):
    return math.sqrt((x1-x2)**2 + (y1-y2)**2)

def intersection(a1, a2, b1, b2):
    x1,y1 = a1
    x2,y2 = a2
    x3,y3 = b1
    x4,y4 = b2

    ksi = (y4 - y3) * (x4 - x1) - (x4 - x3) * (y4 - y1)
    eta = (x2 - x1) * (y4 - y1) - (y2 - y1) * (x4 - x1)
    delta = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3)
    if delta == 0:
        return None
    ramda = ksi / delta;
    mu = eta / delta;
    if ramda >= 0 and ramda <= 1 and mu >= 0 and mu <= 1:
        return (x1 + ramda * (x2 - x1), y1 + ramda * (y2 - y1))

    return None

def circumcenters(a,b,c):
    t1 = [(a[0]+b[0])/2, (a[1]+b[1])/2]
    s1 = [t1[1]-a[1], a[0]-t1[0]]
    t2 = [(a[0]+c[0])/2, (a[1]+c[1])/2]
    s2 = [t2[1]-a[1], a[0]-t2[0]]
    p1 = [t1[0]+s1[0]*1e7, t1[1]+s1[1]*1e7]
    p2 = [t1[0]-s1[0]*1e7, t1[1]-s1[1]*1e7]
    p3 = [t2[0]+s2[0]*1e7, t2[1]+s2[1]*1e7]
    p4 = [t2[0]-s2[0]*1e7, t2[1]-s2[1]*1e7]
    return intersection(p1,p2,p3,p4)

def main():
    n = I()
    rr = []
    for _ in range(n):
        x1,y1,x2,y2,x3,y3 = LF()
        a = [x1,y1]
        b = [x2,y2]
        c = [x3,y3]
        t = circumcenters(a,b,c)
        rr.append('{:0.3f} {:0.3f} {:0.3f}'.format(t[0], t[1], distance(t[0],t[1],x1,y1)))

    return '\n'.join(rr)


print(main())

Python: import math
N = int(input())
for i in range(N):
	x1,y1,x2,y2,x3,y3 = map(float,input().split())
	
	x =((y1-y3)*(y1*y1 -y2*y2 +x1*x1 -x2*x2) -(y1-y2)*(y1*y1 -y3*y3 +x1*x1 -x3*x3)) / (2*((y1-y3)*(x1-x2)-(y1-y2)*(x1-x3)))
	y =((x1-x3)*(x1*x1 -x2*x2 +y1*y1 -y2*y2) -(x1-x2)*(x1*x1 -x3*x3 +y1*y1 -y3*y3)) / (2*((x1-x3)*(y1-y2)-(x1-x2)*(y1-y3)))
	r = (x-x1)*(x-x1)+(y-y1)*(y-y1)
	print("{0:.3f} {1:.3f} {2:.3f}".format(x,y,math.sqrt(r)))

Python: from math import sqrt
n = int(input())

for i in range(n):
    l = input()
    x1,y1,x2,y2,x3,y3=map(float,l.split(' '))
    a_2 = (x1 - x2)**2 + (y1 - y2)**2
    b_2 = (x2 - x3)**2 + (y2 - y3)**2
    c_2 = (x3 - x1)**2 + (y3 - y1)**2
    cos_a_2 = (b_2 + c_2 - a_2)**2/(4* b_2 * c_2)
    sin_a_2 = 1 - cos_a_2
    r = round(sqrt(a_2/sin_a_2)/2,3)
    a = (x1**2 - x3**2 + y1**2 - y3**2)*(x2 - x1)
    b = (x1**2 - x2**2 + y1**2 - y2**2)*(x3 - x1)
    c = (y2 - y1)*(x3 - x1)
    d = (y3 - y1)*(x2 - x1)
    py = round((a-b)/(c-d)/2,3) + 0
    a = (x1**2 - x3**2 + y1**2 - y3**2)*(y2 - y1)
    b = (x1**2 - x2**2 + y1**2 - y2**2)*(y3 - y1)
    c = (x2 - x1)*(y3 - y1)
    d = (x3 - x1)*(y2 - y1)
    px = round((a-b)/(c-d)/2,3) + 0
    print('%.3f %.3f %.3f' %(px, py, r))

Python: import sys

def take2(iterable):
    while True:
        yield next(iterable), next(iterable)
#外積
def cross(v1, v2):
    return v1.real * v2.imag - v1.imag * v2.real
# 線分13と線分24の交点を求める
def get_intersection(p1,p2,p3,p4):
    a1 = p4 - p2
    b1 = p2 - p3
    b2 = p1 - p2
    s1 = cross(a1, b2) / 2
    s2 = cross(a1, b1) / 2
    return p1 + (p3 - p1) * s1 / (s1 + s2)

n = int(f.readline())
for i in range(n):
    p1, p2, p3 = [x + y * 1j for x, y in take2(map(float, f.readline().split()))]
    p12 = (p1 + p2) / 2
    p13 = (p1 + p3) / 2
    pxy = get_intersection(p12,p13,p12 + (p2 - p1) * 1j,p13 + (p1 - p3) * 1j)
    r = abs(pxy - p1)
    print('{:.3f} {:.3f} {:.3f}'.format(pxy.real,pxy.imag,r))

Python: import math
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,math.hypot(x-a,y-b)))