# Is this a correct use of Ampère’s Law?

Here is the derivation (http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/toroid.html) of magnetic field produced by a toroid. He has taken the loop to be a circle, and Ampère’s law says that current should pass through the surface created by this loop but as far as I can think no current is passing through the surface of that circular Ampèrean loop rather the current is going through the coil of toroid i.e. current is following a helical path it’s not coming out from bottom to top. So how can we equate that current with the total current crossing the surface of loop. I apologise for being not so clear but I’m trying my fullest.

Where knowing the circumference of the plastic tube is $$2\pi r$$, and knowing the sum of the current to be $$I$$, then the magnetic flux is $$B = \dfrac{\mu_o ~ I }{ 2 \pi r}$$
Now, back to the given derivation in your link, you would find even though you have only one wire carrying a current $$I$$, but this current is keep moving in and out of Amperian loop for $$N$$ turns, it is like you have N wires inside our Amperian loop, and for each turn the wire is contributing a current of $$I$$ into our Amperian loop and hence the total current which is coming into our Amperian loop is $$N I$$, and as before the magnetic flux would be $$B = \dfrac{\mu_o ~ N ~ I }{ 2 \pi r}$$