Magnetic Alternator & Magnetic Motor
The mechanism on the left is a magnetic alternator. The crank rotates the magnet causing the poles of the magnet to alternate.
Turn the crank by moving the mouse across the screen from left to right. As the poles of the rotating magnet alternate, the magnet in the motor on the right moves back and forth as it is alternately attracted and repelled by the changing polarity of the rotating magnet.