midpoint for odd and even line cases