Measuring magnetization in anisotropic magnetic samples using a torque method