$\ln$ an $n$-sided polygon magnetic field due to one of the side at
Centre of loop using Biot-Savart's law is
$B_1=\frac{\mu_0 I}{4 \pi l}\left(\sin \theta_1+\sin \theta_2\right)$
As, there are $n$ sides angle made by one of the side at centre is
$\alpha=\frac{2 \pi}{n}$
So, $\quad \theta_1=\theta_2=\left(\frac{2 \pi}{n}\right) \times \frac{1}{2}=\frac{\pi}{n}$
So, from Eq. (i), we have
$B_1=\frac{\mu_0 I}{4 \pi l}\left(\sin \frac{\pi}{n}+\sin \frac{\pi}{n}\right)=\frac{\mu_0 I}{2 \pi l}\left(\sin \frac{\pi}{n}\right)$
At centre field due to all $n$ segments are added up. So, magnetic field at centre due to complete polygon is
$B=n \times B_1=\frac{\mu_{0} n I}{2 \pi l} \sin \left(\frac{\pi}{n}\right)$


