To divide a line segment in the ratio c:d, we can apply the ratio to the coordinates of the endpoints of the segment. So we consider two points P(x₁,y₁) and Q(x₂,y₂)
Assuming that c:d is the partitioning as viewed from P, we first divide the distance from P to Q by c+d. Therefore we have (x₂-x₁)/(c+d) and (y₂-y₁)/(c+d). This gives the units of the segment division. We move c units from P: x₁+c(x₂-x₁)/(c+d), y₁+c(y₂-y₁)/(c+d).
Or we could move backwards d units from Q: x₂-d(x₂-x₁)/(c+d), y₂-d(y₂-y₁)/(c+d). We should get the same result: (x₁c+x₁d+x₂c-x₁c)/(c+d), (y₁c+y₁d+y₂c-y₁c)/(c+d)=(x₁d+x₂c)/(c+d), (y₁d+y₂c)/(c+d); and:
(x₂c+x₂d-x₂d+x₁d)/(c+d), (y₂c+y₂d-y₂d+y₁d)/(c+d)=(x₂c+x₁d)/(c+d),(y₂c+y₁d)/(c+d). So the two operations do give the same result.
Now we let c=d=1 for the midpoint 1:1: (x₁+x₂)/2, (y₁+y₂)/2, that is, the average of the endpoint coordinates.
This solution derives the partition formula in detail for the general case as well as showing the special case of the midpoint. The method works because of the rules of similar triangles which also involves ratios.