Original form for Biot-Savart Law is
For the calculation in the code. I use another variable(cst) to represent
And transform into
is in y-z plane. corresponds to (yc[i],zc[i]) in the code.
and 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.