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

using namespace std;

typedef complex<double> Point;
#define sq(x) (pow((x), (2.0)))
#define X real()
#define Y imag()

class Triangle{
    private:
        Point a, b, c;
        double edgeA, edgeB, edgeC;
        double angleA, angleB, angleC;
        double getAngle(double a, double b, double c){
            return acos((sq(b) + sq(c) - sq(a)) / (2.0 * b * c));
        }
    public:
        Triangle(Point p1, Point p2, Point p3){
            a = p1;
            b = p2;
            c = p3;
            edgeA = abs(b - c);
            edgeB = abs(a - c);
            edgeC = abs(a - b);
            angleA = getAngle(edgeA, edgeB, edgeC);
            angleB = getAngle(edgeB, edgeC, edgeA);
            angleC = getAngle(edgeC, edgeA, edgeB);
        }
        double circleRadius(){
            return (edgeA / sin(angleA)/ 2.0);
        }
        double circleX(){
            double A = sin(2.0 * angleA);
            double B = sin(2.0 * angleB);
            double C = sin(2.0 * angleC);
            return ((a.X * A + b.X * B + c.X * C) / (A+B+C));
        }
        double circleY(){
            double A = sin(2.0 * angleA);
            double B = sin(2.0 * angleB);
            double C = sin(2.0 * angleC);
            return ((a.Y * A + b.Y * B + c.Y * C) / (A+B+C));
        }
};

int main(){
    int n;
    double x1, y1, x2, y2, x3, y3;
    double r, xp, yp;
    scanf("%d", &n);
    for(int i = 0; i < n; ++i){
        scanf("%lf %lf %lf %lf %lf %lf",
                &x1, &y1, &x2, &y2, &x3, &y3);
        Point a(x1, y1);
        Point b(x2, y2);
        Point c(x3, y3);
        Triangle T(a, b, c);
        r = T.circleRadius();
        xp = T.circleX();
        yp = T.circleY();
        printf("%.3f %.3f %.3f\n", xp, yp, r);
    }
    return 0;
}