Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var num int
	fmt.Scan(&num)
	for i := 0; i < num; i++ {
		var x1, y1, x2, y2, x3, y3 float64
		fmt.Scanf("%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3)

		a := 2 * (x2 - x1)
		b := 2 * (y2 - y1)
		c := 2 * (x3 - x1)
		d := 2 * (y3 - y1)
		e := x2*x2 - x1*x1 + y2*y2 - y1*y1
		f := x3*x3 - x1*x1 + y3*y3 - y1*y1

		// 直線1: ax + by - e = 0
		// 直線2: cx + dy - f = 0
		px := (d*e - b*f) / (a*d - b*c)
		py := (c*e - a*f) / (b*c - a*d)
		r := math.Sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1))
		fmt.Printf("%.3f %.3f %.3f\n", px, py, 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 = -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 + (x - y1)**2)

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

Python: n = int(input())
datasets = [0]*n
#datasets[k] == [x1k,y1k,x2k,y2k,x3k,y3k]
for i in range(0,n):
  datasets[i] = list(map(float,input().split()))



for data in datasets:
  x=((data[0]+data[2])*(data[0]-data[2])*(data[1]-data[5])+(data[1]+data[3])*(data[1]-data[3])*(data[1]-data[5])-(data[0]+data[4])*(data[0]-data[4])*(data[1]-data[3])-(data[1]+data[5])*(data[1]-data[5])*(data[1]-data[3]))/(2*((data[0]-data[2])*(data[1]-data[5])-(data[0]-data[4])*(data[1]-data[3])))
  y=((data[1]+data[3])*(data[1]-data[3])*(data[0]-data[4])+(data[0]+data[2])*(data[0]-data[2])*(data[0]-data[4])-(data[1]+data[5])*(data[1]-data[5])*(data[0]-data[2])-(data[0]+data[4])*(data[0]-data[4])*(data[0]-data[2]))/(2*((data[1]-data[3])*(data[0]-data[4])-(data[1]-data[5])*(data[0]-data[2])))
  r=((x-data[0])**2+(y-data[1])**2)**(1/2)
  print("{0:.3f} {1:.3f} {2:.3f}\n".format(x,y,r))

Python: import math
n=int(input())
for i in range(n):
 x1,y1,x2,y2,x3,y3=[int(i) for i in input().split()]
 px=(x1+x2+x3)/3
 py=(y1+y2+y3)/3
 r=math.sqrt((x1-px)**2+(y1-py)**2)
 print(round(px,3),round(py,3),round(r,3))

Python: for _ in [0]*int(input()):
    a,d,b,e,c,f=map(float,input().split())
    z=2*(b*f-c*e+c*d-a*f+a*e-b*d)
    x=((e-f)*(a**2+d**2)+(f-d)*(b**2+e**2)+(d-e)*(c**2+f**2))/z
    y=((c-b)*(a**2+d**2)+(a-c)*(b**2+e**2)+(b-a)*(c**2+f**2))/z
    print('{0:.3f} {1:.3f} {2:.3f}'.format(x,y,((a-x)**2+(d-y)**2)**0.5))

Python: # coding=utf-8
import math


