An impetus to some of the research on magnetism in the eighteenth and nineteenth centuries was the need for a compass accurate near the polar regions, particularly in the search for the Northwest Passage. Gian Domenico Romagnosi's discovery (1802) that a magnetic needle would move when subjected to an electric field first convincingly demonstrated the (long suspected) relationship between electricity and magnetism, a discovery that was later developed by Hans Christian Oersted in 1819, André Marie Ampère in 1820, and Michael Faraday in 1821. Ampère's 1827 account of his electrodynamic theory showed that magnetism and electromagnetism were the same force, and both could be produced by electrical currents. Faraday was the first to make sense of Oersted's and Ampè's results, and applied his knowledge to build the first electric motor and the first electric generator.
The discovery of the relationship between electricity and magnetism, and especially Priestley's discovery that electricity and magnetism follow the same inverse-square law that Newton formulated for gravity, led many investigators to search for a unified field theory to demonstrate the essential unity of all natural forces. The project seemed even closer to achievement when James Prescott Joule demonstrated in 1843 that heat behaved similarly with respect to the conservation of energy, and when Faraday explored the rotation of the plane of polarization of light by magnetism in 1845. Beginning in 1855, the Scottish physicist James Clerk Maxwell came closer still with his mathematical electromagnetic theories, theories confirmed by Heinrich Hertz's detection of electromagnetic waves in 1886, paving the way for wireless broadcasting.