Calculate angle of Rotation?

My game is a basic 3D platformer using a ball as the player. I want to update the position of the camera every frame based on the camera’s current rotation. I have figured out a way to do this, but in order to do it I need to be able to calculate the angle of rotation of the camera relative to the z axis

Maybe try: