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

    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);

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

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