draw lines using middle point algorithms.