=======================================================
Explanation:
Add up the x coordinates of A and B
-2+1 = -1
Then cut that result in half
-1/2 = -0.5
This is the x coordinate of the midpoint.
Repeat these steps for the y coordinates: (1+5)/2 = 6/2 = 3
The midpoint of segment AB is located at (-0.5, 3)