code: void d2xy(int n, int d, int[] xy) {
          int rx, ry, s, t = d;
          xy[0] = 0;
          xy[1] = 0;
          for (s = 1; s != n; s <<= 1) {
              rx = 1 & (t >> 1);
              ry = 1 & (t ^ rx);
              rot(s, xy, rx, ry);
              // if s was bits then shift
              xy[0] += s * rx;
              xy[1] += s * ry;
              t /= 4;
          }
      }
docs: convert d to (x,y)