Ptolemaeus, Alphonsus och Arzachel