equilateral-triangle-heights.tex 2.3 KB

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