#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#define SQ(x) ((x)*(x))
using namespace std;

int main(){
  int n;
  double x1,y1,x2,y2,x3,y3;
  double a,b,c,d,e,f,l,C,r,xp,yp,m; // 3辺
  cin >> n;
    for(int i=0;i<n;i++){
      cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
      a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
      b = sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
      c = sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
      C = fabs(1.0-C*C);
      if(C == 0)C = 1;
      if(c == 0)c = 1;
      C = (sqrt(C)); // sinθに変更
      r = (c/2*C); // 接弦定理
    
      a = (x1 - x2);
      b = (y1 - y2);
      c = -1 * (SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2));
      d = (x1 - x3);
      e = (y1 - y3);
      f = -1 * (SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3));
    
      l = (c * e - b * f) / (e * a - b * d);
      m = (d * c - a * f) / (d * b - e * a);
    
      printf("%.3f %.3f %.3f\n", l / -2.0, m / -2.0, r);
  }
}