//0010 Circumscribed Circle of A Triangle.
/*
½ÊãÌ_ (x1, y1)(x2, y2)(x3, y3) ð¸_Æµ½Op`Ì
OÚ~ÌSÀW(xp, yp)Æ¼a r ðoÍµÄI¹·évOðì¬µÄ­¾³¢B
x1, y1, x2, y2, x3, y3, xp, yp ÍA»ê¼ê -100 Èã 100 ÈºÌÀÆµÜ·B 

ÅÉf[^ZbgÌnª^¦çêÜ·
oÍÍA¬_Èºæ4ÅlÌÜüµÄAxp, yp, rð¼pXy[XÅæØÁÄ­¾³¢
*/

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;


//¼a@http://blog.livedoor.jp/calc/archives/9248011.html
//OS_@http://homepage2.nifty.com/gis_yasu21/sub1.htm

template<class T>
struct Point
{
	T x, y;
	Point(){}
	Point(T x, T y):x(x),y(y){}
};
template<class T>
T Square(const T &x)
{
	return x*x;
}
template<class T>
T Distance(const Point<T> &a, const Point<T> &b)
{
	return sqrt( Square(a.x-b.x) + Square(a.y-b.y) );
}

int main(void)
{
	const int N = 3;
	int n;
	Point<double> p[N], o;
	double r;
	int i, j;

	cin >> n;
	for(i = 0; i < n; i++)
	{
		for(j = 0; j < N; j++)
			cin >> p[j].x >> p[j].y;

		//wÌö®ÅOÚ~ÌÊÏðßé
		double a, b, c, s, S;
		a = Distance(p[1], p[2]);
		b = Distance(p[2], p[0]);
		c = Distance(p[0], p[1]);
		s = (a+b+c)/2;
		S = sqrt(s*(s-a)*(s-b)*(s-c));
		//abc/4SªOS~Ì¼a@¿ÈÝÉS/sÍàS~Ì¼a
		r = (a*b*c) / (4*S);

		//S = (1/2)*bc*sinAæè
		double sinA, sinB, sinC;
		sinA = 2*S/b/c;
		sinB = 2*S/c/a;
		sinC = 2*S/a/b;
		//]·èæèAa^2 = b^2 + c^2 - 2bc*cosA
		double cosA, cosB, cosC;
		cosA = (Square(b)+Square(c)-Square(a)) / (2*b*c);
		cosB = (Square(c)+Square(a)-Square(b)) / (2*c*a);
		cosC = (Square(a)+Square(b)-Square(c)) / (2*a*b);
		//sin(2A) = 2*sinA*cosA
		double sin2A, sin2B, sin2C;
		sin2A = 2*sinA*cosA;
		sin2B = 2*sinB*cosB;
		sin2C = 2*sinC*cosC;
		//OS~ÌXÀWÍA(x1*sin2A + x2*sin2B + x3*sin2C) / (sin2A+sin2B+sin2C)AyÀWà¯l
		o.x = (p[0].x*sin2A + p[1].x*sin2B + p[2].x*sin2C) / (sin2A + sin2B + sin2C);
		o.y = (p[0].y*sin2A + p[1].y*sin2B + p[2].y*sin2C) / (sin2A + sin2B + sin2C);

		
		//¬_Èºà\¦·éæ¤ÉµA¬_æ4ðlÌÜü·é
		cout << setprecision(3);
		cout << setiosflags(ios::fixed);
		cout << o.x << ' ' << o.y << ' ' << r << endl;
	}

	return 0;
}