Advertisement
Guest User

勾股定理的欧几里得证明方法

a guest
Jul 11th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.05 KB | None | 0 0
  1. \documentclass{minimal}
  2.  
  3. \usepackage{tikz}
  4. \usetikzlibrary{calc}
  5.  
  6. \begin{document}
  7.  
  8. \begin{tikzpicture}[line width = 3pt]
  9.    \newcommand{\la}[0]{2}
  10.    \newcommand{\lb}[0]{4}
  11.  
  12.    \draw[help lines] (-\lb, -\la) grid (\la + \lb, \la + \lb);
  13.  
  14.    \coordinate (C) at (0, 0);
  15.    \coordinate (A) at (\la, 0);
  16.    \coordinate (B) at (0, \lb);
  17.    \coordinate (D) at ($ (B) + (\lb, \la) $);
  18.    \coordinate (E) at ($ (A) + (\lb, \la) $);
  19.    \coordinate (G) at ($ (A)!(C)!(B) $);
  20.    \coordinate (H) at ($ (D)!(C)!(E) $);
  21.  
  22.    \draw[fill = green] (C) rectangle (\la, -\la);
  23.    \draw[fill = yellow] (C) rectangle (-\lb, \lb);
  24.  
  25.    \draw[fill = pink] (C) -- (A) -- (B) -- (C);
  26.    \draw[fill = green] (E) -- (A) -- (G) -- (H) -- (E);
  27.    \draw[fill = yellow] (H) -- (G) -- (B) -- (D) -- (H);
  28.    \draw (C) -- (H);
  29.  
  30.    \tikzstyle{every node} = [circle, draw, fill, inner sep = 3pt, blue]
  31.  
  32.    \foreach \p/\l in {A/315, B/90, C/225, D/90, E/0, G/90, H/0} {
  33.        \node[label = \l: $ \p $] at (\p) {};
  34.    }
  35.  
  36. \end{tikzpicture}
  37.  
  38. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement