
In this picture (I'm using a $3D$ space, I draw it in $2D$ just to simplify), I have to find if the circumference $c$ intersecate the subtraction between $v2$ and $v1$, by checking the length of that small segment called $d$. To find it, the easier way is to find the $\angle DBC$ and then use the cosine formula.
The problem is that I don't know how to find that angle, because I think the $2D$ formula $a = \text{acos}(\text{norm}(v)* \text{norm}(v'))$ is missing a dimension
Use inner product of vectors. The relation is $v.v' = |v| |v'| cos(\theta)$ with $norm(v)=|v|$.
Take $v=(a,b,c)$ and $v'=(a',b',c')$. The inner product is $v.v' = aa' + bb'+cc'$. The norm is $\sqrt{a^2 + b^2 + c^2}$.
So the angle becomes
$\theta = \cos^{-1} [\frac{v.v'}{|v||v'|}] = \cos^{-1} [\frac{aa' + bb'+cc'}{\sqrt{a^2 + b^2 + c^2} \sqrt{a'^2 + b'^2 + c'^2}}]$
Find components of each vector and substitute.