x=\frac{\sum_{i=1}^{N}a_{i}b_{i}}{\sum_{i=1}^{N}b_{i}^2}