Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var num int
	fmt.Scan(&num)
	for i := 0; i < num; i++ {
		var x1, y1, x2, y2, x3, y3 float64
		fmt.Scanf("%f%f%f%f%f%f", &x1, &y1, &x2, &y2, &x3, &y3)

		a := 2 * (x2 - x1)
		b := 2 * (y2 - y1)
		c := 2 * (x3 - x1)
		d := 2 * (y3 - y1)
		e := x2*x2 - x1*x1 + y2*y2 - y1*y1
		f := x3*x3 - x1*x1 + y3*y3 - y1*y1

		// 直線1: ax + by - e = 0
		// 直線2: cx + dy - f = 0
		px := (d*e - b*f) / (a*d - b*c)
		py := (c*e - a*f) / (b*c - a*d)
		r := math.Sqrt((px-x1)*(px-x1) + (py-y1)*(py-y1))
		fmt.Printf("%.3f %.3f %.3f\n", px, py, r)
	}
}

C++: //ツ三ツ角ツ形ツづ個外ツ静堋円ツづ個陳?心ツづ? ツ三ツ角ツ形ツづ個静シツ閉ェツづ個青つ陳シツ禿アツ督卍閉ェツ静シツつェツ古ーツづュツづゥツ湘ェツ渉環づ可づ按づゥ.
//ツつアツづ個づヲツつ、ツづ按甘エツ可スツ学ツ的ツづ按姪「ツ妥ィツづーツ嘉ーツつュツづ?つォツづ? ツ暗按可コツづ個ペ-ツジツづ個δ可イツブツδ可δ環づーツ参ツ考ツづ可つキツづゥツづ?嘉ーツつォツづ「ツつキツつ「.
// - http://www.deqnotes.net/acmicpc/2d_geometry/
// - http://www.prefield.com/algorithm/index.html

#include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

typedef complex<double> P;

P p[3]; //ツ三ツ角ツ形ツづ個三ツ点

//ツ外ツ静?
double cross(const P &a, const P &b){
  return imag(conj(a) * b);
}

//ツ静シツ閉ェ/ツ陳シツ静シツ用ツづ個型
struct L : public vector<P> {
  L(const P &a, const P &b){
    push_back(a);
    push_back(b);
  }
};

//ツ陳シツ静シ2ツづつづ個古ーツ点ツづーツ仰?づ淞づゥ
P crosspoint(const L &l, const L &m){
  double A = cross(l[1] - l[0], m[1] - m[0]);
  double B = cross(l[1] - l[0], l[1] - m[0]);
  return m[0] + B / A * (m[1] - m[0]);
}

//ツ静シツ閉ェabツづ個青つ陳シツ禿アツ督卍閉ェツ静シツづーツ仰?づ淞づゥ
L getBisection(const P &a, const P &b){
  P s = (a + b) / 2.0; //ツ陳?点
  P t = (b - a) * P(0, 1); //ツ静シツ閉ェabツづ個法ツ静シツベツクツトツδ仰づーツ偲ヲツ督セ

  //ツ静シツ閉ェabツづ個青つ陳シツ禿アツ督卍閉ェツ静シツづ? ツ点sツつゥツづァs+tツづ鳴伸ツづ堕づゥツ陳シツ静シ
  return L(s, s + t);
}

void solve(){
  //ツ三ツ角ツ形ツづ個静シツ閉ェツづ個青つ陳シツ禿アツ督卍閉ェツ静シツづー2ツづつ偲ヲツ督セツつキツづゥ
  L l1 = getBisection(p[0], p[1]);
  L l2 = getBisection(p[1], p[2]);

  //ツ外ツ静堋円ツづ個陳?心ツづ? l1ツづ?2ツつェツ古ーツ債キツつオツつスツ点
  P o = crosspoint(l1, l2);

  //ツ三ツ角ツ形ツづ個任ツ暗督づ個陳クツ点ツつゥツづァ, ツ陳?心ツづ慊づ?づ個仰猟猟」ツづーツ偲ヲツづェツづ? ツ板シツ径ツづ可づ按づゥ
  printf("%.3f %.3f %.3f\n", o.real(), o.imag(), abs(o - p[0]));
}

int main(){
  int n;
  cin >> n;

  for(int i = 0; i < n; i++){
    for(int j = 0; j < 3; j++){
      cin >> p[j].real() >> p[j].imag();
    }

    solve();
  }
}

C++: #include<iostream>
#include<iomanip>
#include<memory>
#include<array>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>

using namespace std;

