Cosine rule: Given the lengths of the three sides of a triangle, a, b, and c, then we can calculate the angles, A, B, and C, (c is the side opposite angle C, b is the side opposite angle B and c is the side opposite angle C) from the "cosine rule".
\(\displaystyle c^2= a^2+ b^2- 2ab cos(C)\) so \(\displaystyle cos(C)= \frac{c^2- a^2- b^2}{2ab}\)
\(\displaystyle b^2= a^2+ c^2- 2ac cos(B)\) so \(\displaystyle cos(B)= \frac{b^2- a^2- c^2}{2ac}\)
\(\displaystyle a^2= b^2+ c2- 2bc cos(A)\) so \(\displaystyle cos(A)= \frac{a^2- b^2- c^2}{2bc}\)
In your problem, "a" can be taken as the distance from B to C, "b" can be taken as the distance from B to D, and "c" can be taken as the distance from C to D. Then your desired angle is "C" so use \(\displaystyle cos(C)= \frac{c^2- a^2- b^2}{2ab}\).