Analytical calculation of black hole spin using deformation of the shadow