This question belongs, me believes ,in trigonometry-analytic geometry. Anyway:

is an arrow beginning at and ending at and is its length, so using the cosines law (theorem) on the resulting triangle we get:

I'm not sure what is , but if you meant the dot product of these two vectors then just remember that , so you can substitute above.

Tonio