A compass points in the direction of the Earth’s weak magnetic field until a magnet is placed nearby. The strength of the Earth’s field is negligible compared to this magnet, and so the compass needle lines up with the magnet’s field.
In the case of two magnets, the magnetic field experienced by the compass is the vector sum of the two individual fields due to the magnets. This is the principle of superposition.
You will also approach the principle of a stepper motor.
Click on the 'magnet' buttons to place one or two of them on the scene, then select their orientation by clicking on the adjacent magnet images.
Click on “Comments” to make the field vectors visible.