  We simulate the hypothesised collision between the proto-Earth and a
Mars-sized impactor that created the Moon. Amongst the resulting debris disk in
some impacts, we find a self-gravitating clump of material. It is roughly the
mass of the Moon, contains $\sim1\%$ iron like the Moon, and has its internal
composition resolved for the first time. The clump contains mainly impactor
material near its core but becomes increasingly enriched in proto-Earth
material near its surface. A graduated composition has recently been measured
in the oxygen isotope ratios of Apollo samples, suggesting incomplete mixing
between proto-Earth and impactor material that formed the Moon. However, the
formation of the Moon-sized clump depends sensitively on the spin of the
impactor. To explore this, we develop a fast method to construct models of
multi-layered, rotating bodies and their conversion into initial conditions for
smoothed particle hydrodynamical (SPH) simulations. We use our publicly
available code to calculate density and pressure profiles in hydrostatic
equilibrium, then generate configurations of over a billion particles with SPH
densities within $1\%$ of the desired values. This algorithm runs in a few
minutes on a desktop computer, for $10^7$ particles, and allows direct control
over the properties of the spinning body. In comparison, relaxation or spin-up
techniques that take hours on a supercomputer before the structure of the
rotating body is even known. Collisions that differ only in the impactor's
initial spin reveal a wide variety of outcomes: a merger, a grazing
hit-and-run, or the creation of an orbiting proto-Moon.
