#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define rep(i,n) REP(i, 0, n)
typedef complex<double> Point;
const double EPS = 1.0e-9;
const double PI = acos(-1);
namespace std {
    bool operator < (const Point& a, const Point& b){
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
    }
}
struct Line : public vector<Point> {
    Line(const Point& a, const Point& b){
        push_back(a);
        push_back(b);
    }
};
double cross(const Point& a, const Point& b){
    return imag(conj(a) * b);
}
Point cross_point(const Line& l, const Line& m){
    double A = cross(l[1] - l[0], m[1] - m[0]);
    double B = cross(l[1] - l[0], l[1] - m[0]);
    if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line
    if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
    return m[0] + B / A * (m[1] - m[0]);
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int test; cin >> test;
    rep(casenum, test){
        Point a, b, c, m1, m2, d1, d2;
        cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag();
        m1 = (a + b) / 2.0, m2 = (b + c) / 2.0;
        d1 = polar(1.0, arg(b - a) + PI / 2.0), d2 = polar(1.0, arg(c - b) + PI / 2.0);
        Line l1(m1, m1 + d1), l2(m2, m2 + d2);
        Point ans = cross_point(l1, l2);
        double r = abs(ans - a);
        printf("%.3lf %.3lf %.3lf\n", ans.real(), ans.imag(), r);
    }
    return 0;
}