
#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-4;
}

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

int main() {
    int N;
    double x1, x2, x3, y1, y2, y3;

    cin >> N;
    while(N--) {
        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);

        Point d = pc2-pc1;
        double ratio = ph2.real() / ph2.imag();
        double a = (d.real()-d.imag()*ratio) / (ph1.real()-ph1.imag()*ratio);
        Point center = pc1 + ph1 * a / abs(ph1);

        /*
        int i1 = (int)center.real(), d1 = ((int)((center.real()-i1)*10000)+5)/10;
        int i2 = (int)center.imag(), d2 = ((int)((center.imag()-i2)*10000)+5)/10;
        int i3 = (int)R, d3 = ((int)((R-i3)*10000)+5)/10;
        printf("%d.%03d %d.%03d %d.%03d\n", i1, d1, i2, d2, i3, d3);
        */
        printf("%.3f %.3f %.3f\n", r_(center.real()), r_(center.imag()), r_(R));
    }
    return 0;
}