Debugging code for finding perpendicular line segments