Generalization of ray tracing in symmetric gradient-index media by Fermat's ray invariants.