The Mathematical Imagination in Medieval Literature