R code from paper: The motion of an arbitrary rotating spherical projectile and its application to ball games