Hi,
Thanks for your inquiry.
3-axis accelerometer is able to measure the tilt angle pitch and roll with respect to earth gravity. The magnitude of 3-axis accelerometer is sqrt(x^2+y^2+z^2). Because accelerometer is not able to measure yaw angle, the direction of the magnitude vector can be pointing to anywhere in 360 degrees like a cone.
If you want to have yaw angle, then you need to use IMU which is accel + gyro. This will give you 6DoF sensor fusion for absolute pitch/roll angles and relative yaw angle. Relative yaw angle means future rotations are with respect to the initial direction of the magnitude vector. You will not be able to go back to the initial direction after operation because of gyro drift.
If you want to have absolute yaw, then you need to use IMU + magnetometer to form 9DoF sensor fusion. You can do online search for 9DoF sensor fusion C language libraries. BHI360 + BMM350 can give you absolute heading/pitch/roll Euler angles and the 9DoF sensor fusion algorithm is running inside BHI360. Please see the attached document for evaluation.
Thanks.
... View more