diff --git a/tikz/build/tikz-squares.pdf b/tikz/build/tikz-squares.pdf new file mode 100644 index 0000000..bd6e8b9 Binary files /dev/null and b/tikz/build/tikz-squares.pdf differ diff --git a/tikz/tikz-squares.tex b/tikz/tikz-squares.tex new file mode 100644 index 0000000..4c49cf4 --- /dev/null +++ b/tikz/tikz-squares.tex @@ -0,0 +1,57 @@ +\documentclass[a4]{article} +\usepackage{tikz} + +\begin{document} + +Draw a box and label the corners and the center: + +\begin{tikzpicture} + \draw (0,0) -- (0,1) -- (1,1) -- (1,0) -- (0,0); + \node [below left] at (0,0) {$a$}; + \node [above left] at (0,1) {$b$}; + \node [above right] at (1,1) {$c$}; + \node [below right] at (1,0) {$d$}; + \draw [fill] (0.5,0.5) circle [radius=0.5pt]; + \node [above right] at (0.45,0.45) {\small {$e$}}; +\end{tikzpicture} + +\bigskip \hrule \bigskip + +Draw some lines: + +\bigskip + +\begin{tikzpicture} + \draw [|-] (0,0) -- (2,0); + \draw [|-<] (0,0.5) -- (2,0.5); + \draw [|->] (0,1) -- (2,1); +\end{tikzpicture} + +\bigskip \hrule \bigskip + +\paragraph{An experiment with polar coordinates} + +This does not work: + +\vspace{1.5cm} + +\begin{tikzpicture} + \tikz \draw [->] (0,0) -- (0:1); + \tikz \draw [->] (0,0) -- (72:1); + \tikz \draw [->] (0,0) -- (144:1); + \tikz \draw [->] (0,0) -- (216:1); + \tikz \draw [->] (0,0) -- (288:1); +\end{tikzpicture} + +\bigskip + +But this does: + +\bigskip + +\begin{tikzpicture} + \foreach \a in {0, 72,...,288} + \draw [->] (0,0) -- (\a:1); +\end{tikzpicture} + +\end{document} \ No newline at end of file