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: # 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
            if points_list[2][1] == points_list[0][1]:
                px = (points_list[0][0] + points_list[2][0])/2
            else:
                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
            if points_list[2][1] == points_list[0][1]:
                px = (points_list[0][0]+points_list[2][0])/2
            else:
                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[0][1] == points_list[1][1]:
            px = (points_list[0][0] + points_list[1][0])/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
            py = a2*px + b2
        elif points_list[0][1] == points_list[2][1]:
            px = (points_list[0][0] + points_list[2][0])/2
            a1_s = (points_list[1][1] - points_list[0][1]) / (points_list[1][0] - points_list[0][0])
            a1 = -1 / a1_s
            m12x = (points_list[0][0] + points_list[1][0]) / 2
            m12y = (points_list[0][1] + points_list[1][1]) / 2
            b1 = m12y - a1 * m12x
            py = a1 * px + b1
        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
while True:
    t=input()
    if t == "":break
    l=t.split()
    px=sum(l[0::2])/3
    py=sum(l[1::2])/3
    r=math.sqrt((l[0]-px)**2+(l[1]-py)**2)
    print("{0} {1} {2}".format([round(i,3) for i in[px,py,r]]))

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3 = map(float, input().split())
    c = (x1-x2)**2 + (y1-y2)**2
    a = (x2-x3)**2 + (y2-y3)**2
    b = (x3-x1)**2 + (y3-y1)**2
    # 16s^2
    s = 2*(a*b + b*c + c*a) - (a*a + b*b + c*c)

    px = (a*(b+c-a)*x1 + b*(c+a-b)*x2 + c*(a+b-c)*x3) / s
    py = (a*(b+c-a)*y1 + b*(c+a-b)*y2 + c*(a+b-c)*y3) / s

    ar = a**0.5
    br = b**0.5
    cr = c**0.5

    r = ar*br*cr / ((ar+br+cr)*(-ar+br+cr)*(ar-br+cr)*(ar+br-cr))**0.5

    print("{:>.3f}".format(px),"{:>.3f}".format(py),"{:>.3f}".format(r))

Python: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3 = map(float, input().split())
    d = 2 * (x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3 + x1 * y2 - x2 * y1)
    px = ((y2 - y3) * (x1 ** 2 + y1 ** 2) + (y3 - y1) * (x2 ** 2 + y2 ** 2) + (y1 - y2) * (x3 ** 2 + y3 ** 2)) / d
    py = -1 * ((x2 - x3) * (x1 ** 2 + y1 ** 2) + (x3 - x1) * (x2 ** 2 + y2 ** 2) + (x1 - x2) * (x3 ** 2 + y3 ** 2)) / d
    print('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, ((x1 - px) ** 2 + (y1 - py) ** 2) ** 0.5))

Python: def solve():
    from sys import stdin
    f_i = stdin
    
    n = int(f_i.readline())
    for i in range(n):
        x1, y1, x2, y2, x3, y3 = map(float, f_i.readline().split())
        A = x1 + y1 * 1j
        B = x2 + y2 * 1j
        C = x3 + y3 * 1j
        a = abs(C - B)
        b = abs(A - C)
        c = abs(B - A)
        c1 = a**2 * (b**2 + c**2 - a**2)
        c2 = b**2 * (c**2 + a**2 - b**2)
        c3 = c**2 * (a**2 + b**2 - c**2)
        
        U = (c1 * A + c2 * B + c3 * C) / (c1 + c2 + c3)
        R = abs(U - A)
        
        print('{:.3f} {:.3f} {:.3f}'.format(U.real, U.imag, R))

solve()

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)))

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()
        print(points_list)

        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))