triangle-heron-tricky.tex 1.6 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}[dot/.style={ thick,
  10. %draw=gray,
  11. %cross out,
  12. fill,
  13. shape=circle,
  14. inner sep=3pt,
  15. minimum width=4pt,
  16. minimum height=4pt}]
  17. % Draw the triangle
  18. \draw[fill=green!10] (0, 0) coordinate (a)
  19. -- (5cm,0) coordinate (b)
  20. -- (3.6cm, 4.8cm) coordinate (c)
  21. -- (0, 0) -- cycle;
  22. \draw[fill=blue!10] (a)
  23. -- (b)
  24. -- (6.4cm, 4.8cm) coordinate (d)
  25. -- (0, 0) -- cycle;
  26. \draw[fill=red!10] (a)
  27. -- (b)
  28. -- (4.1cm,3.07cm) coordinate (e)
  29. -- (0, 0) -- cycle;
  30. %\node (a) [dot] at (0,0) {};
  31. %\node (b) [dot] at (5cm,0) {};
  32. %\node (c) [dot] at (3.6cm,4.8cm) {};
  33. \draw[thick] (a) -- (b) node [black,midway,yshift=-0.2cm,sloped] {5cm};
  34. \draw[thick] (b) -- (c) node [black,midway,yshift=+0.2cm,sloped] {5cm};
  35. \draw[thick] (a) -- (c) node [black,midway,yshift=+0.2cm,sloped] {6cm};
  36. \draw[thick] (a) -- (d) node [black,midway,yshift=+0.2cm,sloped] {8cm};
  37. \draw[thick] (b) -- (d) node [black,midway,yshift=-0.2cm,sloped] {5cm};
  38. % \draw[dashed,thick,lime] (a) circle(8cm);
  39. % \draw[dashed,thick,red] (a) circle(6cm);
  40. % \draw[dashed,thick,lime] (b) circle(5cm);
  41. % \draw[dashed,thick,red] (b) circle(6cm);
  42. % \draw[dashed,thick,lime] (c) circle(5cm);
  43. % \draw[dashed,thick,red] (c) circle(6cm);
  44. \end{tikzpicture}
  45. \end{preview}
  46. \end{document}