type point = Pt of float * float

let edge_length (Pt (x1, y1)) (Pt (x2, y2)) =
  let square x = x *. x in
  sqrt @@ (square (x1 -. x2)) +. (square (y1 -. y2))

let edge_lengths p1 p2 p3 =
  (edge_length p2 p3), (edge_length p3 p1), (edge_length p1 p2)

let add_vector (Pt (x1, y1)) (Pt (x2, y2)) = Pt (x1 +. x2, y1 +. y2)

let mul_vector s (Pt (x, y)) = Pt (s *. x, s *. y)

let area p1 p2 p3 =
  let a, b, c = edge_lengths p1 p2 p3 in
  let s = (a +. b +. c) /. 2. in
  sqrt @@ s *. (s -. a) *. (s -. b) *. (s -. c)

let center p1 p2 p3 =
  let a, b, c = edge_lengths p1 p2 p3 in
  let a2, b2, c2 = a *. a, b *. b, c *. c in
  let s = area p1 p2 p3 in
  let nom = 16. *. s *. s in
  add_vector
    (mul_vector (a2 *. (b2 +. c2 -. a2) /. nom) p1)
    (add_vector
       (mul_vector (b2 *. (c2 +. a2 -. b2) /. nom) p2)
       (mul_vector (c2 *. (a2 +. b2 -. c2) /. nom) p3))

let radius p1 p2 p3 =
  let a, b, c = edge_lengths p1 p2 p3 in
  let den =
    sqrt @@ (a +. b +. c) *. (~-.a +. b +. c) *. (a -. b +. c) *. (a +. b -. c) in
  (a *. b *. c) /. den

let read_lines n =
  let rec read_lines n acc =
    if n = 0 then List.rev acc
    else read_lines (pred n) ((read_line ())::acc) in
  read_lines n []

let solve line =
    Scanf.sscanf
      line "%f %f %f %f %f %f"
      begin
        fun x1 y1 x2 y2 x3 y3 ->
        let p1, p2, p3 = Pt (x1, y1), Pt (x2, y2), Pt (x3, y3) in
        let Pt (xc, yc) = center p1 p2 p3 in
        let radius = radius p1 p2 p3 in
        Printf.printf "%.3f %.3f %.3f\n" xc yc radius
      end

let () =
  let num_lines = int_of_string (read_line ()) in
  List.iter solve (read_lines num_lines)