Traveltime tomography in anisotropic media-I. Theory