Explanation:
to find the midpoint of a line segment given 2 endpoints, (x1, y1) and (x2, y2) :
add each x-coordinate and divide by 2 to find x of the midpoint. add each y-coordinate and divide by 2 to find y of the midpoint.
so, let's call the midpoint of AB M :
M = ((x + 2x)/2, (y + 2y)/2) = (3x/2, 3y/2)