vector-addition-and-scaling.tex 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  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]\large
  9. % Punkte
  10. \coordinate (A) at (0,0) {};
  11. \coordinate (B) at (2,0) {};
  12. \coordinate (C) at (1,1) {};
  13. \coordinate (D) at (3,1) {};
  14. % Draw the triangle
  15. \draw[thick, blue!25] (B) -- (D) node[sloped,midway,above] {};
  16. \draw[thick, red!25] (C) -- (D) node[sloped,midway,above] {};
  17. \draw[->, ultra thick, red, arrows={-latex}] (A) -- (B) node[sloped,right=-0.3cm, above] {$\mathsf{w}$};
  18. \draw[->, ultra thick, blue, arrows={-latex}] (A) -- (C) node[sloped,midway,above=-0.1cm] {$\mathsf{v}$};
  19. \draw[->, ultra thick, black, arrows={-latex}] (A) -- (D) node[sloped,midway,above=-0.1cm] {$\mathsf{v+w}$};
  20. \begin{scope}[shift={(0,1.5)}]
  21. \draw[thick, blue!25] (4,0) -- (5,1) node[sloped,midway,above] {};
  22. \draw[thick, red!25] (1,1) -- (5,1) node[sloped,midway,above] {};
  23. \draw[->, ultra thick, red!25, arrows={-latex}] (0,0) -- (2,0);
  24. \draw[->, ultra thick, red, arrows={-latex}] (0,0) -- (4,0) node[sloped,right=-0.7cm,above] {$\mathsf{2 \cdot w}$};
  25. \draw[->, ultra thick, blue, arrows={-latex}] (0,0) -- (1,1) node[sloped,midway,above=-0.1cm] {$\mathsf{v}$};
  26. \draw[->, ultra thick, black, arrows={-latex}] (0,0) -- (5,1) node[sloped,midway,above=-0.1cm] {$\mathsf{v+2 \cdot w}$};
  27. \end{scope}
  28. \end{tikzpicture}
  29. \end{document}