equilateral-triangle-heights.tex 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. % angle beta
  23. \begin{scope}[shift={(4cm,0cm)}]
  24. \draw[fill=green!30] (0,0) -- (-180:0.75cm) arc (180:120:0.75cm);
  25. \draw[color=gray, dashed] (0,0) -- node[sloped, above=-0.1cm] {$\scriptstyle h_b$} (150:3.464cm);
  26. \end{scope}
  27. % angle gamma
  28. \begin{scope}[shift={(60:4)}]
  29. \draw[fill=green!30] (0,0) -- (-120:.75cm) arc (-120:-60:.75cm);
  30. \draw[color=gray, dashed] (0,0) -- node[right=-0.1cm] {$\scriptstyle h_c$} (-90:3.464cm);
  31. \draw (-90:0.5cm) node {$\gamma$};
  32. \end{scope}
  33. % Sign for right angle of h_c
  34. \begin{scope}[shift={(2,0)}]
  35. \draw[fill=gray!30] (0,0) -- node[above=-0.15cm,near start] {$\cdot$} (0:0.18cm)
  36. arc (0:90:.18cm);
  37. \end{scope}
  38. % sign of right angle of h_a
  39. \begin{scope}[shift={(30:3.464cm)}]
  40. \draw[fill=gray!30] (0,0) -- node[near end,right=-0.28cm] {$\cdot$} (-60:0.18cm)
  41. arc (-60:-150:.18cm);
  42. \end{scope}
  43. % sign of right angle of h_b
  44. \begin{scope}[shift={(60:2cm)}]
  45. \draw[fill=gray!30] (0,0) -- node[right=-0.08cm, near start] {$\cdot$} (60:0.18cm)
  46. arc (60:-30:.18cm);
  47. \end{scope}
  48. % Height with label
  49. \draw[color=gray, dashed] (0,0) -- node[sloped, above=-0.1cm] {$\scriptstyle h_a$} (30:3.464cm);
  50. \draw (0.35cm,0.25cm) node {$\alpha$};
  51. \begin{scope}[shift={(4cm,0cm)}]
  52. \draw (150:0.5cm) node {$\beta$};
  53. \end{scope}
  54. \begin{scope}[shift={(60:4)}]
  55. \draw (-90:0.5cm) node {$\gamma$};
  56. \end{scope}
  57. % The triangle
  58. \draw [line width=1.5pt] (0,0) -- (60:4) -- (4,0) -- cycle;
  59. \end{tikzpicture}
  60. \end{document}