Kinematic and dynamic raytracing in anisotropic media: theory and application