bFieldFromVolumeCurrent
    :: VectorField  -- ^ volume current density
    -> Volume       -- ^ geometry of the volume current
    -> VectorField  -- ^ magnetic field (in T)
bFieldFromVolumeCurrent j c r
    = k *^ volumeIntegral 50 50 50 integrand c
      where
        k = 1e-7  -- mu0 / (4 * pi)
        integrand r' = (j r' >< d) ^/ magnitude d ** 3
            where
              d = displacement r' r

-- | The magnetic field produced by a current distribution.
--   This is the simplest way to find the magnetic field, because it
--   works for any current distribution (line, surface, volume, or combination).
bFieldFromVolumeCurrent
    :: VectorField  -- ^ volume current density
    -> Volume       -- ^ geometry of the volume current
    -> VectorField
bFieldFromVolumeCurrent j c r
    = k *^ volumeIntegral 50 50 50 integrand c
      where
        k = 1e-7  -- mu0 / (4 * pi)
        integrand r' = (j r' >< d) ^/ magnitude d ** 3
            where
              d = displacement r' r

-- | The magnetic field produced by a current distribution.
--   This is the simplest way to find the magnetic field, because it
--   works for any current distribution (line, surface, volume, or combination).
bFieldFromVolumeCurrent j c r
    = k *^ volumeIntegral 50 50 50 integrand c
      where
        k = 1e-7  -- mu0 / (4 * pi)
        integrand r' = (j r' >< d) ^/ magnitude d ** 3
            where
              d = displacement r' r

-- | The magnetic field produced by a current distribution.
--   This is the simplest way to find the magnetic field, because it
--   works for any current distribution (line, surface, volume, or combination).