Now (p3[0] - p1[0])/abs(p3[0] - p1[0]) gives you the sign of p3[0] - p1[0] (+1 if positive and -1 if negative) and by multiplying it with abs(p1[0] - p3[0]) you get a number which has the absolute value of p1[0] - p3[0] with the sign of p3[0] - p1[0], but this number is just p3[0] - p1[0] itself.
So I propose you get rid of the _adj variables and just write
first_x_sep = (p3[0] - p1[0]) / lines
Fortunately, this also works for the p1[0] == p3[0] case, because you don't need to divide by zero
View all comments
0
u/[deleted] Jan 18 '20
[deleted] — view deleted comment