1

I am using the Tikz library angles to draw an arc between two edges. My goal is to create this:

Goal

However, I don't know how to set the anchors for the \pic command. I set it for the edges, but (logically), this doesn't give the desired result:

\begin{tikzpicture}
\node[draw,circle] (n3) at (0,0) {3};
\node[draw,circle] (n4) at (1,0.5) {4};
\node[draw,circle] (n5) at (1,-0.5) {5};
\draw[->] (n3) to (n4);
\draw[->] (n3) to (n5);

\pic[draw]{angle=n5--n3--n4};
\end{tikzpicture}

Current

How can i set the anchors in the \pic command? The following didn't work:

\pic[draw]{angle=n5--n3.east--n4};
0
3

enter image description here

\documentclass{standalone}
\usepackage{tikz}

\usetikzlibrary{calc,positioning,angles,arrows.meta,quotes,intersections}
\usetikzlibrary{through}

\begin{document}
    \begin{tikzpicture}
    \node[draw,circle] (n3) at (0,0) {3};
    \node[draw,circle] (n4) at (1,0.5) {4};
    \node[draw,circle] (n5) at (1,-0.5) {5};
    \draw[->] (n3.east) to (n4);
    \draw[->] (n3.east) to (n5);
%   \pic[draw]{angle=n5--n3--n4};
\draw[thick,red] ([shift=(-15:0.5cm)]0,0) arc (-15:15:0.5cm);
\end{tikzpicture}
\end{document}
1
  • Thank you for your answer, but i am trying to use the angles library. The reason for this is that i don't want to manually put in any coordinates. Also, it allows me to use other features of that library. Jan 20 '21 at 8:15
0

Perhaps the example under the link will help you (Draw angle between two line). So you can define a certain radius for the angle.

0

I have solved it. The solution is to create an additional coordinate east of the node, and draw things from there:

\begin{tikzpicture}
\node[draw,circle] (n3) at (0,0) {3};
\coordinate[right=0mm of n3]  (n3e);
\node[draw,circle] (n4) at (1,0.5) {4};
\node[draw,circle] (n5) at (1,-0.5) {5};
\draw[->] (n3e) to (n4);
\draw[->] (n3e) to (n5);

\pic[draw,angle radius=2mm]{angle=n5--n3e--n4};
\end{tikzpicture}

Resulting in:

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.