#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
using namespace std;

#define EPS 1e-10
#define x second
#define y first

inline int sqr(int n) { return n * n; }

struct triangle
{
    pair<double, double> p[3];
    double side[3];
    double angle;

    void init()
    {
        for (int i = 0; i < 3; i++){
            scanf("%lf %lf", &p[i].x, &p[i].y);
        }
        sort(p, p + 3);
        for (int i = 0; i < 3; i++){
            double dx = p[(i + 1) % 3].x - p[i].x;
            double dy = p[(i + 1) % 3].y - p[i].y;
            side[i] = sqrt(dx * dx + dy * dy);
        }
        angle = asin((p[2].y - p[0].y) / side[2]) + EPS;
    }

    pair<double, double> circle()
    {
        double l, m;
        double t[2], lt[4], mt[4];

        t[0] = sqr(p[1].x) - sqr(p[0].x) + sqr(p[1].y) - sqr(p[0].y);
        t[1] = sqr(p[2].x) - sqr(p[1].x) + sqr(p[2].y) - sqr(p[1].y);
        lt[0] = (p[2].y - p[1].y);
        lt[1] = (p[1].y - p[0].y);
        lt[2] = lt[0] * (p[1].x - p[0].x);
        lt[3] = lt[1] * (p[2].x - p[1].x);
        l = (t[2] - t[3]) / (lt[0] + lt[1]);
        mt[0] = (p[1].y - p[0].y);
        mt[1] = (p[2].y - p[1].y);
        mt[2] = mt[0] * (p[2].x - p[1].x);
        mt[3] = mt[1] * (p[1].x - p[0].x);
        m = (t[2] - t[3]) / (mt[0] + mt[1]);

        return make_pair(-l / 2, -m / 2);
    }
};

int main()
{
    int n;

    scanf("%d", &n);
    while (n-- > 0){
        triangle tri;
        double r;
        pair<double, double> pr;

        tri.init();
        if (tri.p[1].y != tri.p[2].y) r = tri.side[1] / sin(tri.angle) / 2;
        else r = tri.side[0] / sin(tri.angle) / 2;
        pr = tri.circle();
        printf("%f %f %f\n", pr.x, pr.y, r);
    }

    return 0;
}