Magnetic poles on Earth and how a compass operates