I learned from this answer that the correlation $R$ is $\cos(\theta)$ and $\theta$ is the angle between a dependent vector $Y$ and an independent vector $X$, but I learned from this article that the two vectors are normalized (by subtracting their corresponding means) ones.
I believe the normalized ones are correct for two reasons: 1) the unnormalized version doesn't make the correlation invariant to scaling and shift; 2) the results of the normalized version is exactly the correlation formula:
$$R=\frac{1}{n-1}\sum_{i=1}^n\frac{x_i-\bar x}{s_x}\frac{y_i-\bar y}{s_y}$$
But why should the two vectors be normalized?