Xoắn ốc Theodorus – Spiral of Theodorus

Description

Xoắn ốc Theodorus mô tả hình học các căn bậc hai của các số tự nhiên.

Spiral of Theodorus is a geometric description for successive natural numbers.

Mã TikZ

by Le Huy Tien

%\documentclass[tikz,border=3mm,convert={density=960,outfile=4\jobname.png}]{standalone}

\documentclass[tikz,border=3mm]{standalone}

\usepackage{tikz}

\usetikzlibrary{calc}

\definecolor{skyblue}{rgb}{0.53, 0.81, 0.92} % xanh da trời

\definecolor{oceanblue}{RGB}{46, 139, 87} % xanh biển

\begin{document}

\begin{tikzpicture}[line join=round]

\pagecolor{skyblue}

%\pagecolor{oceanblue}

 

\def\n{16}

\coordinate (O) at (0,0);

\coordinate (A1) at (-90:1);

 

\foreach \i in {1,…,\n}{

\pgfmathsetmacro{\j}{int(\i+1)}

\pgfmathsetmacro{\k}{20+5*\i}

\draw[fill=brown!\k!white]

(O)–(A\i)–([turn]90:1) coordinate (A\j)–cycle;

\path (A\i)–([turn]90:.5)–([turn]-90:.15) node[scale=.6]{$1$};

}

 

\foreach \i in {1,…,17}

\path (O)–($(O)!.8!(A\i)$)

–([turn]90:.2) node[scale=.6]{$\sqrt{\i}$};

\draw (current bounding box.north) node[above=5mm]

{SPIRAL OF THEODORUS};

\draw (current bounding box.south east)

node[align=center,opacity=.5,brown]

{\bf NAK\\\bf GEO\\\bf .COM};

\end{tikzpicture}

\end{document}