Ray tracing in graded-index medium