Abu al-Wafa works at the Baghdad observatory from 959 under Buyid patronage and produces the most precise trigonometric tables of the Middle Ages: sines and tangents at intervals of 15 arcminutes. He introduces the systematic use of the tangent function in astronomy (previously only sines were used), and for the first time defines the secant and cosecant functions as computational tools. He proves the sine rule for general spherical triangles, facilitating astronomical position calculations. In 997 he collaborates with Al-Biruni in a synchronized lunar-eclipse observation experiment to determine the longitude difference between Baghdad and Khwarezm — one of the earliest documented coordinated long-distance scientific experiments. His Kitāb al-Majisṭī directly influenced Al-Biruni and was cited by Arab astronomers for two centuries.