WOLFRAM|DEMONSTRATIONS PROJECT

Creation of a Magnetic Field by an Electric Current

​
electric current
on
off
number of compass needles
4
invert current direction
Lighter
:Darker[ColorData[97][2],0.7] should be a valid color directive, an image, or a list of them.
Lighter
:Darker[ColorData[97][1],0.58] should be a valid color directive, an image, or a list of them.
Lighter
:Darker[ColorData[97][3],0.75] should be a valid color directive, an image, or a list of them.
General
:Further output of Lighter::arg will be suppressed during this calculation.
MapThread
:Object ColorData[97,ColorList]〚{2,1,3,4,5,6,7,8,9,10}〛 at position {2, 2​} in MapThread[{Specularity[White,#1],#2,Lighting#3}&,{{3,3,3,6,6,6,6,3,6,6},1,{{{Ambient,Lighter[Darker[ColorData[1][1],0.7],0.05]},{Directional,Darker[ColorData[97][2],0.7],ImageScaled[{0,2,2}]},{1},{Directional,Darker[ColorData[97][2],0.7],ImageScaled[{2,0,2}]}},9}}] has only 0 of required 1 dimensions.
Magnetic fields exist on all sides of a wire carrying an electric current (here only one magnetic field line is shown). The compass needle always deflects in the direction of the magnetic field lines of force when the current is switched on. When the direction of the current is inverted, the direction of the magnetic field is inverted too, as the arrows show. This can be remembered using the "right-hand rule".