if __name__ == '__main__':
    n = int(input())
    for i in range(n):
        x1, y1, x2, y2, x3, y3 = map(float, input().split())
        points_list = [[x1, y1], [x2, y2], [x3, y3]]
        points_list.sort()

        if points_list[0][0] == points_list[1][0]:
            py = (points_list[0][1] + points_list[1][1])/2
            a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0])
            a2 = -1/a2_s
            m13x = (points_list[0][0] + points_list[2][0])/2
            m13y = (points_list[0][1] + points_list[2][1])/2
            b2 = m13y - a2*m13x
            px = (py - b2)/a2
        elif points_list[1][0] == points_list[2][0]:
            py = (points_list[1][1] + points_list[2][1])/2
            a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0])
            a2 = -1/a2_s
            m13x = (points_list[0][0] + points_list[2][0])/2
            m13y = (points_list[0][1] + points_list[2][1])/2
            b2 = m13y - a2*m13x
            px = (py - b2)/a2
        else:
            a1_s = (points_list[1][1] - points_list[0][1])/(points_list[1][0] - points_list[0][0])
            a1 = -1/a1_s
            a2_s = (points_list[2][1] - points_list[0][1])/(points_list[2][0] - points_list[0][0])
            a2 = -1/a2_s
            m12x = (points_list[0][0] + points_list[1][0]) / 2
            m12y = (points_list[0][1] + points_list[1][1]) / 2
            m13x = (points_list[0][0] + points_list[2][0]) / 2
            m13y = (points_list[0][1] + points_list[2][1]) / 2
            b1 = m12y - a1 * m12x
            b2 = m13y - a2 * m13x
            px = (b2 - b1)/(a1 - a2)
            py = a1*px + b1
        r = math.sqrt(math.pow((px-points_list[0][0]), 2) + math.pow((py-points_list[0][1]), 2))
        print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, r))

Python: import math

def length(ax, ay, bx, by):
    return math.sqrt((ax - bx)**2 + (ay - by)**2)

n = int(input())
for i in range(n):
    ax, ay, bx, by, cx, cy = map(float, input().split())
    ab = length(ax, ay, bx, by)
    bc = length(bx, by, cx, cy)
    ca = length(cx, cy, ax, ay)
    s = (ab + bc + ca) / 2.0
    area = math.sqrt(s * (s - ab) * (s - bc) * (s - ca))
    sinA = area * 2.0 / bc
    angleB = math.asin(sinA / ab)
    angleC = math.asin(sinA / ca)
    angleA = math.pi - angleB - angleC
    sin2A = math.sin(2.0 * angleA)
    sin2B = math.sin(2.0 * angleB)
    sin2C = math.sin(2.0 * angleC)
# 外心の計算
    center_x = (ax * sin2A + bx * sin2B + cx * sin2C) / (sin2A + sin2B + sin2C)
    center_y = (ay * sin2A + by * sin2B + cy * sin2C) / (sin2A + sin2B + sin2C)
# 半径の計算
    radius = bc / math.sin(angleA) / 2.0
    print("{0:.3f} {1:.3f} {2:.3f}".format(center_x, center_y, radius))

Python: n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = map(float, input().split())
    px = ((y1-y3) * (y1**2-y2**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))
    py = ((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))
    r = ((x1 - px)**2 + (y1 - py)**2)**0.5
    print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, r))

Python: n = int(input())
datasets = [0]*n
#datasets[k] == [x1k,y1k,x2k,y2k,x3k,y3k]
for i in range(0,n):
  datasets[i] = list(map(float,input().split()))

for data in datasets:
  x1p2=(data[0]+data[2])
  x1m2=(data[0]-data[2])
  x1p3=(data[0]+data[4])
  x1m3=(data[0]-data[4])
  y1p2=(data[1]+data[3])
  y1m2=(data[1]-data[3])
  y1p3=(data[1]+data[5])
  y1m3=(data[1]-data[5])
  x=(x1p2*x1m2*y1m3+y1p2*y1m2*y1m3-x1p3*x1m3*y1m2-y1p3*y1m3*y1m2)/(2*(x1m2*y1m3-x1m3*y1m2))
  y=(y1p2*y1m2*x1m3+x1p2*x1m2*x1m3-y1p3*y1m3*x1m2-x1p3*x1m3*x1m2)/(2*(y1m2*x1m3-y1m3*x1m2))
  r=((x-data[0])**2+(y-data[1])**2)**(1/2)
  if x == 0.000:
    x=0
  if y == 0.000:
    y=0
  print("{0:.3f} {1:.3f} {2:.3f}".format(x,y,r))