Text this: Propagation of rays in 2D and 3D waveguides