Rocks can be anisotropic due to a variety of reasons. When estimating rock velocities from seismic data, failure to introduce anisotropy into earth models could generate distortions in the final images that can have enormous economic impact. To estimate anisotropic earth velocities by tomographic methods, it is necessary to trace rays or to solve the wave equation in models where anisotropy has been properly considered. Thus, in this work we present a 3-D generalized ellipsoidal travel time formulation that allow us to trace rays in an anisotropic medium. We propose to trace rays in anisotropic media by solving a set of nonlinear optimization problems, where the group velocities for P and S wave propagation modes are 3-D ellipsoidal approximations that have been recently obtained. Moreover, we prove that this 3-D ellipsoidal anisotropic ray tracing formulation is a convex nonlinear optimization problem, and therefore any solution of the problem is a global minimum. Each optimization problem is solved by the global spectral gradient method, which requires first order information and has low computation and low storage requirements. Our approach for tracing rays in anisotropic media is a generalization in the sense that handles titled axis of symmetry and, close to the axis of symmetry, it is an accurate formulation for 2-D transversely isotropic media and 3-D orthorhombic media, depending on the input parameters. Moreover, this formulation gives the exact ray trajectories in 2-D and 3-D homogeneous isotropic media. The simplicity of the formulation and the low computational cost of the optimization method allow us to Partially supported by Fonacit project UCV-97-003769 D. Cores ( ) 374 D. Cores, M.C. Loreto present a variety of numerical results that illustrate the behavior and computational advantages of the approach, and the difficulties when working in anisotropic media.