Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{minimal}
- \usepackage{tikz}
- \usetikzlibrary{calc}
- \begin{document}
- \begin{tikzpicture}[line width = 3pt]
- \newcommand{\la}[0]{2}
- \newcommand{\lb}[0]{4}
- \draw[help lines] (-\lb, -\la) grid (\la + \lb, \la + \lb);
- \coordinate (C) at (0, 0);
- \coordinate (A) at (\la, 0);
- \coordinate (B) at (0, \lb);
- \coordinate (D) at ($ (B) + (\lb, \la) $);
- \coordinate (E) at ($ (A) + (\lb, \la) $);
- \coordinate (G) at ($ (A)!(C)!(B) $);
- \coordinate (H) at ($ (D)!(C)!(E) $);
- \draw[fill = green] (C) rectangle (\la, -\la);
- \draw[fill = yellow] (C) rectangle (-\lb, \lb);
- \draw[fill = pink] (C) -- (A) -- (B) -- (C);
- \draw[fill = green] (E) -- (A) -- (G) -- (H) -- (E);
- \draw[fill = yellow] (H) -- (G) -- (B) -- (D) -- (H);
- \draw (C) -- (H);
- \tikzstyle{every node} = [circle, draw, fill, inner sep = 3pt, blue]
- \foreach \p/\l in {A/315, B/90, C/225, D/90, E/0, G/90, H/0} {
- \node[label = \l: $ \p $] at (\p) {};
- }
- \end{tikzpicture}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement