right-triangle.tex 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{tikz}
  5. \usetikzlibrary{shapes, calc, decorations}
  6. \usepackage{amsmath,amssymb}
  7. \begin{document}
  8. \begin{preview}
  9. \begin{tikzpicture}
  10. \newcommand\XC{4}
  11. \newcommand\ALPHA{30}
  12. \newcommand\XB{{(\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5}}
  13. \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)}}
  14. % Draw the triangle
  15. \draw[fill=gray!10] (0, 0) coordinate (A)
  16. -- (\XB,\YB) coordinate (C)
  17. -- (\XC, 0) coordinate (B)
  18. -- (0, 0);
  19. % Draw nodes
  20. \node at (A)[anchor=north] {A};
  21. \node at (B)[anchor=north] {B};
  22. \node at (C)[anchor=south] {C};
  23. % Draw edge text
  24. \node (c) at ($(A)!0.50!(B)$) [below,font=\tiny] {Hy­po­te­nu­se};
  25. \node (b) at ($(A)!0.50!(C)$) [above,rotate=\ALPHA,font=\tiny]
  26. {Ankathete zu Winkel $\alpha$};
  27. \node (a) at ($(B)!0.35!(C)$) [above,rotate={\ALPHA-90},font=\tiny]
  28. {\parbox{2cm}{Gegenkathete\\ zu Winkel $\alpha$}};
  29. % draw alpha
  30. \draw[fill=green!30] (0,0) -- (0:0.75cm) arc (0:\ALPHA:.75cm);
  31. \coordinate[label=right:$\alpha$] (Alpha) at (0.25,0.15);
  32. % draw beta
  33. \begin{scope}[shift={(\XC, 0)}]
  34. \draw[fill=red!30] (0,0) -- (-180:0.50cm) arc (180:{180-(90-\ALPHA)}:0.5cm);
  35. \draw (150:0.35cm) node {$\beta$};
  36. \end{scope}
  37. % draw gamma
  38. \begin{scope}[shift={(\XB, \YB)}]
  39. \draw[fill=blue!30] (0,0) -- ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
  40. \draw (-0.1, -0.05) node[below] {$\gamma$};
  41. \end{scope}
  42. \end{tikzpicture}
  43. \end{preview}
  44. \end{document}