MagneticFieldCurrentLoop:

% Computes fields for multiple current loops.
 The loops are nominally in the yz-plane. You rotate them with the
 quaternion q(:,k) and translate the rotated coils with p(:,k).
 Rotation is done first and then translation of the coil center.

 If using this function to plot field lines you should arrange the coils
 so that the point [0;0;0] is in the center.

 When plotting field lines the accuracy of the computation will cause
 the field lines not to close. If the computation is continued, the
 field lines will spiral.

 Type  MagneticFieldCurrentLoop for a demo. It will plot the field
 vectors for two coaxial coils of different radii and different x
 positions and also the field lines.
--------------------------------------------------------------------------
   Form:
   b = MagneticFieldCurrentLoop( i, a, p, q, x )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   i           (1,:)  Currents in each loop
   a           (1,:)  Loop radii
   p           (3,:)  Loop positions
   q           (4,:)  Loop quaternions from fixed to the loop frame
   x           (3,:)  Points at which to compute b
   or
   d           (1,1)  Data structure
                      .nL     (1,1) Number of lines to plot
                      .nP     (1,1) Number of points per line

   -------
   Outputs
   -------
   b           (3,:)  Field (T)

--------------------------------------------------------------------------
   Reference: http://www.netdenizen.com/emagnettest/offaxis/?offaxisloop
--------------------------------------------------------------------------

Children:

Common: Graphics/NewFig
Common: Graphics/TitleS
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Graphics/ZLabelS
Common: Quaternion/QForm
Math: Analysis/Jacobian
Math: Linear/DupVect
Math: Linear/Mag
Math: Linear/Unit