Add a length method to find the length of a line segment.