import Control.Monad (replicateM_, liftM)
import Text.Printf (printf)

main = do
    n <- readLn
    replicateM_ n (input >>= output . solve)

type Point = (Double, Double)
type Radius = Double

input :: IO (Point, Point, Point)
input = do
    line <- getLine
    let
        [ox,oy,ax,ay,bx,by] = map read $ words line
    return ((ox,oy),(ax,ay),(bx,by))

output :: (Point, Radius) -> IO ()
output ((cx,cy),r) = printf "%.3f %.3f %.3f\n" cx cy r

solve :: (Point, Point, Point) -> (Point, Radius)
solve ((ox',oy'),(ax',ay'),(bx',by')) = (center, radius)
    where
    center = (cx', cy')
    radius = sqrt (cx*cx + cy*cy)

    cx' = ox' + cx
    cy' = oy' + cy

    cx = s * ax + t * bx
    cy = s * ay + t * by

    s = (a2 * b2 - ab * b2) / 2.0 / (a2 * b2 - ab * ab)
    t = (a2 * b2 - ab * a2) / 2.0 / (a2 * b2 - ab * ab)

    a2 = ax * ax + ay * ay
    b2 = bx * bx + by * by
    ab = ax * bx + ay * by

    ax = ax' - ox'
    ay = ay' - oy'
    bx = bx' - ox'
    by = by' - oy'