Had a bit of a moment. Made interpolate() use mid_x and mid_y, not x and y.