In a mass spectrometer, an ion of charge, q, and mass, m, moving in a…