12

I've proudly produced the following figure, with your help. But there is a detail that is not fine: the theta2 label has to be moved. I know how to move labels on a line but not in this case. How does it work?

image

\documentclass{article}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usetkzobj{all}
\usepackage{subcaption}

\usetkzobj{all}
\usetikzlibrary{calc,patterns,angles,quotes}

\begin{document}

\begin{tikzpicture}[scale=1]
 \begin{scope}[thick,font=\scriptsize]
    \draw [->] (-.5,0) -- (5.5,0) node [above left]  {$\operatorname{Re} z$};
    \draw [->] (0,-.5) -- (0,4) node [below right] {$\operatorname{Im} z$};
  \end{scope}
  \coordinate (o) at (0,0);
  \coordinate (z1) at (4.511,1.642);
  \coordinate (z2) at (2.143,2.553);
  \coordinate (pr) at (1.368,3.759);
  \coordinate (x) at (1,0);
  \coordinate (y) at (0,1);
  \draw (o) -- node[above,shift={(.4cm,.1cm)}] {$r_1$} (z1) node [right] {$z_1$};
  \draw (o) -- node[above,yshift=.2cm] {$r_2$} (z2) node [right] {$z_2$};
  \draw (o) -- node[above,yshift=1cm] {$r_1{\cdot}r_2$} (pr) node [right] {$z_1\cdot z_2$};
  \draw pic[draw, "$\theta_1$", ->, angle eccentricity=1.2,angle radius = 1cm] {angle = x--o--z1}; 
  \draw pic[draw, "$\theta_2$", ->, angle eccentricity=1.2,angle radius = 1.5cm] {angle = x--o--z2}; 
  \draw pic[draw, "$\theta_1{+}\theta_2$", ->, angle eccentricity=1.2,angle radius = 2.5cm] {angle = x--o--pr}; 
\end{tikzpicture}

\end{document}
12

The text pic text has the option text pic options. Here, simply move the text up to the left to avoid overlapping on the side z_1of the angle.

pic text options={shift={(-3pt,3pt)}}

I took the liberty of colouring the different angles, which in my humble opinion makes the figure easier to read.

screenshot

\documentclass{article}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{subcaption}

\usetikzlibrary{calc,patterns,angles,quotes}

\begin{document}

\begin{tikzpicture}[scale=1]
 \begin{scope}[thick,font=\scriptsize]
    \draw [->] (-.5,0) -- (5.5,0) node [above left]  {$\operatorname{Re} z$};
    \draw [->] (0,-.5) -- (0,4) node [below right] {$\operatorname{Im} z$};
  \end{scope}
  \coordinate (o) at (0,0);
  \coordinate (z1) at (4.511,1.642);
  \coordinate (z2) at (2.143,2.553);
  \coordinate (pr) at (1.368,3.759);
  \coordinate (x) at (1,0);
  \coordinate (y) at (0,1);
  \draw (o) -- node[above,shift={(.4cm,.1cm)}] {$r_1$} (z1) node [right] {$z_1$};
  \draw (o) -- node[above,yshift=.2cm] {$r_2$} (z2) node [right] {$z_2$};
  \draw (o) -- node[above,yshift=1cm] {$r_1{\cdot}r_2$} (pr) node [right] {$z_1\cdot z_2$};
  \draw pic[draw,red, "$\theta_1$", ->, angle eccentricity=1.2,angle radius = 1cm] {angle = x--o--z1}; 
  \draw pic[draw,blue, "$\theta_2$", ->, angle eccentricity=1.2,angle radius = 1.5cm,pic text options={shift={(-3pt,3pt)}}] {angle = x--o--z2}; 
  \draw pic[draw,violet, "$\theta_1{+}\theta_2$", ->, angle eccentricity=1.2,angle radius = 2.5cm] {angle = x--o--pr}; 
\end{tikzpicture}

\end{document}
| improve this answer | |
  • You're right, it's working with your code. I must have had something strange on my end, where I found that \draw pic[pic text options=...] was working but not \pic[pic text options=...] I'll delete my comment! – PatrickT Jul 5 at 10:23
6

In this case I think that we can add options to the angle label by putting them after the quotted text like that : \draw pic[draw, "$\theta_2$"{option1,option2,...}, ->, angle eccentricity=1.2,angle radius = 1.5cm] {angle = x--o--z2};

the code

\documentclass{article}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usetkzobj{all}
\usepackage{subcaption}

\usetkzobj{all}
\usetikzlibrary{calc,patterns,angles,quotes}

\begin{document}

