2

I'm trying to draw the unit circle with two vectors of the same size and an angle between them. So far I've been able to draw the circle and the vectors, however I don't know how to add the angle and the label to the coordinates.

I have this code:

\begin{tikzpicture}[scale=5]
    % draw the coordinates
    \draw[->] (-0.2cm,0cm) -- (1.2cm,0cm) node[right,fill=white] {$x$};
    \draw[->] (0cm,-0.2cm) -- (0cm,0.88cm) node[above,fill=white] {$y$};

    % draw arc
    \draw [black,loosely dashed,domain=13:47] plot ({cos(\x)}, {sin(\x)});

    % draw vectors
    \draw[black,-latex] (0cm,0cm) -- (20:1cm);
    \draw[black,-latex] (0cm,0cm) -- (40:1cm);
\end{tikzpicture}

That generates this image: enter image description here

How can I add a label to the coordinate at the end of each vector? And how can I add an angle inside the vectors, with an arrow pointing up, similar to this image below.

enter image description here

Thank you so much!

4

Sorry, I was busy when writing the first version of the answer very quickly, and thus got i and r confused. Angles can be drawn with the angles library, and quotes are needed to annotate them. The coordinate nodes can be achieved in the same way you label the axes x and y.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}[scale=5]
    % draw the coordinates
    \draw[->] (-0.2cm,0cm) -- (1.2cm,0cm) node[right,fill=white] {$x$};
    \draw[->] (0cm,-0.2cm) -- (0cm,0.88cm) node[above,fill=white] {$y$};

    % draw arc
    \draw [black,loosely dashed,domain=13:47] plot ({cos(\x)}, {sin(\x)});

    % draw vectors
    \draw[black,-latex] (0cm,0cm) coordinate(O) -- (20:1cm) coordinate (r) node[pos=1.02,anchor=west]{$(x_r,y_r)$};
    \draw[black,-latex] (0cm,0cm) -- (40:1cm) coordinate (i) node[pos=1.02,anchor=west]{$(x_i,y_i)$};
    \draw pic ["$\theta$",angle eccentricity=1.33,draw,-latex,angle radius=1cm,fill=blue!50] 
 {angle = r--O--i};
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.