How compute the angle (in rad) between x= [3, 4] and y= [1, −1] using the dot product?

389 Views Asked by At

I used the formula, $$rand = \frac{X^TY}{\Vert{x}\Vert{y}\Vert}$$ and got $$\frac{-1}{5{\sqrt 2}}$$ -0.1414213562373095 as the answer but the test case says the result is incorrect, is there anything I am doing wrong.

1

There are 1 best solutions below

0
On BEST ANSWER

That's the cosine of the angle. You need to apply the arccos function to get the angle itself.