Applied mathematics in the tenth century: Abu'l-wafā' calculates the distance baghdad-mecca