Xyz axis direction formula. Letting Y = yaw, P = pitch.