#include "bits/stdc++.h"
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)
 
#define EPS (1e-10)
class P{                    //?????§?????????
public:
    double x,y;
     
    P(double _x=0,double _y=0):x(_x),y(_y){};
    P operator + (const P &p     )const{ return P( x+p.x , y+p.y ); }  //?????\?????°???§??????????
    P operator - (const P &p     )const{ return P( x-p.x , y-p.y ); }  //????????????????´???§??????????
    P operator * (const double k )const{ return P( x*k   , y*k    ); } //????????????????????§??????????
    P operator / (const double k )const{ return P( x/k   , y/k    ); } //????????????????????§??????????
     
    bool operator == (const P &p){ return ( fabs(x-p.x)<EPS && fabs(y-p.y)<EPS ); }
    bool operator < (const P &p) const{ return ( x!=p.x ? x<p.x:y<p.y ); }
     
    double norm(){ return x*x+y*y; }        //?????£????´?????£????´????????£????´?
    double abs() { return sqrt(norm()); }   //?????\???????????§?????£??????¬??£?????
    void normalize() {double d = sqrt(x*x+y*y); x /= d; y /= d;}    //?????????????????£?????¨??????????????\???????
};
struct C{P p;double r;};    //?????\?????
struct S{P p1,p2;};         //?????§??????????????\???????
typedef vector<P> Polygon;  //?????\??????????????¨?????§????´\??\???????????¢
typedef P Vector;           //?????£????´?????£??????????????£????´?????£????´???
typedef S L;                //?????§????´¢??´?????§??????????
 
double dot  (Vector a,Vector b) { return a.x*b.x+a.y*b.y; }
double cross(Vector a,Vector b) { return a.x*b.y-a.y*b.x; }
double sqDist(P a, P b)         {return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);}
double dist (P a, P b)          {return sqrt(sqDist(a,b));}
Vector vec(S a)                 {return P(a.p2.x-a.p1.x,a.p2.y-a.p1.y);}
 
 
//?????§??????????????\?????????£????????????\????\???\??§????´¢??´????????????????????§??????????????\?????????§????´¢??´?????§??????????????£???????´\????????±?????\??£?????????£???????
S getBisector(P a, P b){
    Vector vect = vec(S{a,b});
    P n = P(vect.y, -vect.x);
    n.normalize();
    P cent = (a+b)/2.0;
    return S{cent,cent+n};
}
 
 
// ?????§????´¢??´?????§??????????????£??????¨?????§????´¢??´?????§??????????????£??????????????????????????????§????????? vefiried AOJ CGL_2
P getCrossPointSS(S l1, S l2){
    double A = cross(vec(l1), vec(l2));
    double B = cross(vec(l1), l1.p2 - l2.p1);
    if(abs(A)<EPS && abs(B)<EPS) return l2.p1; // ????????????????????§????´¢??´?????§??????????????£????????????????¬??£????????????£??????£?????£????????????£???????£???????
    if(abs(A)<EPS) assert(false); // ?????§????´¢??´?????§??????????????£???????????????????????????£???????????£???????????£????????????£?????
    return l2.p1 + vec(l2) * B / A;
}
 
 
int main(){
    int n;
    cin>>n;
    rep(hoge,n){
        vector<P> points(3);
        rep(i,3)cin>>points[i].x>>points[i].y;
         
        vector<S> bisectors(2);
        rep(i,2) bisectors[i] = getBisector(points[i], points[i+1]);
         
        P cent = getCrossPointSS(bisectors[0], bisectors[1]);
         
         
        printf("%.3lf %.3lf %.3lf\n",cent.x,cent.y,dist(cent,points[1]));
    }
}