equilateral-triangle.tex 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{tikz}
  5. \usetikzlibrary{positioning, calc}
  6. \begin{document}
  7. \begin{preview}
  8. \begin{tikzpicture}[scale=0.8]
  9. % draw the background
  10. \draw [line width=1.5pt, fill=gray!2] (0,0) -- (60:4) -- (4,0) -- cycle;
  11. \coordinate[label=left:$A$] (A) at (0,0);
  12. \coordinate[label=right:$B$] (B) at (4,0);
  13. \coordinate[label=above:$C$] (C) at (2,3.464);
  14. \coordinate[label=below:$c$](c) at ($ (A)!.5!(B) $);
  15. \coordinate[label=left:$b$] (b) at ($ (A)!.5!(C) $);
  16. \coordinate[label=right:$a$](a) at ($ (B)!.5!(C) $);
  17. % angle alpha
  18. \draw[fill=green!30] (0,0) -- (0:0.75cm) arc (0:60:.75cm);
  19. \draw (0.35cm,0.25cm) node {$\alpha$};
  20. % angle beta
  21. \begin{scope}[shift={(4cm,0cm)}]
  22. \draw[fill=green!30] (0,0) -- (-180:0.75cm) arc (180:120:0.75cm);
  23. \draw (150:0.5cm) node {$\beta$};
  24. \end{scope}
  25. % angle gamma
  26. \begin{scope}[shift={(60:4)}]
  27. \draw[fill=green!30] (0,0) -- (-120:.75cm) arc (-120:-60:.75cm);
  28. \draw (-90:0.5cm) node {$\gamma$};
  29. \end{scope}
  30. % the triangle
  31. \draw [line width=1.5pt] (A) -- (B) -- (C) -- cycle;
  32. \end{tikzpicture}
  33. \end{preview}
  34. \end{document}