In order to overcome the problem of singularities and nonuniform grids arising when solving eikonal equation in spherical coordinate systems, a spherical Cartesian coordinate system is defined and the Hamiltonian form of the eikonal equation according to this coordinate system is given. A modified velocity function that can transform spherical coordinate system–based eikonal equation into ones based on a spherical Cartesian coordinate system is deduced by using a differential geometric method where a layered distribution of the velocity function is assumed. After comparing the results of using this approach with the traditional method of solving eikonal equation based on a spherical coordinate system, the viability of the transformation to a spherical Cartesian coordinate system based on a modified velocity function is proven. Despite the assumption of a layered distribution of the velocity function, it is also proven that the method will hold for a velocity function under any three‐dimensional distribution. The new method overcomes problems present in traditional approaches and opens up a new way of solving eikonal equation in a spherical computational domain.