Magnetic Field at a Point due to Magnetic Dipole (or Bar Magnet) —
The magnetic field due to a bar magnet at any point on the axial line (end on position) is given by
$B_{\text {axial }}=\frac{\mu_0}{4 \pi} \frac{2 M r}{\left(r^2-l^2\right)^2}$
Where $r=$ distance between the centre of the magnet and the given point on the axial line, $2 l=$ magnetic length of the magnet and $M=$ magnetic moment of the magnet.
For short magnet, $l^2 \ll r^2$
$B_{\text {axial }}=\frac{\mu_0 2 M}{4 \pi r^3}$
The direction of $B_{\text {axial }}$ is along SN.
The magnetic field due to a bar magnet at any point on the equatorial line (broad-side on position) of the bar magnet is given by
$B_{\text {equatorial }}=\frac{\mu_0 M}{4 \pi\left(r^2+l^2\right)^{3 / 2}}$
For short magnet, $l^2<<r^2$
$B_{\text {equatorial }}=\frac{\mu_0 M}{4 \pi r^3}$
The direction of $B_{\text {equatorial }}$ is parallel to NS.