Let (x1,y1) and (x2,y2) be the two end points and (x,y) be the midpoint.
Understanding what is midpoint:
midpoint is a point that is in the middle and you can think of it as the average of two endpoints. So it can be found by adding the two end points and dividing the sum by 2. For example, what number is midway between 100 and 200? It is 150, which is (100+200)/2.
to calculate midpoint(x,y) we use
x=(x1+x2)/2
y=(y1+y2)/2
using these two equations and substituting the values of midpoint and the given endpoint (x1,y1), you can find the other endpoint . Remember when you solve the equations algebraically you have to first multiply both sides by 2, and then subtract x1 to get x2, and likewise for y2.
hope this helps!