Stoner-Wohlfarth model for the anisotropic case