The endpoints are the (x₁, y₁) and (x₂, y₂) values. It does not matter which endpoint is first or second. You will get the same answer either way.
For example: assume we have two endpoints with coordinates (1, 3) and (4, 5)
Let (1,3) represent the first coordinate and (4,5) the second coordinate.
Then, M = [tex] (\frac{x2 + x1}{2} , \frac{y2 + y1}{2} ) = (\frac{4 + 1}{2} , \frac{5 + 3}{2} ) = (\frac{5}{2} , \frac{8}{2}) = (\frac{5}{2} , 4) [/tex]
Now let's change the order so that (4, 5) represents the first coordinate and (1,3) represents the second coordinate.
Then, M = [tex] (\frac{x2 - x1}{2} , \frac{y2 - y1}{2} ) = (\frac{1 + 4}{2} , \frac{3 + 5}{2} ) = (\frac{5}{2} , \frac{8}{2}) = (\frac{5}{2} , 4) [/tex]
Since we are adding two numbers and addition is commutative, then it doesn't matter which order the endpoints are in.