Спасибо gis-lab: http://gis-lab.info/qa/aveazimuth.html