vector-triangle-inequality.tex 851 B

12345678910111213141516171819202122232425
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tikz}
  3. \usetikzlibrary{shapes, calc, shapes, arrows}
  4. \usepackage{amsmath,amssymb}
  5. \usepackage{xcolor}
  6. \definecolor{xvectorcolor}{HTML}{77933C}
  7. \begin{document}
  8. \begin{tikzpicture}[font=\boldmath]
  9. \large
  10. % Points
  11. \coordinate (A) at (0,0) {};
  12. \coordinate (B) at (5,0) {};
  13. \coordinate (C) at (2,2) {};
  14. % Draw the triangle
  15. \path[fill=blue!10, fill=blue!5] (A) -- (B) -- (C) -- (A);
  16. \draw[ultra thick, xvectorcolor, arrows={-latex}] (A) -- (C) node[sloped,midway,above=-0.1cm] {$x$};
  17. \draw[ultra thick, blue!80, arrows={-latex}] (C) -- (B) node[sloped,midway,above=-0.1cm] {$y$};
  18. \draw[ultra thick, red!80, arrows={-latex},line cap=round] (A) -- (B) node[sloped,midway,right=-0.3cm,above=-0.1cm] {$x+y$};
  19. \end{tikzpicture}
  20. \end{document}