bFieldFromLineCurrent
    :: Current      -- ^ current (in Amps)
    -> Curve        -- ^ geometry of the line current
    -> VectorField  -- ^ magnetic field (in Tesla)
bFieldFromLineCurrent i c r
    = k *^ crossedLineIntegral 1000 integrand c
      where
        k = 1e-7  -- mu0 / (4 * pi)
        integrand r' = (-i) *^ d ^/ magnitude d ** 3
            where
              d = displacement r' r

-- | Magnetic field produced by a surface current.
--   The function 'bField' calls this function
--   to evaluate the magnetic field produced by a surface current.
--   This function assumes that surface current density
--   will be specified parallel to the surface, and does
--   not check if that is true.
bFieldFromLineCurrent
    :: Current      -- ^ current (in Amps)
    -> Curve        -- ^ geometry of the line current
    -> VectorField
bFieldFromLineCurrent i c r
    = k *^ crossedLineIntegral 1000 integrand c
      where
        k = 1e-7  -- mu0 / (4 * pi)
        integrand r' = (-i) *^ d ^/ magnitude d ** 3
            where
              d = displacement r' r

-- | Magnetic field produced by a surface current.
--   The function 'bField' calls this function
--   to evaluate the magnetic field produced by a surface current.
--   This function assumes that surface current density
--   will be specified parallel to the surface, and does
--   not check if that is true.
bFieldFromLineCurrent i c r
    = k *^ crossedLineIntegral 1000 integrand c
      where
        k = 1e-7  -- mu0 / (4 * pi)
        integrand r' = (-i) *^ d ^/ magnitude d ** 3
            where
              d = displacement r' r

-- | Magnetic field produced by a surface current.
--   The function 'bField' calls this function
--   to evaluate the magnetic field produced by a surface current.
--   This function assumes that surface current density
--   will be specified parallel to the surface, and does
--   not check if that is true.