This simulation shows Ampere's law as it is applied to an ideal solenoid. The solenoid is shown in green as a cross-section, and its magnetic field is shown in red.
Adjust the current through the wire with the green slider. Move the blue points to adjust the Amperian loop. The equations below automatically update to show how Ampere's law is applied.