The synchrotron is an improvement over the cyclotron where the particles travel in a spiral pattern. A cyclotron uses a constant magnetic field and a constant-frequency applied electric field. (One of these is varied in the synchrocyclotron). Both of these fields are varied in the synchrotron to change the path from a spiral to a circle. By carefully making the fields bigger as the particles gain energy, the width of the circular path can be kept the same as the machine accelerates the particles. This allows the vacuum chamber for the particles to be a large thin circular pipe torus (donut shape). It is easier to use some straight sections between the bending magnets and some bent sections within the magnets giving the torus the shape of a round-cornered polygon. A path that acts like a very large circle can be constructed using simple straight and curved pipe segments, unlike the disc-shaped chamber of the cyclotron type devices. The shape also requires the use of multiple magnets to bend the particle beams. Straight sections are required at spacings around a ring for both radiofrequency cavities, and in third generation setups space is allowed for insertion of energy extraction devices such as wigglers and undulators. Most synchrotrons use two types of magnets: dipole magnets to bend the particle beam and quadrupole magnets to focus the beam.