magnetic scalar potential of a rectangular bar magnet