Magnetism has been known and studied for centuries, with early uses including compasses by ancient Greeks, Romans, and Chinese. In the 13th century, Petrus Peregrinus mapped the magnetic field of a lodestone and discovered magnets have north and south poles. William Gilbert established in 1600 that Earth acts as a giant magnet. Later, scientists like John Michell, Charles Coulomb, Hans Christian Oersted, Andre-Marie Ampere, Dominique Arago, Michael Faraday, and Joseph Henry explored connections between electricity and magnetism, with Faraday inventing the dynamo and electric motor. James Clerk Maxwell then published a complete theory of electromagnetism in the 19th century.