Finite element and finite difference methods in electromagnetic scattering