#include <iostream>
#include <cmath>

using namespace std;

struct point{
    double x;
    double y;
};

int main(){
    int n;
    struct point points[3];

    cin>>n;
    for (int j = 0; j < n; ++j) {
        double s,a,b,c;
        for (int i = 0; i < 3; ++i) {
            cin >> points[i].x >> points[i].y;
        }
        a  = sqrt(pow(points[0].x-points[1].x,2)+pow(points[0].y-points[1].y,2));
        b  = sqrt(pow(points[1].x-points[2].x,2)+pow(points[1].y-points[2].y,2));
        c  = sqrt(pow(points[2].x-points[0].x,2)+pow(points[2].y-points[0].y,2));
        s  = (a+b+c)/2;
        printf("%.3f %.3f %.3f\n",
               ((points[0].y - points[2].y)*(pow(points[0].y,2) - pow(points[1].y,2) + pow(points[0].x,2) - pow(points[1].x,2)) - (points[0].y - points[1].y)*(pow(points[0].y,2) - pow(points[2].y,2) + pow(points[0].x,2) - pow(points[2].x,2))) / (2*(points[0].y - points[2].y)*(points[0].x - points[1].x) - 2*(points[0].y - points[1].y)*(points[0].x - points[2].x))+5e-5,
               ((points[0].x - points[2].x)*(pow(points[0].x,2) - pow(points[1].x,2) + pow(points[0].y,2) - pow(points[1].y,2)) - (points[0].x - points[1].x)*(pow(points[0].x,2) - pow(points[2].x,2) + pow(points[0].y,2) - pow(points[2].y,2))) / (2*(points[0].x - points[2].x)*(points[0].y - points[1].y) - 2*(points[0].x - points[1].x)*(points[0].y - points[2].y))+5e-5,
               a*b*c/(4*sqrt(s*(s-a)*(s-b)*(s-c)))+5e-5
        );
    }
    return 0;
}