
#include <iostream>
#include <cstdio>
#include <complex>
#include <cmath>

using namespace std;

typedef complex<double> Point;

bool eqv(double d1, double d2) {
    return abs(d1-d2) < 1e-10;
}

double r_(double x) {
    if(abs(x) < 0.001) return 0;
    return x;
}

int main() {
    int N;

    cin >> N;
    while(N--) {
        double x1, x2, x3, y1, y2, y3;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        Point p1(x1, y1), p2(x2, y2), p3(x3, y3);

        double R = abs(abs(p3-p2) / sin(arg(p2-p1) - arg(p3-p1))) / 2;
        Point pc1 = (p1+p2) / 2.;
        Point ph1 = (pc1-p1) * Point(0, 1);
        Point pc2 = (p1+p3) / 2.;
        Point ph2 = (pc2-p1) * Point(0, 1);

        //pc1 + k*ph1 == pc2 + l*ph2
        //pc1-pc2 == l*ph2 - k*ph1
        //d = pc1-pc2
        //l*ph2.x - k*ph1.x == d.x
        //l*ph2.y - k*ph1.y == d.y
        Point d = pc1-pc2;
        double det = ph2.real()*-ph1.imag() + ph1.real()*ph2.imag();
        double l = (d.real()*-ph1.imag() - d.imag()*ph2.imag()) / det;
        double k = (d.real()*ph1.real() + d.imag()*ph2.real()) / det;
        Point center = pc1 + ph1 * k;
        R = abs(center-p1);

        printf("%.3f %.3f %.3f\n", r_(center.real()), r_(center.imag()), r_(R));
    }
    return 0;
}