similarity=cosθ=A⋅B∣∣A∣∣ ∣∣B∣∣=∑Ai×Bi∑Ai2×∑Bi2similarity = cos\theta = {A\cdot B \over ||A||\ ||B||}={\sum A_i×B_i\over \sqrt{\sum A_i^2}×\sqrt{\sum B_i^2}}similarity=cosθ=∣∣A∣∣ ∣∣B∣∣A⋅B=∑Ai2×∑Bi2∑Ai×Bi