Trigonometry was invented by Muslim mathematicians as a way for worshippers to calculate the direction to Mecca for prayer.