The direction of the magnetic field at a point in the vicinity of a bar…