triangle-angles.tex 2.8 KB

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