The slope of $L_1$ is
Let the other end point of $L_2$ be $(x,y)$.
The slope of $L_2$ then will be
Now, to find the angle $\theta$ between two lines with slopes $m_1$ and $m_2$, use the relation,
There are two angles between a pair of line segments, and it depends on the context which one you are looking for.
In this context, the angle $X$ is the angle made by $L_2$ with respect to $L_1$ when measured clockwise, while as per convention, $\theta$ is taken anti clockwise.
Thus, the relation between $X$ and $\theta$ will be,