[Tex/LaTex] angles in a vector diagram

tikz-pgf

I have a code to draw a simple vector diagram with tikZ

\documentclass[tikz, border=3mm]{standalone}
\usepackage{amsmath, amssymb}
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}
  \coordinate (v1) at (0,0);
  \coordinate (v2) at (1,1);
  \coordinate (v3) at (0,2.5);

  \draw[->] (v1) -- node[right] {$\vec{a}$} (v2);
  \draw[->] (v2) -- node[right] {$\vec{b}$} (v3);
  \draw[->] (v1) -- node[left] {$\vec{c}$} (v3);

\end{tikzpicture}
\end{document}

In addition I would like to draw the angle between vectors a and b.
This requires
1) extending the line of vector a a bit
2) drawing the arc corresponding to the angle
3) placing the angle label

The final output should be the following:

enter image description here

What additions to the code are required?

Best Answer

You can use the calc library to calculate a new coordinate at the extension of the v1--v2 line, and then use the angles library as described in one of the questions mentioned by samcarter.

\documentclass[tikz, border=3mm]{standalone}
\usepackage{amsmath, amssymb}
\usetikzlibrary{calc,angles,quotes}

\begin{document}
\begin{tikzpicture}
  \coordinate (v1) at (0,0);
  \coordinate (v2) at (1,1);
  \coordinate (v3) at (0,2.5);
  % add coordinate at the extension of the line from v1 to v2
  \coordinate (v2-2) at ($(v1)!1.2!(v2)$); 

  \draw[->] (v1) -- node[right] {$\vec{a}$} (v2);
  \draw[->] (v2) -- node[right] {$\vec{b}$} (v3);
  \draw[->] (v1) -- node[left] {$\vec{c}$} (v3);

  % draw line and angle
  \draw [very thin] (v2) -- (v2-2)
     pic [draw,angle radius=2mm,angle eccentricity=1.7, "$\theta$" font=\scriptsize] {angle=v2-2--v2--v3};

\end{tikzpicture}
\end{document}

enter image description here