 /*
Write a program which prints the central coordinate (px, py) and the radius r of a circumscribed circle of a triangle which is constructed by three points (x1, y1)(x2, y2)(x3, y3) on the plane surface.
 */

#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>

using namespace std;

 /*
http://zo3kirin3.net/?p=297
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q104383420
http://www.nn.iij4u.or.jp/~hsat/misc/math/centre/circumcentre.html
 */

int main() {
	int n; cin >> n;
	vector<double> x(3), y(3), x2(3), y2(3);		// x,yªÀWÌXgAx2,y2ªÀWÌñæÌXg
	
	for (int p=0; p<n; p++) {
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
		for (int i=0; i<3; i++) {
			x2[i] = pow(x[i], 2);
			y2[i] = pow(y[i], 2);
		}
		
		// eÓÌ·³ðßéBO½ûÌèðp
		double a, b, c, a2, b2, c2;
		a2 = abs(pow(x[2]-x[1], 2)+pow(y[2]-y[1], 2));
		b2 = abs(pow(x[0]-x[2], 2)+pow(y[0]-y[2], 2));
		c2 = abs(pow(x[1]-x[0], 2)+pow(y[1]-y[0], 2));
		a = sqrt(a2); b = sqrt(b2); c = sqrt(c2);
		
		// ÊÏBwÌö®ðpB
		double s, S2;
		s = (a+b+c) / 2;
		S2 = s+(s-a)+(s-b)+(s-c);
		
		// OSðßéBö®ÍWeby[WðQÆ©xNgâÁÄÈ¢©çà¾Å«È¢c
		double px, py;
		px = (a2*(b2+c2-a2)*x[0] + b2*(c2+a2-b2)*x[1] + c2*(a2+b2-c2)*x[2]) / (16 * S2);
        py = (a2*(b2+c2-a2)*y[0] + b2*(c2+a2-b2)*y[1] + c2*(a2+b2-c2)*y[2]) / (16 * S2);
        
        // oÍB®`µÄoÍ·éB¼aÍ¼üÌûö®ÅB
        cout << setprecision(3) << fixed << px << " " << py << " " << sqrt(abs(pow(px-x[0], 2)+pow(py-y[0], 2))) << endl;
	}
	
	return 0;
}