#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


using P = complex<long double>;

int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  int n; cin >> n;
  for (int _ = 0; _ < n; ++_) {
    V<P> p(3);
    for (int i = 0; i < 3; ++i) {
      long double x, y; cin >> x >> y;
      p[i] = {x, y};
    }
    P numer = 0;
    for (int i = 0; i < 3; ++i) {
      numer += p[i] * (norm(p[(i + 2) % 3]) - norm(p[(i + 1) % 3]));
    }
    P denom = 0;
    for (int i = 0; i < 3; ++i) {
      denom += p[i] * conj(p[(i + 2) % 3] - p[(i + 1) % 3]);
    }
    P r = numer / denom;
    cout << fixed << setprecision(3) << real(r) << ' ' << imag(r) << ' ' << abs(p[0] - r) << '\n';
  }
}
