I'm currently studying sensors in android and I don't quite understand whether it is possible to solve one problem. On my desk there is a drawing approximately the same as in the screenshot. I want to attach the smartphone with both sides (first the top - 1 and then the bottom - 2) and get the angle between them. screenshot
I tried using a magnetometer and an accelerometer for this, I got a rotation matrix, but it gives the wrong angles when I place the smartphone like in the screenshot. Is there any way to solve this problem?