#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

void getSide(double x1, double y1, double x2, double y2, double x3, double y3, double *a, double *b, double *c) {
    double marginX1, marginX2, marginX3;
    double marginY1, marginY2, marginY3;
    
    marginX1 = fabs(x1 - x2);
    marginX2 = fabs(x2 - x3);
    marginX3 = fabs(x3 - x1);
    marginY1 = fabs(y1 - y2);
    marginY2 = fabs(y2 - y3);
    marginY3 = fabs(y3 - y1);
    
    *a = sqrt(pow(marginX1, 2) + pow(marginY1, 2));
    *b = sqrt(pow(marginX2, 2) + pow(marginY2, 2));
    *c = sqrt(pow(marginX3, 2) + pow(marginY3, 2));
    
}

    // 半径取得の処理
double getR(double a, double b, double c) {
    double r, s;
    s = (a + b + c) / 2;
    r = (a * b * c) / (4 * sqrt(s * (s - a) * (s - b) * (s - c)));
    return r;
}

    // 中心座標を求める処理
void getCentralCoodinate(double x1, double y1, double x2, double y2, double x3, double y3, double *xp, double *yp) {
    double a1, b1, c1;
    double a2, b2, c2;
    double marginX1, marginX3;
    double marginY1, marginY3;
    
    *xp = 0;
    *yp = 0;
    
    marginX1 = x2 - x1;
    marginX3 = x3 - x1;
    marginY1 = y2 - y1;
    marginY3 = y3 - y1;
    
    a1 = 2 * marginX1;
    b1 = 2 * marginY1;
    a2 = 2 * marginX3;
    b2 = 2 * marginY3;
    
    c1 = pow(x1, 2) - pow(x2, 2) + pow(y1, 2) - pow(y2, 2);
    c2 = pow(x1, 2) - pow(x3, 2) + pow(y1, 2) - pow(y3, 2);
    
    *xp = (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1);
    *yp = (a2 * c1 - a1 * c2) / (a1 * b2 - a2 * b1);
}

    // main処理
int main(void) {
    double x1, x2, x3;
    double y1, y2, y3;
    double xp, yp;
    double a, b, c, r;
    int n;
    
    cin >> n;
    while(n--) {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        getSide(x1, y1, x2, y2, x3, y3, &a, &b, &c);
        r = getR(a, b, c);
        getCentralCoodinate(x1, y1 ,x2, y2, x3, y3, &xp, &yp);
        
        cout << setprecision(3);
        cout << setiosflags(ios::fixed);
        cout << xp << " " << yp << " " << r << endl;
    }
    
    return 0;
}