#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

int main() {
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		double ax, ay, bx, by, cx, cy;
		cin >> ax >> ay >> bx >> by >> cx >> cy;
		double cs = (by - ay) / (bx - ax);//AB?????????
		double op = -1 / cs;

		double as = (cy - by) / (cx - bx);
		double on = -1 / as;

		double a, b, c, d, e, f;
		a = -1 * op;
		b = 1;
		c = -1 * (op*((ax + bx) / 2)) + ((ay + by) / 2);
		d = -1 * on;
		e = 1;
		f = -1 * (on*((bx + cx) / 2)) + ((by + cy) / 2);
		double any = ((c*d) - (a*f)) / ((b*d) - (a*e));
		double anx = (c - (b*any)) / a;
		double lng = sqrt((abs(anx - bx))*(abs(anx - bx)) + ((abs(any - by)*abs(any - by))));
		
		double aax = round(anx * 10000) / 10000;
		double aay = round(any * 10000) / 10000;
		double alng = round(lng * 10000) / 10000;
		cout << fixed << setprecision(3) << aax << ' ' << aay << ' ' << alng << endl;
	}
	return 0;
}