I didn't expect that you teach me the lesson, maybe I spoke not clearly, sorry. I studied The rotation matrices with Euler angles, as I studied the job of accelerometers, gyroscopes and magnetometers. But I am a rookie in the sensor that at the same time I am in trouble to write the theory as code, and above all starting from taking your code and change something to adapt it to LSM6DS3