A betatron is a device that accelerates electrons using an expanding magnetic field within a doughnut-shaped vacuum chamber. Electrons are injected into the chamber and accelerated as the magnetic field strength increases over time. This increasing magnetic flux induces an electric field that increases the electrons' energy, allowing them to gain extremely high speeds. The betatron condition requires that the rate of change of magnetic flux through the circular orbit equals 2π times the radius squared times the rate of change of the magnetic field, in order to maintain the electrons' constant orbital radius as they accelerate.