If the co-ordinates of the line segment AB are A(a,c) and B(b,d), the co-ordinates of the midpoint M are
M[(a+b)/2,(b+d)/2].
From this information you should be able to solve the problem.
BTW: this is a consequence of the so-called Side Splitter Theorem of plane geometry.