https://primanota.net/half-man-half-biscuit/mathematically-safe-chords.htm