Mapping line segments onto each other