#include<iostream>
#include<vector>
#include<map>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#define INF 1e9

typedef long long int ll;
#define PI pair<int,int>
using namespace std;

PI getAB(PI a,PI b){
	PI ret;
	if(a.first-b.first==0){ret.first=0;}
	else ret.first=(a.second-b.second)/(a.first-b.first);
	ret.second=a.second-ret.first*a.first;
	return ret;
}

PI solve(int a,int b,PI p1,PI p2){
	double x=((double)p1.first+p2.first)/2;
	double y=((double)p1.second+p2.second)/2;
//cout<<"x="<<x<<endl;
//cout<<"y="<<y<<endl;

	PI ret;
	ret.first=-a;
	ret.second=y+a*x;
//cout<<"b="<<y<<"+"<<a<<"*"<<x<<endl;
	return ret;
}

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		PI p[3];
		for(int j=0;j<3;j++){
			cin>>p[j].first>>p[j].second;
		}
//cout<<"座標"<<endl;

//for(int j=0;j<3;j++)cout<<"("<<p[j].first<<","<<p[j].second<<")"<<endl;
//cout<<endl;
		PI ret;
		int count=0;
		int a[2],b[2];
		for(int j=0;j<2;j++){
if(p[j].second==p[j+1].second)j++;
			ret=getAB(p[j],p[(j+1)%3]);
//cout<<"y="<<ret.first<<"x+"<<ret.second<<endl;
			ret=solve(ret.first,ret.second,p[j],p[j+1]);
//cout<<"y="<<ret.first<<"x+"<<ret.second<<endl;
//cout<<endl;
			a[count]=ret.first;
			b[count]=ret.second;
			count++;
		}
		double cenx,ceny;
		cenx=(double)(b[1]-b[0])/(a[0]-a[1]);
		ceny=(double)(a[0]*b[1]-a[1]*b[0])/(a[0]-a[1]);
		cout<<cenx<<" "<<ceny<<" "<<hypot(cenx-p[0].first,ceny-p[0].second)<<endl;
	}
	return 0;
}