How to calculate the middle of a line?

My question is following. I have a line with a given (X1, Y1) and (X2, Y2) coordinates (see figure below). I need to calculate coordinates of the middle of this line (X, Y). I tried to use classical method of finding distance between two coordinates, but it works only when the line is situated horizontally.

Could anybody help me with a formula to find coordinates of the middle of a given line please?

Thanks beforehand.

-
Generalization: You can get any point along the line by doing a weighted average of the vectors (e.g. $0.1*p1 + 0.9*p2$, to get 90% of the way towards p2). –  ninjagecko Jun 8 '11 at 20:56
You can just average the points: $x = \dfrac{x_1 + x_2}{2}$ $y = \dfrac{y_1 + y_2}{2}$