I am rotating a camera around an object as the object rotates so that the camera stays behind it. I figured I could use toAngleAxis on the object's localRotation to get the angle needed for moving the camera. However the angle is positive when I rotate in either direction. The code below works for rotating left and if angle was negative it would work for rotating to the right. The problem is I am not sure of a way to tell when toAngleAxis is returning an angle to the right or left of the original rotation.

angle = camState.getFocus().getLocalRotation().toAngleAxis( new Vector3f(0,1,0) );

x = camState.getCenter().x - distance*FastMath.sin( angle );

z = camState.getCenter().z - distance*FastMath.cos( angle );

camState.setLoc( x, y, z );

camState.lookAt( camState.getFocus().getLoc(), Vector3f.UNIT_Y );