https://primanota.net/shaananigin/distance-chords.htm