For simplicity let us work in 2 dimensions.

You have to vectors (non-zero),

You are given the distance .

Thus,

*

**

You are also given their sum,

Where are given.

Thus,

(1)

(2)

Square (1) and Square (2),

Add these two equations,

From * and ** we have,

Divide by two,

(5)

Now, the angle between these vectors are found by,

Substitute (5) into this equation because that is the dot product.