Line segments and distances