For a series of (x_i,y_i) pairs, the covariance is calculated as

{\text cov}\ =\ \frac{\sum (x_i - x_{avg}) (y_i - y_{avg})}{N}

with x_avg and y_avg the average values of all the x_i and y_i, and N the total number of pairs.

Compare with Variance, that expresses the variations in a single series of elements.

See http://en.wikipedia.org/wiki/Covariance