#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n;i>=0;i--)]
#define all(v) v.begin(), v.end()
using namespace std;

template<typename T>T inner(complex<T> a,complex<T> b){
	return a.real()*b.real()+a.imag()*b.imag();
}
template<typename T>double theta(complex<T> a,complex<T> b){
	double in = inner(a,b);
	double a_abs = abs(a);
	double b_abs = abs(b);
	return acos(in/(a_abs*b_abs));
}
template<typename T>T deg(T a){
	return a*180/M_PI;
}
int main(){
	complex<double> p[3];
	int n;
	cin >> n;
	rep(i,n){
		double x,y;
		rep(j,3){
			cin >> x >> y;
			p[j] = *(new complex<double>(x,y));
		}
		complex<double> vAB = p[1]-p[0];
		complex<double> vAC = p[2]-p[0];
		complex<double> vBC = p[2]-p[1];
		double a= theta(vAB,vAC);
		double b= theta(-vAB,vBC);
		double c= theta(-vAC,-vBC);
		complex<double> vo =((sin(2*a)*p[0]+sin(2*b)*p[1]+sin(2*c)*p[2])/(sin(2*a)+sin(2*b)+sin(2*c)));
		complex<double> r = p[0]-vo;
		printf("%.3lf %.3lf %.3lf",vo.real(),vo.imag(),abs(r));
	}
}