Critical angles between two convex cones I. General theory