#include <bits/stdc++.h>
const double eps = 1e-10;
int T, X1, Y1, X2, Y2, X3, Y3;
double Cross(double X1, double Y1, double X2, double Y2, double X3, double Y3) {
  return (X1 - X2) * (Y3 - Y2) - (X3 - X2) * (Y1 - Y2);
}
bool Work(int X1, int Y1, int X2, int Y2, int X3, int Y3) {
  double a0 = 2 * (X1 - X2), b0 = 2 * (Y1 - Y2);
  double c0 = X2 * X2 - X1 * X1 + Y2 * Y2 - Y1 * Y1;
  double a1 = 2 * (X2 - X3), b1 = 2 * (Y2 - Y3);
  double c1 =
      -3 * (X2 * X2 + Y2 * Y2) - (X3 * X3 + Y3 * Y3) + 4 * (X2 * X3 + Y2 * Y3);
  double A0 = (c1 * b0 - c0 * b1) / (a0 * b1 - a1 * b0);
  double B0 = (a1 * c0 - a0 * c1) / (a0 * b1 - a1 * b0);
  double A1 = 2 * X2 - A0, B1 = 2 * Y2 - B0;
  double A2 = 2 * X3 - A1, B2 = 2 * Y3 - B1;
  double A3 = 2 * X1 - A0, B3 = 2 * Y1 - B0;
  double C0 = Cross(A0, B0, A1, B1, A2, B2);
  double C1 = Cross(A1, B1, A2, B2, A3, B3);
  double C2 = Cross(A2, B2, A3, B3, A0, B0);
  double C3 = Cross(A3, B3, A0, B0, A1, B1);
  if ((C0 < -eps && C1 < -eps && C2 < -eps && C3 < -eps) ||
      (C0 > eps && C1 > eps && C2 > eps && C3 > eps)) {
    printf("YES\n");
    printf("%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", A0, B0, A1, B1,
           A2, B2, A3, B3);
    return 1;
  }
  return 0;
}
int main() {
  for (scanf("%d", &T); T--;) {
    scanf("%d%d%d%d%d%d", &X1, &Y1, &X2, &Y2, &X3, &Y3);
    if (Work(X1, Y1, X2, Y2, X3, Y3)) continue;
    if (Work(X2, Y2, X3, Y3, X1, Y1)) continue;
    if (Work(X3, Y3, X1, Y1, X2, Y2)) continue;
    printf("NO\n\n");
  }
  return 0;
}
