#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <functional>
#include <complex>
#include <cmath>
using namespace std;
#define P complex<double>
#define X real()
#define Y imag()
#define EPS 1e-10

class Triangle {
	private:
		P a, b, c;
		double edgeA, edgeB, edgeC;
		double angleA, angleB, angleC;
		double getAngle(double e1, double e2, double e3) {
			return acos((e2 * e2 + e3 * e3 - e1 * e1) / (2 * e2 * e3));
		}
	public:
		Triangle(P p1, P p2, P p3) : a(p1), b(p2), c(p3) {
			edgeA = abs(b - c);
			edgeB = abs(c - a);
			edgeC = abs(a - b);
			angleA = getAngle(edgeA, edgeB, edgeC);
			angleB = getAngle(edgeB, edgeC, edgeA);
			angleC = getAngle(edgeC, edgeA, edgeB);
		}
		
		double getCircumscribedCircleRadius() {
			return edgeA / sin(angleA) / 2;
		}
		
		P getCircumscribedCirclePoint() {
			double A = sin(2 * angleA);
			double B = sin(2 * angleB);
			double C = sin(2 * angleC);
			P p;
			p.X = (a.X * A + b.X * B + c.X * C) / (A + B + C);
			p.Y = (a.Y * A + b.Y * B + c.Y * C) / (A + B + C);
			
			return p;
		}
};

int main()
{	
	int n;
	cin >> n;
	while (n--) {
		P p1, p2, p3;
		scanf("%lf %lf %lf %lf %lf %lf", &p1.X, &p1.Y, &p2.X, &p2.Y, &p3.X, &p3.Y);
		Triangle tr(p1, p2, p3);
		P p = tr.getCircumscribedCirclePoint();
		double r = tr.getCircumscribedCircleRadius();
		
		printf("%.3f %.3f %.3f\n", p.X, p.Y, r);
	}
		
	return 0;
}