Sheikh Bahai's full name was Baha' Al-Din Al-'Amili. He was born in Baalbec in the Lebanon, the son of a Shi'ite father who brought him to Iran at the age of 13. He studied at first in Qazvin and then in Herat and finally settled in Isfahan. He was a true homo universalis with an encyclopaediac knowedge of sciences as diverse as horticulture and alchemy, and one of the few Sufis allowed to play a public role under Shah Abbas I. He played a major role in the design of the mosque which houses his sundial and also wrote legal textbooks and mystical epic poetry.