vector-change-direction.tex 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tkz-euclide}
  3. \usepackage{tikz}
  4. \usetikzlibrary{shapes, calc, shapes, arrows}
  5. \usepackage{amsmath,amssymb}
  6. \usepackage{xcolor}
  7. \definecolor{xvectorcolor}{HTML}{77933C}
  8. \begin{document}
  9. \usetkzobj{all}
  10. \begin{tikzpicture}[font=\boldmath]
  11. \large
  12. % Points
  13. \coordinate (A) at (0,0) {};
  14. \coordinate (B) at (2,2) {};
  15. \coordinate (AB2) at (3,3) {};
  16. \coordinate (C) at (5,0) {};
  17. \node[below of=A,node distance=0.4cm] {$\scriptsize (0, 0)$};
  18. \node[left of=B,node distance=0.9cm] {$\scriptsize (x_1, y_1)$};
  19. \node[below of=C,node distance=0.4cm] {$\scriptsize (x_2, y_2)$};
  20. % Draw the angles
  21. % angle alpha
  22. \draw[fill=green!30] (A) -- (0:0.75cm) arc (0:45:.75cm);
  23. \draw (0.45cm,0.17cm) node {$\alpha$};
  24. % angle beta
  25. \tkzMarkAngle[arc=l,size=0.7cm,color=blue,fill=blue!20](A,B,C)
  26. %\draw[fill=green!30] (B) -- ($(B)!0.2!(C)$) arc (-35:-132:.75cm);
  27. \draw (2.0cm, 1.6cm) node {$\beta$};
  28. % angle gamma
  29. \tkzMarkAngle[arc=l,size=0.7cm,color=red,fill=red!20](C,B,AB2)
  30. \draw (2.4cm, 2.0cm) node {$\gamma$};
  31. % Draw the vectors
  32. \draw[ultra thick, xvectorcolor, arrows={-latex}] (A) -- (B);
  33. \draw[ultra thick, blue!80, arrows={-latex}] (B) -- (C);
  34. \end{tikzpicture}
  35. \end{document}