Peter Peregrinus conducted early experiments on magnetism in the 13th century and wrote the first treatise on magnetic properties called "Epistle of Magnete". In it, he described how magnets attract and repel each other and how to identify the poles of a compass. Later, Maricourt discovered that a magnetized needle pointed in a consistent direction when placed near a lodestone, and he identified the needle's orientation with the north and south poles of Earth. His experiments showed that a magnet's attraction and repulsion depended on the orientation of its poles. This understanding of magnetic polarity played an important role in later theories of magnetism.