Rotation and density distribution of the Andromeda nebula derived from observations of the 21-cm line