#include <iostream>
#include <cstdio>
//#include <cstdlib>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
//#include <stack>
//#include <limits>
#include <sstream>
//#include <functional>
#include <complex>
using namespace std;

#define len(array)  (sizeof (array) / sizeof *(array))
#define rep(i, s, e) for(int i = s;i < e;i++)
#define rrep(i, e, s) for(int i = e;s <= i;i--)
#define vrange(v) v.begin(), v.end()
#define vrrange(v) v.rbegin(), v.rend()
#define vsort(v) sort(vrange(v))
#define vrsort(v) sort(vrrange(v))
#define arange(a) a, a + len(a)
#define asort(a) sort(arange(a))
#define arsort(a, t) sort(arange(a), greater<t>())
#define afill(a, v) fill(arange(a), v)
#define afill2(a, v, t) fill((t *)a, (t *)(a + len(a)), v)
#define fmax(a, b) (a < b? b : a)
#define fmin(a, b) (a > b? b : a)
#define fabs(a) (a < 0? -a : a)
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-10;
//const int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
//const int dy[] = {0, 0, 1, -1, -1, -1, 1, 1};
//const int weight[] = {0,1,10,100,1000,10000,100000,1000000,10000000};
//priority_queue< int, vector<int>, greater<int> > q;


// http://d.hatena.ne.jp/otaks/20100929

typedef complex<double> p;
//XY座標
#define X real()
#define Y imag()

// 三角形クラス
class Triangle{

private:
  //三角形の3点の座標
  p a, b, c;
  //三角形の3辺の長さ
  double ab, bc, ca;
  //三角形の3角の大きさ(ラジアン)
  double A, B, C;


public:
  //コンストラクタ(3つの点と辺と角度を初期化)
  Triangle(p p1, p p2, p p3){
	a = p1;
	b = p2;
	c = p3;
	ca = abs(c-a);
	bc = abs(b-c);
	ab = abs(a-b);
	A = LawOfCosines(bc,ca,ab);
	B = LawOfCosines(ca,ab,bc);
	C = LawOfCosines(ab,bc,ca);
  }

  //余弦定理から3つの角度を求める関数
  double LawOfCosines(double a,double b, double c){
	return acos( (b*b+c*c-a*a) / (2.0*b*c) );
  }
  //2つのdouble型の数値が等しいかどうか
  bool equal(double a, double b){
	return (abs( a-b ) < EPS)? true : false ;
  }

  //double circumscribedCircleRadius(){//外接円の半径を返す
  double getCR(){
	return ( bc / (2*sin(A)));
  }
  //p circumscribedCircle(){//外心(外接円の中心)の座標を返す
  p getCC(){ // get a circumcenter
	double sA = sin(2.0*A);
	double sB = sin(2.0*B);
	double sC = sin(2.0*C);
	double deno = sA + sB + sC;
	return p((a.X * sA + b.X * sB + c.X * sC) / deno, (a.Y * sA + b.Y * sB + c.Y * sC) / deno );
  }
};

void doIt(){
  int n;
  double x1, y1, x2, y2, x3, y3, px, py, r;
  cin >> n;
  while(n--){
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
	Triangle t = Triangle(p(x1, y1), p(x2, y2), p(x3, y3));
	p cc = t.getCC();
	printf("%.3f %.3f %.3f\n", cc.X, cc.Y, t.getCR());
  }
}

int main() {
  doIt();
  return 0;
}