Question: How can one create a spiral of roots as shown in the diagram below:

![enter image description here](https://i.stack.imgur.com/HfRHi.png)

where one can use a command to draw more parts to the spiral. For example, a command like `\sqrtspiral{1}`, `\sqrtspiral{2}`, `\sqrtspiral{3}` would generate the image above. 

NOTE
----

I am inviting all solutions in TikZ, PSTricks, Asymptote and possibly MetaPost. So many ways to achieve the same diagram.

Answer: 
Starting from [here](http://www.texample.net/tikz/examples/rotated-triangle/)… pretty similar to @AEllet solution. (Adapted) Suggestion of Sigur, the optional argument pases everything to the `tikzpicture` environment and thanks to Sigur for the 90 degree angle mark ;)

By the way, this spiral is known as Spiral of Theodorus. Just in case you need some extra data.

```
\documentclass{scrartcl}

\usepackage{tikz,ifthen}
\usetikzlibrary{calc}

\newcommand*{\sqrtspiral}[2][scale=3]{
    \begin{tikzpicture}[#1]
        \def\sqrtlast{#2}
        \coordinate (A) at (0,0);
        \coordinate (B) at (1cm,0);
        \draw (A) edge node[auto, swap] {1} (B);
        \foreach \n in {1,...,\sqrtlast}{
            \ifthenelse{\equal{\n}{\sqrtlast}}
            {
                \def\currentcolor{red}
                \def\currentsqrt{x}
            }
            {
                \def\currentcolor{black}
                \pgfmathtruncatemacro{\currentsqrt}{\n+1}
            }
            \coordinate (C) at ($(B)!1cm!-90:(A)$);
            \draw[\currentcolor] (A) edge node[fill=white] {$\sqrt{\currentsqrt}$} (C);
            \draw[\currentcolor] (C) edge node[auto] {1} (B);
            \coordinate (w) at ($(B)!4pt!-90:(A)$);
            \coordinate (z) at ($(B)!4pt!0:(A)$);
            \coordinate (t) at ($(w)!4pt!-90:(B)$);
            \draw (w) -- (t) -- (z);
            \coordinate (B) at (C);
        }
    \end{tikzpicture}
}

\begin{document}

\sqrtspiral{1}
\sqrtspiral{2}
\sqrtspiral{3}

\sqrtspiral[scale=2]{12}

\end{document}

```

![enter image description here](https://i.stack.imgur.com/SZjPm.png)
I guess that this can help you. Since I want to post the image I am posting as an answer (even partial). 

See [23.2 pg. 144](http://mirrors.ctan.org/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide-screen.pdf) from the guide of [tkz-euclide](http://www.ctan.org/tex-archive/macros/latex/contrib/tkz/tkz-euclide).

![enter image description here](https://i.stack.imgur.com/fxODc.png)