\begin{tikzpicture}[scale=1]
 \begin{scope}[thick,font=\scriptsize]
    \draw [->] (-.5,0) -- (5.5,0) node [above left]  {$\operatorname{Re} z$};
    \draw [->] (0,-.5) -- (0,4) node [below right] {$\operatorname{Im} z$};
  \end{scope}
  \coordinate (o) at (0,0);
  \coordinate (z1) at (4.511,1.642);
  \coordinate (z2) at (2.143,2.553);
  \coordinate (pr) at (1.368,3.759);
  \coordinate (x) at (1,0);
  \coordinate (y) at (0,1);
  \draw (o) -- node[above,shift={(.4cm,.1cm)}] {$r_1$} (z1) node [right] {$z_1$};
  \draw (o) -- node[above,yshift=.2cm] {$r_2$} (z2) node [right] {$z_2$};
  \draw (o) -- node[above,yshift=1cm] {$r_1{\cdot}r_2$} (pr) node [right] {$z_1\cdot z_2$};
  \draw pic[draw, "$\theta_1$", ->, angle eccentricity=1.2,angle radius = 1cm] {angle = x--o--z1}; 
  \draw pic[ draw,->,blue, "$\theta_2$"{shift=(80:0.35),inner sep=1pt, circle,draw},angle eccentricity=1.1,angle radius = 1.5cm] {angle = x--o--z2}; 
  \draw pic[draw, "$\theta_1{+}\theta_2$", ->, angle eccentricity=1.2,angle radius = 2.5cm] {angle = x--o--pr}; 
\end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |
  • 2
    +1 very nice solution – AndréC Aug 3 '19 at 9:52
  • @AndréC Thank you – Hafid Boukhoulda Aug 3 '19 at 11:00
  • Nice! Couldn't work out how to adapt "$\theta$"shift=(80:0.35) to my case, but discovered that something like "$\theta$"{xshift=6pt,yshift=-15pt} also works. – PatrickT Jul 5 at 9:32
3

Let us move labels by hand.

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[scale=2,thick]
\draw[->] (-.5,0)--(2.5,0) node[below]{\rm{Re}$z$};
\draw[->] (0,-.5)--(0,3) node[left]{\rm{Im}$z$};
\def\aone{20} \def\atwo{45}
\def\rone{2}  \def\rtwo{1.6}
\draw 
(0,0)--(\aone:\rone) 
node[pos=.8,below]{$r_1$} node[right]{$z_1$} 
(0,0)--(\atwo:\rtwo) 
node[pos=.65,left]{$r_2$} node[above]{$z_2$}
(0,0)--(\aone+\atwo:\rone*\rtwo) 
node[pos=.65,left]{$r_1\cdot r_2$} node[right]{$z_1\cdot z_2$};
\draw[->,red] (0:.5) arc(0:\aone:.5) 
node[pos=.55,right]{$\theta_1$};
\draw[->,blue] (0:.8) arc(0:\atwo:.8) 
node[pos=.75,right]{$\theta_2$};
\draw[->,magenta] (0:1.2) arc(0:\aone+\atwo:1.2)
node[pos=.55,right]{$\theta_1+\theta_2$};
\end{tikzpicture}
\end{document}
| improve this answer | |
1

Use the angle line as before without label and create a separate label for the angle z1--o--z2. You get

enter image description here

with the code

\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usetkzobj{all}
\usepackage{subcaption}

\usetkzobj{all}
\usetikzlibrary{calc,patterns,angles,quotes}

\begin{document}

\begin{tikzpicture}[scale=1]
 \begin{scope}[thick,font=\scriptsize]
    \draw [->] (-.5,0) -- (5.5,0) node [above left]  {$\operatorname{Re} z$};
    \draw [->] (0,-.5) -- (0,4) node [below right] {$\operatorname{Im} z$};
  \end{scope}
  \coordinate (o) at (0,0);
  \coordinate (z1) at (4.511,1.642);
  \coordinate (z2) at (2.143,2.553);
  \coordinate (pr) at (1.368,3.759);
  \coordinate (x) at (1,0);
  \coordinate (y) at (0,1);
  \draw (o) -- node[above,shift={(.4cm,.1cm)}] {$r_1$} (z1) node [right] {$z_1$};
  \draw (o) -- node[above,yshift=.2cm] {$r_2$} (z2) node [right] {$z_2$};
  \draw (o) -- node[above,yshift=1cm] {$r_1{\cdot}r_2$} (pr) node [right] {$z_1\cdot z_2$};
  \draw pic[draw, "$\theta_1$", ->, angle eccentricity=1.2,angle radius = 1cm] {angle = x--o--z1}; 
  \draw pic[draw,  ->, angle eccentricity=0.8,angle radius = 1.5cm] {angle = x--o--z2}; 
  \draw pic[draw, "$\theta_1{+}\theta_2$", ->, angle eccentricity=1.2,angle radius = 2.5cm] {angle = x--o--pr}; 
  \tkzLabelAngle[ pos = 1.2](z1,o,z2){$\theta_2$}
\end{tikzpicture}

\end{document}
| improve this answer | |

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