how to measure line segments