Calculation of anisotropy constants