Given the image:

and that $x_0 = 1, y_0=0$ and $\text{angles} \space θ_i , i = 1, 2, 3, · · ·$ can be arbitrarily picked.
How can I derive a recurrence relationship for $x_{n+1}$ and $x_n$?
I actually know what the relationship is, however, don't know how to derive it.
Although it is obvious to see that $x_0 = x_1$
so for $n = 0$
We have $x_{1} = x_{0}+0 $
The recurrence relations are
$x_{n+1}=x_n−y_ntan(θ_{n+1})$
and
$y_{n+1}=y_n+x_ntan(θ_{n+1})$ But I can't get the derivation.

I tried taking some arbitrary right angle triangle and constructing two vectors.
$\mathop r_{\sim} = \langle x_n,y_n \rangle $
and a vector perpendicular to $\mathop r_\sim$, $\mathop d_{\sim} = \langle a,b\rangle$ such that
$\mathop r_{\sim} \cdot \mathop d_{\sim} = 0 $
Then we can let construct a unit vector for $\mathop d_\sim$ and eventually construct a line through a point?
If $P_i = (x_i,y_i)$, then $P_{n+1}$ is obtained by rotating $P_n$ about the origin by angle $\theta_{n+1}$, and scaling by a factor of $\frac{|OP_{n+1}|}{|OP_n|} = \sec\theta_{n+1}$. Using a rotation matrix, we can write
$$P_{n+1} \;=\; \sec\theta_{n+1}\;\left[\begin{array} \;\cos\theta_{n+1} & -\sin\theta_{n+1} \\ \sin\theta_{n+1} & \phantom{-}\cos\theta_{n+1} \end{array}\right]\;P_n \;=\; \left[\begin{array}{cc} \;1 & -\tan\theta_{n+1} \\ \tan\theta_{n+1} & 1 \end{array}\right]\;P_n$$
Therefore, $$\begin{align} x_{n+1} &= x_n - y_n\tan\theta_{n+1} \\ y_{n+1} &= x_n \tan\theta_{n+1} + y_n \end{align}$$