equilateral-triangle-heights.tex 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tikz}
  3. \usetikzlibrary{arrows,positioning, calc}
  4. \tikzset{
  5. %Define standard arrow tip
  6. >=stealth',
  7. % Define arrow style
  8. pil/.style={->,thick}
  9. }
  10. \begin{document}
  11. \begin{tikzpicture}
  12. % draw the background
  13. \draw [line width=1.5pt, fill=gray!2] (0,0) -- (60:4) -- (4,0) -- cycle;
  14. \coordinate[label=left:$A$] (A) at (0,0);
  15. \coordinate[label=right:$B$] (B) at (4,0);
  16. \coordinate[label=above:$C$] (C) at (2,3.464);
  17. \coordinate[label=below:$c$](c) at ($ (A)!.5!(B) $);
  18. \coordinate[label=left:$b$](b) at ($ (A)!.5!(C) $);
  19. \coordinate[label=right:$a$](a) at ($ (B)!.5!(C) $);
  20. % angle alpha
  21. \draw[fill=green!30] (0,0) -- (0:0.75cm) arc (0:60:.75cm);
  22. \draw (0.35cm,0.25cm) node {$\alpha$};
  23. % angle beta
  24. \begin{scope}[shift={(4cm,0cm)}]
  25. \draw[fill=green!30] (0,0) -- (-180:0.75cm) arc (180:120:0.75cm);
  26. \draw[color=gray, dashed] (0,0) -- node[sloped, above=-0.1cm] {$\scriptstyle h_b$} (150:3.464cm);
  27. \draw (150:0.5cm) node {$\beta$};
  28. \end{scope}
  29. % angle gamma
  30. \begin{scope}[shift={(60:4)}]
  31. \draw[fill=green!30] (0,0) -- (-120:.75cm) arc (-120:-60:.75cm);
  32. \draw[color=gray, dashed] (0,0) -- node[right=-0.1cm] {$\scriptstyle h_c$} (-90:3.464cm);
  33. \draw (-90:0.5cm) node {$\gamma$};
  34. \end{scope}
  35. % Sign for right angle of h_c
  36. \begin{scope}[shift={(2,0)}]
  37. \draw[fill=gray!30] (0,0) -- node[above=-0.15cm,near start] {$\cdot$} (0:0.18cm)
  38. arc (0:90:.18cm);
  39. \end{scope}
  40. % sign of right angle of h_a
  41. \begin{scope}[shift={(30:3.464cm)}]
  42. \draw[fill=gray!30] (0,0) -- node[near end,right=-0.28cm] {$\cdot$} (-60:0.18cm)
  43. arc (-60:-150:.18cm);
  44. \end{scope}
  45. % sign of right angle of h_b
  46. \begin{scope}[shift={(60:2cm)}]
  47. \draw[fill=gray!30] (0,0) -- node[right=-0.08cm, near start] {$\cdot$} (60:0.18cm)
  48. arc (60:-30:.18cm);
  49. \end{scope}
  50. % Height with label
  51. \draw[color=gray, dashed] (0,0) -- node[sloped, above=-0.1cm] {$\scriptstyle h_a$} (30:3.464cm);
  52. % The triangle
  53. \draw [line width=1.5pt] (0,0) -- (60:4) -- (4,0) -- cycle;
  54. \end{tikzpicture}
  55. \end{document}