#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

long double sisya(long double a) {
	a *= 1000.0;
	if (a-(int)a >= 0.5) {
		a += 1.0;
	}
	a /= 1000.0;
	return a; 
}

double ll(double x1, double y1, double x2, double y2) {
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

double yoge(double a, double b, double c) {
	return (b*b+c*c-a*a)/(2.0*b*c);
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		long double dd[3][2];
		for (int j = 0; j < 3; j++) {
			cin >> dd[j][0] >> dd[j][1];
		}
		long double s[3];
		s[0] = ll(dd[1][0],dd[1][1],dd[2][0],dd[2][1]);
		s[1] = ll(dd[2][0],dd[2][1],dd[0][0],dd[0][1]);
		s[2] = ll(dd[0][0],dd[0][1],dd[1][0],dd[1][1]);
		long double k[3];
		k[0] = acos(yoge(s[0],s[1],s[2]));
		k[1] = acos(yoge(s[1],s[2],s[0]));
		k[2] = acos(yoge(s[2],s[0],s[1]));
		long double X, Y, R;
		X = (dd[0][0]*sin(2.0*k[0])+dd[1][0]*sin(2.0*k[1])+dd[2][0]*sin(2.0*k[2]))/(sin(2.0*k[0])+sin(2.0*k[1])+sin(2.0*k[2]));
		Y = (dd[0][1]*sin(2.0*k[0])+dd[1][1]*sin(2.0*k[1])+dd[2][1]*sin(2.0*k[2]))/(sin(2.0*k[0])+sin(2.0*k[1])+sin(2.0*k[2]));
		R = s[0]/(2.0*sin(k[0]));
		printf("%.3f %.3f %.3f\n", X, Y, R);
	}
	return 0;
}