Tracing rays through graded-index media: a new method.