
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	complex<double> Ans;
	complex<double> P[3];
	for(int i=0;i<3;i++){
		cin>> P[i].real()>> P[i].imag();
	}
	complex<double> T[2];
	complex<double> K[2];
	double katamuki[2];
	for(int i=0;i<2;i++){
		T[i].real() = (P[i].real() + P[i+1].real()) / 2;
		T[i].imag() = (P[i].imag() + P[i+1].imag()) / 2;
		complex<double> N;
		N = (P[i+1]-P[i])/abs(P[i+1]-P[i]);
		K[i].real() =  N.imag();
		K[i].imag() = -N.real();
	}
	int a = (T[1]-T[0]).real();
	int b = (T[1]-T[0]).imag();
	int x0 = K[0].real();
	int y0 = K[0].imag();
	int x1 = K[1].real();
	int y1 = K[1].imag();
	int m = ( a * y0 - b * x0 ) / ( x0 * y1 - x1 * y0);
	K[1] *= m;
	Ans = K[1] + T[1];


	printf("%.3f %.3f %.3f", Ans.real(), Ans.imag(), abs(Ans-P[0]));
	printf("\n");
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(3);
	int n;
	cin>> n;
	for(int i=0;i<n;i++){
		solve();
	}
	return 0;
}

 