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

C++: /* Karen {{{
  ___  ____
 |_  ||_  _|
   | |_/ /    ,--.   _ .--.  .---.  _ .--.
   |  __'.   `'_\ : [ `/'`\]/ /__\\[ `.-. |
  _| |  \ \_ // | |, | |    | \__., | | | |
 |____||____|\'-;__/[___]    '.__.'[___||__]
}}} */
// include {{{
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <math.h>
#include <string>
#include <vector>
#include <complex>
#include <iostream>
#include <algorithm>

using namespace std;

// }}}
/* cpp template {{{*/


#define endl '\n'
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define X real()
#define Y imag()
#define EQ(n,m) (abs((n)-(m)) < EPS)

typedef double D;      // ??§?¨?????????????double???long double?????????
typedef long long ll;
typedef long double lb;
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<string, int> psi;

inline bool inside(int y, int x, int H, int W){return (y >= 0 && x >= 0 && y < H && x < W);}
inline int in() {int x; std::cin >> x; return x;}

template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}

/* ?????° */
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 9;
const D EPS  = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};


/* }}} */

D cross(P a, P b) {
  return (conj(a)*b).Y;
}

P crosspointLL(P a1, P a2, P b1, P b2) {
  D d1 = cross(b2-b1, b1-a1);
  D d2 = cross(b2-b1, a2-a1);
  if (EQ(d1, 0) && EQ(d2, 0)) return a1;  // same line
  if (EQ(d2, 0)) throw "kouten ga nai";   // ???????????????
  return a1 + d1/d2 * (a2-a1);
}

P circumcenter(P a, P b, P c) {
  a = (a-c)*0.5;
  b = (b-c)*0.5;
  return c + crosspointLL(a, a*P(1,1), b, b*P(1,1));
}

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

  int x = in();
  
  for (int i = 0; i < x; i++){
    D a1, a2, b1, b2, c1, c2;
    cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
    P p = circumcenter( P(a1, a2), P(b1, b2), P(c1, c2));
    D r = sqrt(pow(a1 - p.X, 2) + pow(a2 - p.Y, 2));
    printf("%.4f %.4f %.4f", p.X, p.Y, r);
    cout << endl;
  }
  return (0);
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
    int num;
    cin >> num;
    double x1, x2, x3, y1, y2, y3;
    double px, py, r;
    double a, b, c, d, e, f;

    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3)
    {
        a = 2 * (x1 - x2);
        b = 2 * (y1 - y2);
        c = 2 * (x2 - x3);
        d = 2 * (y2 - y3);
        e = x1*x1 - x2*x2 + y1*y1 - y2*y2;
        f = x2*x2 - x3*x3 + y2*y2 - y3*y3;
        px = (d*e - b*f) / (a*d - b*c);
        py = (a*f - c*e) / (a*d - b*c);
        r = sqrt((px - x1)*(px - x1) + (py - y1)*(py - y1));

        cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
    }
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
	double n;
	double x1, x2, x3 ,y1, y2, y3;
	cin >> n;
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
	double px, py, r;
	double A = (x2 - x1)*(y3 - y2) - (y2 - y1)*(x3 - x2);
	px = 0.5*((y3 - y2)*(x2*x2 - x1*x1 + y2*y2 - y1*y1) - (y2 - y1)*(x3*x3 - x2*x2 +y3*y3 - y2*y2)) / A;
	py = 0.5*(-(x3 - x2)*(x2*x2 - x1*x1 + y2*y2 - y1*y1) + (x2 - x1)*(x3*x3 - x2*x2+y3*y3 - y2*y2)) / A;
	double a = px - x1;
	double b = py - y1;
	double r0 = (a*a + b*b);
	double r1 = sqrt(r0);
	cout << fixed << setprecision(10) << px << ' ' << py << ' ' << r1 <<  endl;
}

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

const double EPS = 1e-9;

struct Point
{
	double x, y;

	Point() : x( 0 ), y( 0 ) {}
	Point( const double x, const double y ) : x( x ), y( y ) {}
	Point( const Point &a ) : x( a.x ), y( a.y ) {}
	
	Point operator + ( const Point &a ) const
	{
		return Point( x + a.x, y + a.y );
	}

	Point& operator += ( const Point &a ) 
	{
		x += a.x;
		y += a.y;

		return *this;
	}

	Point operator - ( const Point &a ) const
	{
		return Point( x + ( -a.x ), y + ( -a.y ) );
	}

	Point& operator -= ( const Point &a )
	{
		x -= a.x;
		y -= a.y;

		return *this;
	}

	Point operator * ( const double &a ) const
	{
		return Point( x * a, y * a );
	}

	Point& operator *= ( const double &a )
	{
		x *= a;
		y *= a;

		return *this;
	}

	Point operator / ( const double &a ) const
	{
		return Point( x / a, y / a );
	}

	Point& operator /= ( const double &a )
	{
		x /= a;
		y /= a;

		return *this;
	}

	bool operator < ( const Point &a ) const
	{
		return x == a.x ? y < a.y : x < a.x;
	}

	double abs() const
	{
		return sqrt( pow( x, 2. ) + pow( y, 2. ) );
	}
};

double distance( const Point &a, const Point &b )
{
	return sqrt( pow( a.x - b.x, 2. ) + pow( a.y - b.y, 2. ) );
}

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

void solve()
{
	Point A, B, C;

	cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y;
	double a = distance( B, C ), b = distance( C, A ), c = distance( A, B );

	double cosA = ( pow( b, 2. ) + pow( c, 2. ) - pow( a, 2. ) ) / ( 2 * b * c );
	double sinA = sin( acos( cosA ) );
	double r = abs( a / sinA ) / 2;

	Point midAB = ( A + B ) / 2, AB = B - A;
	Point normAB = Point( AB.y, -AB.x );
	normAB /= normAB.abs();
	
	double AM = distance( A, midAB );
	double t = sqrt( pow( r, 2. ) - pow( AM, 2. ) );
	Point res1;

	if ( eq( distance( midAB + normAB * t, A ), distance( midAB + normAB * t, C ) ) )
	{
		res1 = midAB + normAB * t;
	}
	else if ( eq( distance( midAB + normAB * -t, A ), distance( midAB + normAB * -t, C ) ) )
	{
		res1 = midAB + normAB * -t;
	}
	else
	{
		abort();
	}

	cout << res1.x << ' ' << res1.y << ' ' << 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 )
	{
		solve();
	}

	return 0;
}