A computer code that integrates the ray equations for the cold plasma dispersion relation in an inhomogeneous medium is developed. This algorithm is applied to two cases of interest in radio-frequency heating and current drive, namely, the lower hybrid spectrum (1.0 to 2.5 GHz) and the electron cyclotron resonance spectrum (30 to 300 GHz). The geometry studied is the compact torus fusion device. Traces of the propagation of lower hybrid waves and electron cyclotron heating frequency waves are shown.