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

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	
	int N=in();
	REP(i,N){
		double x1,y1,x2,y2,x3,y3;
		cin>>x1>>y1>>x2>>y2>>x3>>y3;

		double a=hypot(x2-x3,y2-y3);
		double b=hypot(x1-x3,y1-y3);
		double c=hypot(x2-x1,y2-y1);
		double coeff1 = a*a*(b*b+c*c-a*a);
		double coeff2 = b*b*(a*a+c*c-b*b);
		double coeff3 = c*c*(b*b+a*a-c*c);

		double x = (coeff1*x1+coeff2*x2+coeff3*x3)/(coeff1+coeff2+coeff3);
		if(abs(x)<=1e-7) x=0;
		double y = (coeff1*y1+coeff2*y2+coeff3*y3)/(coeff1+coeff2+coeff3);
		if(abs(y)<=1e-7) y=0;
		double r = hypot(x-x1,y-y1);
		
		printf("%.3lf %.3lf %.3lf\n",round(x*1000)/1000,round(y*1000)/1000,round(r*1000)/1000);
	}

	return 0;
}

C++: //#Circumscribed Circle of a Triangle

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int main() {
	double x1, y1, x2, y2, x3, y3;
	double px, py, r;
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		px = ((x2*x2+y2*y2-x1*x1-y1*y1)*(y1-y3) - (x3*x3+y3*y3-x1*x1-y1*y1)*(y1-y2)) / (-2*((x1-x2)*(y1-y3) - (x1-x3)*(y1-y2)));
		py = ((x2*x2+y2*y2-x1*x1-y1*y1)*(x1-x3) - (x3*x3+y3*y3-x1*x1-y1*y1)*(x1-x2)) / (-2*((y1-y2)*(x1-x3) - (y1-y3)*(x1-x2)));
		r = sqrt((x1-px)*(x1-px) + (y1-py)*(y1-py));
		
		printf("%.3f %.3f %.3f\n", px, py, r);
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>

using namespace std;

double sq(double x) {return x*x;}

void solve()
{
	double x1,y1,x2,y2,x3,y3;
	cin>>x1>>y1>>x2>>y2>>x3>>y3;
	double a,b,c,d,e,f;
	a = x2-x1; b = y2- y1;
	a*=2; b*= 2;
	c = sq(x2)-sq(x1)+sq(y2)-sq(y1);
	d = x3-x1; e = y3- y1;
	d *=2; e *= 2;
	f = sq(x3)-sq(x1)+sq(y3)-sq(y1);
    double det = a*e - b * d;
    double x = 1 / det * (c * e - b * f);
    double y = 1 / det * (f * a - c * d);
    if(x < 1e-5 && -1e-5 < x) x = 0.0;
    if(y < 1e-5 && -1e-5 < y) y = 0.0;
	double r = sqrt(sq(x - x1) + sq(y - y1));

	printf("%.3lf %.3lf %.3lf\n",x,y,r);
}

int main(){

	int t;
	cin >> t;
    while(t--){
		solve();
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<list>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;

struct Coor{
	double x,y;
};

struct Ans2{
	double l,m;
};

struct Ans3{
	double l,m,n;
	Ans3(Ans2 &a){
		l=a.l; m=a.m;
	}
};

Ans2 solve2(double l[2],double m[2],double n[2]){
	/*for(int i=0;i<2;i++){
		printf("(%lfl)+(%lfm)+n = (%lf)\n",l[i],m[i],n[i]);
	}*/
	Ans2 ans;
	double a,b;
	a = l[0]*m[1]-l[1]*m[0]; b = n[0]*m[1]-n[1]*m[0];
	ans.l = b/a;
	//printf("%lfx = %lf\n",a,b);
	a = m[0]*l[1]-m[1]*l[0]; b = n[0]*l[1]-n[1]*l[0];
	ans.m = b/a;
	//printf("%lfy = %lf\n",a,b);
	return ans;
}

Ans3 solve3(double l[3],double m[3],double n[3]){
	double _l[2],_m[2],_n[2];
	_l[0] = l[0]-l[1]; _l[1] = l[0]-l[2];
	_m[0] = m[0]-m[1]; _m[1] = m[0]-m[2];
	_n[0] = n[0]-n[1]; _n[1] = n[0]-n[2];
	Ans3 ans = Ans3(solve2(_l,_m,_n));
	ans.n = n[0]-(l[0]*ans.l+m[0]*ans.m);
	return ans;
}

int main(){
	int N;
	cin>>N;
	for(int i=0;i<N;i++){
		Coor in[3];
		double l[3],m[3],n[3];
		for(int i=0;i<3;i++){
			cin>>in[i].x>>in[i].y;
			l[i] = in[i].x;
			m[i] = in[i].y;
			n[i] = -(in[i].x*in[i].x+in[i].y*in[i].y);
			//printf("(%lfl)+(%lfm)+n = (%lf)\n",l[i],m[i],n[i]);
		}
		Ans3 ans3 = solve3(l,m,n);
		//printf("l = %lf, m = %lf, n = %lf\n",ans3.l,ans3.m,ans3.n);
		double r = sqrt(-(ans3.n-ans3.l/2*ans3.l/2-ans3.m/2*ans3.m/2));
		printf("%.3lf %.3lf %.3lf\n",-ans3.l/2,-ans3.m/2,r);
	}
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

#include <complex>

typedef complex<double> Point;

const double EPS = 1e-9;

bool eq( double a, double b )
{
	return abs( a - b ) < EPS;
}

bool eq( Point a, Point b )
{
	return eq( a.real(), b.real() ) && eq( a.imag(), b.imag() );
}

double getRadius( double a, double b, double c )
{
	return ( a * b * c ) / sqrt( ( a + b + c ) * ( -a + b + c ) * ( a - b + c ) * ( a + b - c ) );
}

double fix( double a )
{
	return abs( a ) < EPS ? 0 : a;
}

void solve( Point a, Point b, Point c )
{
	double ab = abs( a - b );

	Point unit_ab = ( b - a ) / ab;
	Point mid_ab = Point( ( b - a ).real() / 2, ( b - a ).imag() / 2 );
	Point norm_ab1 = Point( -( unit_ab.imag() ), unit_ab.real() ), norm_ab2 = Point( unit_ab.imag(), -( unit_ab.real() ) );

	double r = getRadius( abs( a - b ), abs( b - c ), abs( c - a ) );
	double t = sqrt( pow( r, 2 ) - pow( ab / 2, 2 ) );

	Point o1 = mid_ab + norm_ab1 * t, o2 = mid_ab + norm_ab2 * t;

	if ( !eq( abs( o1 - c ), r ) )
	{
		swap( o1, o2 );
	}

	cout << fix( o1.real() ) << ' ' << fix(  o1.imag() ) << ' ' << fix( r ) << endl;

	return;
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	cout.precision( 3 );
	cout << fixed;

	int n;
	cin >> n;

	REP( i, 0, n )
	{
		double a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;

		solve( Point( a, b ), Point( c, d ), Point( e, f ) );
	}

	return 0;
}