Original form for Biot-Savart Law is
d\vec{B}=\frac{\mu_0}{4\pi} \frac{I\,d\vec{l}\times\hat{r}} {r^2}

For the calculation in the code. I use another variable(cst) to represent \frac{\mu_o\, I}{4\pi}
And transform \frac{I\,d\vec{l}\times\hat{r}}{r^2} into \frac{I\,d\vec{l}\times\vec{r}}{r^3}
Where \hat{r}= \frac{\vec{r}}{r}.

\vec{l} is in y-z plane. corresponds to (yc[i],zc[i]) in the code.
and \vec{r} corresponds to (xp-xc[i],yp-yc[i],zc[i])
Then calculate the cross product for the above two vector.

The integration is done by sum of components from all the coil segments.