# Draw angle between two line

I try to represent a complex number in a Gauss plane. The problem is in the representation of the angle between the abscissas and the oz segment. This is my code:

\documentclass{scrbook}

\input{configuration}

\usepackage[utf8]{inputenc}

\usepackage{amsfonts, amsthm, amsmath, braket}
\usepackage{tikz}
\usetikzlibrary{angles, quotes,calc,patterns}

\begin{document}

\begin{tikzpicture}
\draw (0,0) node[anchor=north east] {$O$};
\draw[thick, ->] (-0.35,0) -- (5.5,0) node[anchor=north west] {$\mathbb{R}$};
\draw[thick, ->] (0,-0.35) -- (0,5.5) node[anchor=south east] {$\mathbb{C}$};

\draw [color=black, fill=black] (3.5,3) circle(0.05) node[anchor=south west] {$Z$};

\draw (0,0) -- (3.5,0) node[anchor=north west] {$x$};
\draw (0,0) -- (0,3.5) node[anchor=north east] {$y$};

\draw[dashed] (0,3) -- (3.5,3);
\draw[dashed] (3.5,0) -- (3.5,3);

\draw[thick] (0,0) -- (3.5,3);

\draw (2.5,2.16) -- (3,5) -- (4, 5) node[anchor=west] {$\rho = |z| = \sqrt{zz^*}$};
\draw (1,0) arc (-180:90:-1);
\end{tikzpicture}

\end{document}


with use of the angles and quotes library and made a little bit different looks of diagram:

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

\begin{document}
\begin{tikzpicture}[
every edge quotes/.append style = {anchor=south, sloped}
]
% axis
\draw[thick, ->] (-0.35,0) -- (5.5,0) coordinate[label=below: $\mathbb{R}$] (x);
\draw[thick, ->] (0,-0.35) -- (0,5.5)
node[left] {$\mathbb{I}$}
node[below right=5mm] {$Z=\rho\cdot \mathrm{e}^{j\theta}$};
\coordinate[label=below left:$O$] (O);
% phasor
\fill           (3.5,3) coordinate[label=above right:$Z$] (z) circle(0.05);
\draw[dashed]   (0,3) node[left] {$y$} -| (3.5,0) node[below] {$x$};
\draw[thick]    (O) to ["$\rho=|z|=\sqrt{zz^*}$"] (3.5,3);
% angle
\pic [draw, <->,
"$\theta$"] {angle = x--O--z};
\end{tikzpicture}
\end{document}

• instead of \mathbb{R} and \mathbb{I} i would rather use \Re and \Im. mathematical more correct, i think. Aug 4, 2018 at 18:17
• I agree with that comment but personally I would use \usepackage{amsmath} \DeclareMathOperator{\re}{Re} \DeclareMathOperator{\im}{Im} and then take the axes labels to be $\re z$ and $\im z$. +1 for using the angles library for that.
– user121799
Aug 4, 2018 at 18:39
• @marmot, thank you very much. in school we use symbols as you suggested, however for (to me unknown) reason are in latex defined symbols \Re and \Im and i just use them. ones i should ask some latex guru, where is origin this (somehow strange) notation :-). Aug 4, 2018 at 18:47
• At universities also virtually nobody uses the LaTeX \Re and \Im commands. I have not seen them in any paper in a long time.
– user121799
Aug 4, 2018 at 18:50
• actualy i sow them in some old german books. where is more appropriate to ask from they originate, here or on "metaTeX"? Aug 4, 2018 at 19:07

Maybe that?

\documentclass{scrbook}

%\input{configuration}

\usepackage[utf8]{inputenc}

\usepackage{amsfonts, amsthm, amsmath, braket}
\usepackage{tikz}
\usetikzlibrary{angles, quotes,calc,patterns}

\begin{document}

\begin{tikzpicture}
\draw (0,0) node[anchor=north east] {$O$};
\draw[thick, ->] (-0.35,0) -- (5.5,0) node[anchor=north west] {$\mathbb{R}$};
\draw[thick, ->] (0,-0.35) -- (0,5.5) node[anchor=south east] {$\mathbb{C}$};

\draw [color=black, fill=black] (3.5,3) circle(0.05) node[anchor=south west] {$Z$};

\draw (0,0) -- (3.5,0) node[anchor=north west] {$x$};
\draw (0,0) -- (0,3.5) node[anchor=north east] {$y$};

\draw[dashed] (0,3) -- (3.5,3);
\draw[dashed] (3.5,0) -- (3.5,3);

\draw[thick] (0,0) -- (3.5,3);

\draw (2.5,2.16) -- (3,5) -- (4, 5) node[anchor=west] {$\rho = |z| = \sqrt{zz^*}$};
\draw (1,0) arc (0:41:1);
\end{tikzpicture}

\end{document}


Output:

• Shouldn't it be a z instead of Z? I also would recommend you to change the arrow type and maybe to use \mathbbm{R} (or rather \mathbbm{C}) from the bbm package. Aug 4, 2018 at 17:41
• You could use arc (0:{atan(3/3.5}:1) to get the angle calculated for you. Nonetheless, good answer (+1)!
– Max
Aug 4, 2018 at 17:42
• @Max_Snippe: Yes, I know that but I thought I could explicit right down the angle because it's an very small code but yeah, you're absolutely right and thanks! Aug 4, 2018 at 17:43