As the doc shows, Heading is the rotation about the negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about the positive x axis.
So where is the negative z axis? Where is the z axis? Is it relative to the earth? Or itself?