Two blocks are connected by a massless rod as shown in the picture. $\delta x_{i}$ are virtual displacements.
According to the notes I'm reading, the constraint due to the rod having constant length is: $$ \delta x_{1} \sin \theta = \delta x_{2} \cos \theta $$
I don't understand where this comes from. If $(0, x_{1})$ and $(x_{2}, 0)$ are the positions of the blocks, then all I can think of is:
$$ L = \sqrt{x_{1}^2 + x_{2}^2} = const $$
$$ \tan \theta = \frac{x_{1}}{x_{2}} $$
Can I obtain the constraint from this relations or am I missing something? Also, how can I involve the virtual displacements?
Thanks.

Since $x_1^2 + x_2^2 = L^2$, differentiation gives $x_1(-\delta x_1) + x_2\delta x_2 = 0$ (with the physicists' interpretation of "virtual displacements" as being "infinitesimally small"). Note that the orientation of the vertical axis introduces the sign on $\delta x_1$. But $x_1=L\sin\theta$ and $x_2=L\cos\theta$. Upon dividing by $L$, we have $\sin\theta\,\delta x_1 = \cos\theta\,\delta x_2$, as desired.