The effect of azimuthal variation in the height of the magnetic median plane on the vertical oscillations of a particle in a synchrotron having four straight sections is studied, particularly in the neighborhood of resonance between the frequency of these oscillations and the frequency of revolution. It is found that fourier analysis, which is needed in the case of a circular magnet, is replaced by analysis using modified sine and cosine functions. This investigation also applies to the effect on the radial betatron oscillations of azimuthal variation in the equilibrium radius.