triangle-angles.tex 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{tikz}
  5. \usepackage{tkz-euclide}
  6. \usetikzlibrary{shapes, calc, shapes, decorations}
  7. \usepackage{amsmath,amssymb}
  8. \begin{document}
  9. \begin{preview}
  10. \begin{tikzpicture}[thick]
  11. \newcommand\XC{4}
  12. \newcommand\ALPHA{30}
  13. \newcommand\XB{{(\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5}}
  14. \newcommand\YB{{sqrt(cos(\ALPHA)*\XC*cos(\ALPHA)*\XC - (\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5*(\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5)}}
  15. \newcommand\XBo{{(\XB)+4}}
  16. \newcommand\YBo{{\YB}}
  17. \newcommand\XBp{{\XB*0.5}}
  18. \newcommand\YBp{{\YB*0.5}}
  19. % Draw the triangle
  20. \draw[fill=gray!10] (0, 0) coordinate (A)
  21. -- (\XB,\YB) coordinate (C)
  22. -- (\XC, 0) coordinate (B)
  23. -- (0, 0) -- cycle;
  24. % Draw nodes
  25. \node at (A)[anchor=north] {A};
  26. \node at (B)[anchor=north] {B};
  27. \node at (C)[anchor=south] {C};
  28. % Draw edge text
  29. \node (c) at ($(A)!0.5!(B)$) [below] {c};
  30. \node (b) at ($(A)!0.5!(C)$) [above] {b};
  31. \node (a) at ($(B)!0.6!(C)$) [right] {a};
  32. % draw alpha
  33. \draw[fill=blue!30] (0,0) -- (0:0.75cm) arc (0:\ALPHA:.75cm);
  34. \coordinate[label=right:$\alpha$] (Alpha) at (0.25,0.15);
  35. % draw beta
  36. \begin{scope}[shift={(\XC, 0)}]
  37. \draw[fill=green!30] (0,0) -- (-180:0.50cm) arc (180:{180-(90-\ALPHA)}:0.5cm);
  38. \draw (150:0.35cm) node {$\beta$};
  39. \end{scope}
  40. % draw gamma
  41. \begin{scope}[shift={(\XB, \YB)}]
  42. \draw[fill=red!30] (0,0) -- ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
  43. \draw (-0.1, -0.05) node[below] {$\gamma$};
  44. \end{scope}
  45. % shifted alpha
  46. \begin{scope}[shift={(4,0)}]
  47. \path[fill=blue!30] (0,0) -- (0:0.5cm) arc (0:\ALPHA:.5cm);
  48. \draw (0:0.5cm) arc (0:\ALPHA:.5cm);
  49. \end{scope}
  50. % shifted gamma
  51. \begin{scope}[shift={(4, 0)},rotate=180]
  52. \path[fill=red!30] (0,0) -- ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
  53. \draw ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
  54. \end{scope}
  55. \begin{scope}[shift={(3.13,-0.5)},scale=0.7]
  56. \draw[dashed, red] (0, 0) -- (\XB,\YB);
  57. \end{scope}
  58. \draw[dashed, color=red] (-0.6, 0) -- (5.3, 0);
  59. \draw (0, 0) coordinate (X)
  60. -- (\XB,\YB) coordinate (Y)
  61. -- (\XC, 0) coordinate (Z)
  62. -- (0, 0);
  63. \tkzDrawLine[thick,dashed](A,C)
  64. \end{tikzpicture}
  65. \end{preview}
  66. \end{document}