#include <cmath>
#include <cstdio>

int main() {
	int sampleNum;
	scanf("%d", &sampleNum);
	for (; sampleNum > 0; --sampleNum) {
		double x1, y1, x2, y2, x3, y3;
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);

		double ax = x2 - x1;
		double ay = y2 - y1;
		double a = sqrt(ax * ax + ay * ay);
		double bx = x3 - x1;
		double by = y3 - y1;
		double b = sqrt(bx * bx + by * by);
		double cx = x3 - x2;
		double cy = y3 - y2;
		double c = sqrt(cx * cx + cy * cy);

		double crossabz = ax * by - ay * bx;
		double crossbcz = bx * cy - by * cx;
		double crosscaz = cx * ay - cy * ax;

		double sinA = crossbcz / (b * c);
		double sinB = crosscaz / (c * a);
		double sinC = crossabz / (a * b);
		double sin2A = sin(2.*asin(sinA));
		double sin2B = sin(2.*asin(sinB));
		double sin2C = sin(2.*asin(sinC));
		double px = (sin2A * x1 + sin2B * x2 + sin2C * x3) / (sin2A + sin2B + sin2C);
		double py = (sin2A * y1 + sin2B * y2 + sin2C * y3) / (sin2A + sin2B + sin2C);

		double s = abs(crossabz) / 2.;
		double r = a * b * c / (4. * s);

		printf("%.3lf %.3lf %.3lf\n", px, py, r);
	}
	return 0;
}