I have a function $z = B \sin x \ \sin y+\cos x \ \cos y$. Where $0 \leq x \leq \pi$ and $0 \leq y \leq \pi$. I need to find the length of the curve that describes a level set for any value of $B$. That is, if I set $z = A$ (where $A$ is some scalar constant), what is the length of the level curve for any value of the parameter $B$. Obviously some symmetry can be exploited to solve the problem, but I'm having trouble figuring out how to derive the length.