The influence of magnetic and electric fringing fields on the trajectories of charged particles