#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

struct Point
{
	double x, y;

	Point() : x( 0 ), y( 0 )
	{
		return;
	}

	Point( double x, double y ) : x( x ), y( y )
	{
		return;
	}

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

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

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

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

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

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

double tri2cos( const double &a, const double &b, const double &c )
{
	return ( pow( b, 2. ) + pow( c, 2. ) - pow( a, 2. ) ) / ( 2 * b * c );
}

double cos2sin( const double &cos )
{
	return sqrt( abs( 1 / pow( cos, 2. ) ) );
}

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( A, C ), c = distance( A, B );

	double cosA = tri2cos( a, b, c ), cosB = tri2cos( b, c, a ), cosC = tri2cos( c, a, b );
	double sinA = sqrt( abs( 1 / pow( cosA, 2. ) ) );

	double r = a / sinA;
	
	double sin2A = sin( 2 * acos( cosA ) ), sin2B = sin( 2 * acos( cosB ) ), sin2C = sin( 2 * acos( cosC ) );

	Point o = ( A * sin2A + B * sin2B + C * sin2C ) / ( sin2A + sin2B + sin2C );

	cout << o.x << ' ' << o.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;
}