Elastic scattering of electrons by oxygen and nitrogen at intermediate energies