#include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair
typedef long long LL;
#define EPS (1e-3)
double zero(double d){
  return d < EPS ? 0.0 : d;
}

double getLen(double dx, double dy){
  dx = abs(dx);
  dy = abs(dy);
  return sqrt( dx*dx + dy*dy );
}



int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(3);

  int INF = 1000000;

  int n;
  cin>>n;
    
    REP(tar,n){
      double x1,y1,x2,y2,x3,y3;
      cin >>x1>>y1>>x2>>y2>>x3>>y3;

      double a = getLen(x1-x2,y1-y2);
      double b = getLen(x2-x3,y2-y3);
      double c = getLen(x3-x1,y3-y1);
      
      double A = acos((b*b+c*c-a*a)/(2.0*b*c));
      double B = acos((c*c+a*a-b*b)/(2.0*c*a));
      double C = acos((b*b+a*a-c*c)/(2.0*b*a));

      double A2 = sin(A*2);
      double B2 = sin(B*2);
      double C2 = sin(C*2);

      double px = ((x1*A2 + x2*B2 + x3*C2)/(A2+B2+C2));
      double py = ((y1*A2 + y2*B2 + y3*C2)/(A2+B2+C2));

      double R = a / (2.0*sin(A));

      cout << zero(px) << " " << zero(py) << " " << zero(R) << endl;
    }
    
  


  return 0;
}