Fixed math in line calculations.

One more TODO related to x_range, then I can try to plot the
constraints. Next, get inequality right.