For the purpose of efficiently homogenizing a magnetic field, when homogenizing
a strength distribution of a magnetic field generated in a space between a pair
of facing pole surfaces, a continuous magnetization distribution for homogenizing
the strength distribution of the magnetic field is determined with respect to planes
on which magnetic elements are to be disposed for homogenizing the strength distribution
of the magnetic field; and magnetic elements are disposed based on the magnetization
distribution. The magnetic distribution is determined as a polynomial of an orthogonal
function. The polynomial is determined by an optimization method. The optimization
method is a method of least squares.