§ How it works
A solenoid is a stack of loops. Integrating the single-loop axial field over a uniform winding density gives the closed form
The two bracket terms are , the cosines of the angles subtended by each end. For a long coil both approach 1 and the familiar results. At an end, one angle is 90°, so the field drops to about half, visible as the shoulders in the plot.
The "uniform zone" reports where the field stays within 1 % of the centre value; useful for designing test coils, magnetisers and sensor calibration fixtures.