Well, there are potentially a couple of problems there, because magnitude may turn out to be the hypotenuse and not the cathethus. Smallest magnitude could solve it, if there's no other issue involved. And you have to know where x y z point in game, and how they relate to pitch. Drawing would be a good approach.

However, if you're looking strictly at the angle, the scalar product can be used, and having a function that calculates angles between arbitrary vectors is really the best option.

If you want the angle between two vectors (x1, y1, z1) and (x2, y2, z2) you do the dot product, i.e. (x1x2+y1y2+z1z2) and divide by the product of their magnitudes. For accuracy reasons I would just do a single sqrt of both expressions in parantheses. Then acos the result.

If you're interested in pitch you just modify the vectors accordingly.

The other approach to get pitch, in a more visual way, is to use spherical coordinates:

https://en.wikipedia.org/wiki/Spherical_coordinate_system