#define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

double distance(double x0, double y0, double x1, double y1)
{
	double x = x1 - x0;
	double y = y1 - y0;

	return sqrt(x * x + y * y);
}

int main()
{
	int n;
	for (cin >> n; n--;)
	{
		vector<double> x(3);
		vector<double> y(3);

		for (int i = 0; i < 3; i++)
		{
			cin >> x.at(i) >> y.at(i);
		}

		double a = distance(x.at(1), y.at(1), x.at(2), y.at(2));
		double b = distance(x.at(2), y.at(2), x.at(0), y.at(0));
		double c = distance(x.at(0), y.at(0), x.at(1), y.at(1));

		double cosA = (b * b + c * c - a * a) / (2 * b * c);
		double sinA = sqrt(1 - cosA * cosA);
		double r = a / (2 * sinA);

		double cx = r * cosA;
		double cy = r * sinA;

		cout << fixed << setprecision(3);
		cout << cx << " " << cy << " " << r << endl;
	}
}
