Mechanics and Cosmology in the Medieval and Early Modern Period