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

using namespace std;

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

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		double x1, y1, x2, y2, x3, y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; 
		double a, b, c;
		a = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
		b = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
		c = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		double s = (a+b+c)/2.0;
		double S = sqrt(s*(s-a)*(s-b)*(s-c));
		double p1, p2, pr;
		p1 = (a*a*(b*b+c*c-a*a)*x1+b*b*(c*c+a*a-b*b)*x2+c*c*(a*a+b*b-c*c)*x3)/(16.0*S*S);
		p2 = (a*a*(b*b+c*c-a*a)*y1+b*b*(c*c+a*a-b*b)*y2+c*c*(a*a+b*b-c*c)*y3)/(16.0*S*S);
		pr = (a*b*c)/sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c));
		p1 = sisya(p1);
		p2 = sisya(p2);
		pr = sisya(pr);
		printf("%.3f %.3f %.3f\n", p1, p2, pr);
	}
	return 0;
}