Wires carrying current in a magnetic field experience a mechanical force perpendicular to both the current and magnetic field. André-Marie Ampère in the 1820s observed this underlying mechanism that led to the discovery of the Hall effect. However it was not until a solid mathematical basis for electromagnetism was systematized by James Clerk Maxwell 's " On Physical Lines of Force " (published in 1861–1862) that details of the interaction between magnets and electric current could be understood.