#define _USE_MATH_DEFINES
#include<cmath>
#include<iostream>
#include<cstdio>
using namespace std;

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;n++){
		double ax,ay,bx,by,cx,cy,radab,radac,radc,r,bc;
		cin>>ax>>ay>>bx>>by>>cx>>cy;
		radab=atan2(by-ay,bx-ax);
		radac=atan2(cy-ay,cx-ax);
		radc=radac-radab;
		if(radc>M_PI_2)radc=M_PI-radc;
		bc=sqrt((cx-bx)*(cx-bx)+(cy-by)*(cy-by));
		r=bc/sin(radc)/2;
		printf("%.3f %.3f %.3f\n",ax+r*cos(radc+radab),ay+r*sin(radc+radab),r);
	}
	return 0;
}