# Euler angles and singularities

I made a question on stack overflow where i am asking to measure angle around an axis without affected by gimbal lock. If you know the answer or have any suggestion please let me know.

https://stackoverflow.com/questions/58750035/measure-angle-for-swing-motion

## Comments

Quaternions are used to combat gimbal lock.

I know that but at some point i have to convert quaternions back to Euler angles to tell the user that pendulum has θ angle on specific axis. So there is the problem , how to tell user what is the sensor angle without converting to Euler angle.

Edit: Also i know i can get an angle using quaternions and hamilton product but it will not be possible to get angle in x,y,z (i.e the pendulum rotate θ around x axis, φ around y axis)

Find a library that does the conversion for you.