Recurrence relation for right-angled triangles stuck-together 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?
 A: This is a generalization of the
"Spiral of Theodorus"
which is discussed in many places.
Here is the obvious one:
http://en.wikipedia.org/wiki/Spiral_of_Theodorus
Using the methods there
as a guide.
(I guess this should be a comment 
rather than an answer -
I was too impulsive.)
A: 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}$$
A: Here's an alternative formulation, and this also serves to illustrate that sometimes a different notation makes things appear simpler. First, define
$$\delta x_n=x_{n+1}-x_n$$
$$\delta y_n=y_{n+1}-y_n$$
Now. from the figure, we have 
$$\tan^2 {\theta_{n+1}}=\frac{(x_{n+1}-x_n)^2+(y_{n+1}-y_n)^2}{x_n^2+y_n^2}$$
$$\tan^2 {\theta_{n+1}}=\frac{\delta x_n^2+\delta y_n^2}{x_n^2+y_n^2}$$
Now using the fact that the square of the hypotenuse of a right triangle is the sum of squares of the bases, we get
$$(x_n^2+y_n^2)+(\delta x_n^2+\delta y_n^2) = (x_n+\delta x_n)^2 + (y_n+\delta y_n)^2$$
Which simplifies to 
$$x_n\delta x_n+y_n\delta y_n=0$$
From here, we get $\delta y_n$ in terms of $\delta x_n$, $x_n$ and $y_n$. Plugging this back into the first equation, you get exactly the recurrences you're looking for.
A: The problem is not well-posed. There are several solutions to the given problem depending on discretization choice. One more condition is needed to solve the finite "spiral". I am assuming that the real aim here is to find the spiral which is described by the tip of rotating vector.
An extreme choice of discretization is when the different $(x_i,y_i),(x_{i+1},y_{i+1}) $ are spaced  infinitesimally close to each respecting the given relations among the discrete increments.
We have the same scenario that marks difference between finite difference calculus and the infinitesimal calculus.
Eliminating $ \tan \theta_{n+1}$ between the two given relations which is quite a straight forward thing,
$$ \dfrac{y_{n+1} - y_n}{x_{n+1} - x_n}=-  \dfrac{x_n}{y_n} \tag{1}$$ 
$$ \dfrac{\Delta y} {\Delta x}=-  \dfrac{x}{y}\tag{2} $$ 
which passes to the limit by differential calculus:
$$ \dfrac{d y} {d x}=-  \dfrac{x}{y} \rightarrow  x \;{d x} + y\;{d y}=0 \tag{3} $$ 
which integrates to $$ x^2 + y^2 = R^2 \tag{4} $$ where R depends on starting $ x_i,y_i $ values, $ x_i^2 + y_i^2 = R^2 $; if $y_i=0$ ,then $ x_i = R.$
It is a Circle, the limiting case among a set of infinite solutions.
