A symmetric linear algorithm for line segment generation