Today I continued the calculation the for the magnetic field generated by a circular coil in any position. I can express the field using f1(x)=integral(1/(1-x*cos(t)),t,0,2*pi) and f2(x)=integral(cos(t)/(1-x*cos(t)),t,0,2*pi).
These functions are not expressible using commons functions but they can be expressed using first-kind and second-kind elliptic integral functions for which a C implementation could be found (not in math.h). The implementation seems slow so if we use these magnetic field model, it might be better to approximate f1 and f2 by polynoms. We always have 0<=x<1.
I also discussed with Marc-O about the model. He made the calculations using the magnetic dipole model for the coil, which is an approximation for a small circular coil. He already has results about the calculation of the position so we decided that we will keep his model. We will eventually switch to my model later if we find that the dipole model approximation is not precise enough.