Variation of chemical shielding with internal coordinates. Applications to diatomic molecules