# Ray Tracing Method of Gradient Refractive Index Medium Based on Refractive Index Step
## 1 Introduction  
The optical phenomenon in the gradient refractive index medium, as a ubiquitous objective physical phenomenon in nature, has been noticed for a long time. The Maxwell fisheye lens, the Wood lens, the Luneburg lens, the Gradient index rod lens, etc., can all be regarded as historical signs of the research on gradient index optics [1]. Due to the change in the refractive index of the medium, the original path of the light propagating in it is changed, which results in the deflection or phase change of the light and it also results in the image offset, blur, and jitter. Therefore, ray tracing in gradient refractive index media has become a research hotspot.  
The ray tracing through graded refractive index media is based on the solution of the ray formula:  
\[\frac{d}{ds}\left(n\frac{d\textbf{r}}{ds}\right)=\
abla n \tag{1}\]  
where \(s\) is the distance along the ray path, **r** is the position of the ray, and \(n\) is the index of refraction. Regarding Formula (1), [PERSON] proposed a universal numerical solution in 1968 [2]. Since then, the Runge-Kutta method, Euler method, and Taylor series expansion method have been applied to solve Formula (1), which have laid the foundation of gradient refractive index media ray tracing for a long time [3, 4]. Most ray tracing methods are based on the three methods which have been listed on references [5, 6, 7]. In the ray tracing process,these methods are all iteratively based on the refined elements [8; 9; 10] or spatial geometric steps [4; 11; 12]. When ray tracing is performed in a gradient refractive index medium with a gentle refractive index gradient, the accuracy of the ray tracing can be controlled by changing the geometric step. However, when encountering a gradient refractive index field with a sharp change (such as the shock wave of a high-speed aircraft [13; 14; 15]), it is necessary to adjust the geometric step according to the refractive index gradient aimed to be self-adaptive to the local refraction index gradient and grid geometry scale [7; 16]. Even so, it is still possible to cross the region where the refractive index changes sharply in one iterative step. This situation often causes the refraction effect of the refractive index layer whose refractive index changes sharply to be ignored. In order to ensure the accuracy of the entire ray tracing path, the geometrical step-based ray tracing method (RTSGS) generally needs to set a smaller geometric tracing step. It will decrease efficiency in the tracing area where the refractive index changes slowly. Therefore, it will increase useless calculations [17].  
This paper proposes a ray tracing method based on refractive index steps (RTRIS). In this method, the refractive index step \(\Delta n\) is used to replace the geometric step \(\Delta s\) of the traditional ray tracing method. The advantage of this method is that each iterative process takes equal refractive index step \(\Delta n\) as the iterative step. In areas where the refractive index changes slowly, a relatively large distance will be performed in the iterative process to achieve high-efficiency ray tracing. In areas where the refractive index changes sharply or suddenly, the iterative step will reduce automatically to capture the sudden changes in the refractive index effectively. It can achieve refined tracing and improve ray tracing accuracy. The application of this method avoids the problem of being unable to capture regions of sudden changes in the refractive index after applying the step size regulation function. It can also effectively avoid the problem of insufficient tracing accuracy or low efficiency caused by unreasonable geometric step setting. By using the proposed method, the efficiency of ray tracing can be achieved while the accuracy of ray tracing can be improved. Thus, the method realizes the adaptive process of the gradient index medium in the ray tracing process.