Imagine a circular toroid coiled with a wire through which some current $I$ is flowing. Everywhere it is stated that the magnetic field inside this toroid can be calculated as $$\vec{B} = \mu \frac{NI}{2\pi r} \ \hat{\phi}$$
where $\mu$ is the magnetic permeability of the toroid, $N$ the number of loops the coil presents, $r$ the distance to the center of the toroid and $\hat{\phi}$ the typical versor in cylindrical coordinates.
My cuestion is: why doesn't the magnetic field depend on $z$, the vertical position?
As I see it, there is no symmetry in $z$ that allows us to automatically discard this coordinate. Namely, as we move radially (varying $r$), the field changes because the situation differs from one radius to another: we get closer to (or further away from) the wires, and that makes the field vary. If we moved along the $z$ direction, the case would be analogous. If we center the coordinate system such that the plane $z=0$ slices the toroid in two halves, we can see that at $z=0$ the current has just a component in the $\hat{z}$ direction, but if we analyze this for any other value of $z$ the current acquires other components as well. So I don't see why the magnetic field would not depend on $z$.
Does it depend on $z$ or not? If yes, how can one then calculate the actual magnetic field (the technique that would be used if the section was squared would no longer apply, I guess)?


