Interaction between like and unlike poles of a magnet