int main()
{
  int n;
  array<double, 3> x;
  array<double, 3> y;
  array<double, 2> a;
  array<double, 2> b;
  array<double, 2> c;
  double cx, cy, r;

  cin >> n;
  for ( int j = 0; j < n; j++ )
    {
      for ( auto i = 0; i < x.size(); i++ )
        {
          cin >> x[i];
          cin >> y[i];
        }
      
      for ( auto i = 0; i < a.size(); i++ )
        {
          a[i] =  y[i+1] - y[i];
          b[i] =  x[i+1] - x[i];
          c[i] = (x[i+1] * x[i+1] - x[i] * x[i]) * 0.5 + (y[i+1] * y[i+1] - y[i] * y[i]) * 0.5;
        }
      
      cx = (b[1] * c[0] - b[0] * c[1]) / (a[0] * b[1] - a[1] * b[0]);
      cy = (a[0] * c[1] - a[1] * c[0]) / (a[0] * b[1] - a[1] * b[0]);
      r = sqrt( (x[0] - cx) * (x[0] - cx) + (y[0] - cy) * (y[0] - cy) );
      
      cout << fixed << setprecision(3) << cx << " " << cy << " " << r << endl;
    }
  return 0;
}

C++: #include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(3); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

template <typename T>
struct Matrix {
  vector<vector<T>> v;
  int r, c;
  Matrix(int r, int c, T d) : r(r), c(c) {
    v = vector<vector<T>>(r, vector<T>(c, d));
  }
  Matrix(vector<vector<T>> v) : v(v) {
    r = v.size();
    c = v[0].size();
  }
  vector<T>& operator[](int x) {
    return v[x];
  }
  Matrix<T> operator*=(Matrix<T> that) {
    assert(c == that.r);
    auto ret = Matrix<T>(r, that.c, 0);
    rep(i, r) rep(j, that.c) rep(k, c) {
      ret[i][j] += v[i][k] * that[k][j];
    }
    return *this = ret;
  }
  Matrix<T> operator*(Matrix<T> that) {
    return *this *= that;
  }
  Matrix<T> pow(i64 n) {
    assert(r == c);
    auto e = Matrix<T>(r, c, 0);
    rep(i, r) e[i][i] = 1;
    return power(*this, n, e);
  }
};

void solve() {
  function<f80(f80)> rnd = [](f80 x) {
    return round(x * 1000) / 1000;
  };
  int n; cin >> n;
  while (n--) {
    f80 x[3], y[3];
    rep(i, 3) cin >> x[i] >> y[i];
    auto a = Matrix<f80>({{
      - power(x[0], 2) - power(y[0], 2),
      - power(x[1], 2) - power(y[1], 2),
      - power(x[2], 2) - power(y[2], 2),
    }});
    f80 r = 1 / (
      x[0]*y[1] + x[1]*y[2] + x[2]*y[0] - x[2]*y[1] - x[1]*y[0] - x[0]*y[2]
    );
    auto xx = Matrix<f80>({
      { y[1] - y[2], x[2] - x[1], x[1]*y[2] - x[2]*y[1] },
      { y[2] - y[0], x[0] - x[2], x[2]*y[0] - x[0]*y[2] },
      { y[0] - y[1], x[1] - x[0], x[0]*y[1] - x[1]*y[0] },
    });
    rep(i, 3) rep(j, 3) xx[i][j] *= r;
    auto ans = a * xx;

    auto p = -ans[0][0] / 2;
    auto q = -ans[0][1] / 2;
    auto s = sqrt(power(p, 2) + power(q, 2) - ans[0][2]);
    cout << p << " " << q << " " << s << '\n';
  }
}

C++: #include <iostream>
#include <cmath>

using namespace std;

struct point{
     double x, y;
};

void renritu(point p1, point p2, double *a, double *b, double *c){
    *a=2*(p2.x-p1.x);
    *b=2*(p2.y-p1.y);
    *c=p1.x*p1.x+p1.y*p1.y-(p2.x*p2.x+p2.y*p2.y);
}

int main(void){
    int i,n;
    double a1,b1,c1,a2,b2,c2,r;
    point p1,p2,p3;
    cin >> n;
    for(i=0;i<n;i++){
        cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;
        renritu(p1,p2,&a1,&b1,&c1);
        renritu(p2,p3,&a2,&b2,&c2);
        p3.x=-(b2-a2)*c1/(a1*b2-a2*b1);
        p3.y=-(a1-b1)*c2/(a1*b2-a2*b1);
        r=sqrt((p3.x-p1.x)*(p3.x-p1.x)+(p3.y-p1.y)*(p3.y-p1.y));
        printf("%.3lf %.3lf %.3lf\n",round(p3.x*1000)/1000,round(p3.y*1000)/1000, round(r*1000)/1000);
    }
    return 0;
}