Transverse magnetic plane-wave scattering equations for infinite and semi-infinite rectangular grooves in a conducting plane