The StonerWohlfarth model is a fundamental model in magnetism. However, the traditional solution methods can only provide analytical solutions for three specific angles. In this paper, by using the idea of inverse functions, a simple analytical solution for this model under general conditions is obtained. Using this analytical solution, the hysteresis loop describing static magnetism and the trajectory of magnetization intensity movement describing dynamic magnetism are obtained. The acquisition of this analytical solution provides a simple, intuitive and accurate scheme for quantitatively describing the stable direction of the uniform rotation of magnetization intensity and the precession image around that direction.