I am developing an app, in which I record the device orientation and position of the user. I tried to calculate the Euler Angels (pitch, roll & yaw) out of the Rotationmatrix given by CMAttitude. I was not able to do that. I already read how the Data is recorded and which Euler Angle represent which rotation (https://developer.apple.com/documentation/coremotion/getting_processed_device-motion_data/understanding_reference_frames_and_device_attitude).
I'm searching for a formula for calculating the rotation matrix (https://developer.apple.com/documentation/coremotion/cmattitude/1616139-rotationmatrix) out of the roll, pitch & yaw value and reverse.