Suppose I have 2 vectors $\vec{a}= (5,1)$ and $\vec{b}= (2,4)$. I want to compute the angle between them.
See my calculations below. Supposedly the answer is $35.18^{\circ}$ degree but my answer as seen below is not.
I use my calculations using C# .Net
double scalarProduct = a1 * b1 + a2 * b2; double sqrA = Math.Pow(a1,2) + Math.Pow(a2,2); double sqrb = Math.Pow(b1, 2) + Math.Pow(b2, 2); double v = Math.Cos(scalarProduct/(Math.Sqrt(sqrA*sqrb)));
What went wrong?