Propagation of electromagnetic waves through a continuously varying stratified anisotropic medium