5

Using tikz, How can I get the arrowhead in this example to be angled 'better'?

\draw [arrows=-{>[scale=2, length=3, width=3.5]},line width=0.7mm] (0,0) arc (90:-20:0.4);

enter image description here

  • 1
    welcome to tex.se! try with tikz library arrows.meta and bending. see tikz & pgf manual, page 194 -- 197. for an example please extend your code snippet to complete small document, which we can copy and test in our computers. – Zarko Sep 2 '18 at 17:26
  • 1
    @StefanKottwitz This question is not duplicated because none of the proposed solutions work here: the flex and shorten options do not solve the problem posed here. Moreover the shorten option is not documented in the 3.01a manual, it is only documented in the 1.18 manual which is no longer current. – AndréC Sep 3 '18 at 11:35
  • 1
    @AndréC and Milo I closed it because there was a closing flag and it seemed to be meaningful. Note, It doesn't matter if the other answer does help here or not, but if the question is the same. And, closing doesn't remove your answer, it just prevents further answers here (that could be on the other question). Your answer could have been posted to the other question (the "duplicate") so closing this one with the link to the other one helps keeping solutions at the same place, pointing same questions to there. Now, answers are there and here, to the same topic of adding an arrow to an arc. – Stefan Kottwitz Sep 3 '18 at 14:14
  • @Milo and AndréC Closing is focusing, not meaning questions or answer would not be good. Especially dupe questions provide different wording to the same topic plus a pointer link plus the idea to add more to a canonical place. But fine with me, I re-opened. That's for allowing further answers here. Let's see if more will come. (btw. un-closing removes the prominently visible duplicate link to the related (same?) question about adding an arrow to the an arc) – Stefan Kottwitz Sep 3 '18 at 14:15
7

By default the arrows follow a straight line path. Here it is tangent to the -110° angle segment. See explanation below.

When loading the bending library the flex option is enabled by default. I did several tests with flex, flex' and bend options. Only the last two give a suitable visual effect. The bend option deforms the arrowhead while the flex option does not deform it, it remains rigid.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{bending}
\begin{document}

tangent  \tikz\draw [densely dotted](0,0)--(-110:1)([shift={(.58,0)}]0,0)--([shift={(.58,0)}]-110:1)[arrows=-{>[scale=2, length=3, width=3.5]},thin] (0,0) arc (90:-20:0.4);
\bigskip

flex=0 \tikz\draw [arrows=-{>[scale=2, length=3, width=3.5,flex=0]},line width=0.7mm] (0,0) arc (90:-20:0.4);
\bigskip

flex=1 \tikz\draw [arrows=-{>[scale=2, length=3, width=3.5,flex=1]},line width=0.7mm] (0,0) arc (90:-20:0.4);
\bigskip

flex'=1 \tikz\draw [arrows=-{>[scale=2, length=3, width=3.5,flex'=1]},line width=0.7mm] (0,0) arc (90:-20:0.4);
\bigskip

flex'=.75 \tikz\draw [arrows=-{>[scale=2, length=3, width=3.5,flex'=.75]},line width=0.7mm] (0,0) arc (90:-20:0.4);
\bigskip

bend \tikz\draw [arrows=-{>[scale=2, length=3, width=3.5,bend]},line width=0.7mm] (0,0) arc (90:-20:0.4);

\end{document}

Output:

arrowhead

As arrow ends at -20°, the tangent to this arrow is also normal at the angle radius -20°. This normal has an angle of -110° with the abscissa axis.

tangente-normale

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending,patterns,angles,calc}
\usepackage{siunitx}
\begin{document}

\begin{tikzpicture}
\coordinate (A) at (-20:3);
\coordinate (B) at (0:3);
\coordinate(O) at (0,0);
\coordinate (x) at ($(A)!2.5cm!90:(O)$);
\coordinate (y) at ($(A)!3cm!-90:(O)$);
\draw[densely dotted] (0,0) circle (3cm);
\draw[blue] (0,0) --(0:4cm)coordinate(x');
\draw[blue] (0,0) --(-20:4cm);
\draw[very thick,blue] (x)node[below,text=black]{tangent to the arrow}--(y)node[above,text=black]{\parbox{2cm}{normal at the angle radius $\ang{-20}$}};
\pic  [pic text=$\ang{20}$,blue,fill=cyan!30,draw, angle eccentricity=1.5,angle radius=1cm]{angle=A--O--B};
\coordinate (I) at (intersection of x--y and O--B);
\pic  [pic text=$\ang{70}$,draw,blue, angle eccentricity=1.7,angle radius=5mm]{angle=x'--I--y};
\pic  [pic text=$\ang{110}$,draw,blue, angle eccentricity=2,double,angle radius=3mm]{angle=x--I--x'};
\draw[fill=cyan!30] (A)--($(A)!3mm!(O)$)--($(A)!3mm!(O)!3mm!90:(O)$)--($(A)!3mm!(x)$)--cycle;
\draw [red,arrows=-{>[scale=2, length=3, width=3.5,flex=0]},line width=.6mm](0,3)arc (90:-20:3);
\end{tikzpicture}
\end{document}

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.