2

In the 'Defining New Arrow Tip Kinds' chapter in the PGF part of the TikZ & PGF manual for version 3.0.1a, the visual tip end of an arrow tip is defined as (p. 1016)

the counterpart of the visual back end for the front.

The visual back end, in turn, is defined as follows. (ibid.)

The visual back end is the position where the path and the the arrow head “meet last” on the path.

To illustrate these and other concepts, the following picture is given.

An arrow tip.

In terms of this illustration, the visual back end is said to be at (-2,0), and the visual tip end is said to be at (1,0).

I understand the definition of visual back end, but not that of visual tip end. Going by the definitions quoted above ('the visual tip end is the counterpart of the visual back end'), the visual tip end would be the position where the path and the arrow head "meet first" on the path, but this would be somewhere on the x-axis between -3 and -2, not at (1,0).

I'll appreciate it if someone can give a straightforward definition of visual tip end, without referring to the definition of visual back end, and explain, based on this definition, why the visual tip end in the above illustration is at (1,0).

9
  • 1
    I don't think the use of "counterpart" is very clear here, especially paired with this picture. What would happen if you used this arrow head as a tail? Or in the middle of a line? (no chance to test here, but it would be the last point to make contact)
    – Chris H
    Jul 19, 2017 at 17:02
  • 2
    The word "counterpart" means that when the arrow is reversed (for example -> becomes -<), the new visual back end is negative the old visual tip end.
    – Symbol 1
    Jul 19, 2017 at 17:52
  • @Symbol1: But you seem to assume that if -> becomes -< then the pointed part would just touch the line, but why do you make this assumption? Why isn't it possible that, when reversed, the pointed part intrudes into the line?
    – Evan Aad
    Jul 19, 2017 at 18:22
  • @ChrisH: But doesn't it depend on how much the line will coincide with the tail?
    – Evan Aad
    Jul 19, 2017 at 18:24
  • 1
    Possibly. Which is why I added the question about the middle.
    – Chris H
    Jul 19, 2017 at 18:53

1 Answer 1

5

The term visual back end does not necessarily refer to any geometric point on the arrowhead. It is merely a parameter provided to arrow designers.

The motivation to define visual back end in addition to back end is clear only if we consider curved path

In this case, the arrow looks ugly because it does not lie on the path. We expect TikZ to slightly rotate the arrow. For example:

This looks a lot better as the visual back end lies on the solid red line. The bending library will do this job for you with the option flex.

One may also try

This looks good too as the back end(green dot) lies on the solid red line. The bending library will do this job for you with the option flex'.


The motivation to define visual tip end is the same: when one writes -{Stealth[reversed]}, the library needs the coordinate of the visual back end for this reversed arrow. In this case, the visual tip end of Stealth will be used.

So far I told only half of the story. knowing that the arrow's visual tip end/ back end lies on the original path does not determine the placement of the arrowhead. The following is what TikZ does when flex=1 is used:

  • shift the arrowhead so that visual tip end coincides the endpoint of the path;
  • rotate the arrowhead so that the visual back end lies on the path.

Therefore, similar to what I said at the beginning of the answer, visual tip end does not necessarily represent any geometric point. It is the arrowhead-designer's choice to assign a point as the visual tip end, which will later be used by TikZ to position the arrowhead.


Appendix

Figures above are generated by acquiring the source code of the manual. In particular pgfmanual-en-base-arrows.tex line 108-117. As one can easily see, the code draws the path and arrowhead separately.

\documentclass[border=9,tikz]{standalone}
\usetikzlibrary{arrows.meta,bending,calc}
\begin{document}

\begin{tikzpicture}
  \draw [red!50, ,line width=1cm] (0,0) -- (4,0);
  \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm]}] (0,0) -- (6,0);

  \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
  \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};

  \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
  \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
\end{tikzpicture}

\begin{tikzpicture}
  \draw [red!50, ,line width=1cm] (0,-4) to[bend left] (4,0);
  \draw [red] (0,-4) to[bend left] (4,0);
  \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm]}] (0,0) -- (6,0);

  \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
  \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};

  \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
  \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
\end{tikzpicture}

\begin{tikzpicture}
  \draw [red!50, ,line width=1cm] (0,-4) to[bend left] (4,0);
  \draw [red] (0,-4) to[bend left] (4,0);
  \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm]}] (0,-.6) -- (6,0);

  \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
  \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};

  \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
  \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
\end{tikzpicture}

\begin{tikzpicture}
  \draw [red!50, ,line width=1cm] (0,-4) to[bend left] (4,0);
  \draw [red] (0,-4) to[bend left] (4,0);
  \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm]}] (0,-1.3) -- (6,0);
  \fill[green]($(6,0)!4cm!(0,-1.3)$)circle(.1);

  \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
  \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};

  \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
  \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
\end{tikzpicture}


\begin{tikzpicture}
  \draw [red!50, ,line width=1cm] (0,0) -- (4,0);
  \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm,reversed]}] (0,0) -- (6,0);

  \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
  \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};

  \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
  \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
\end{tikzpicture}

\begin{tikzpicture}[opacity=.25,scale=5]
  \draw [red,line width=1cm,-{Stealth[black,line width=0pt,length=4cm, width=4cm,inset=1cm,flex=0]},preaction={draw,-}]
  (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\begin{tikzpicture}[opacity=.25,scale=5]
  \draw [red,line width=1cm,-{Stealth[black,line width=0pt,length=4cm, width=4cm,inset=1cm,flex=1]},preaction={draw,-}]
  (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\begin{tikzpicture}[opacity=.25,scale=5]
  \draw [red,line width=1cm,-{Stealth[black,line width=0pt,length=4cm, width=4cm,inset=1cm,flex'=1]},preaction={draw,-}]
  (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}

\end{document}
8
  • PS. It should not be the case that (1,0) is the center of the rotation. Please do not assume this. The center of rotation is yet another question. The point made here is the reference point for performing the rotation.
    – Symbol 1
    Jul 19, 2017 at 20:46
  • Could you please, for further investigation, also post the source Tikz codes producing those very good drawings, or at least explain where to find the source you amended ?
    – marsupilam
    Jul 19, 2017 at 21:13
  • Thanks for this beautiful answer. I hate to say it, but, as I wrote in my question, I understand what visual back end means; it is the meaning of visual tip end that I was after. Your answer leaves this point to an afterthought in the last paragraph, and is therefore not answering my question.
    – Evan Aad
    Jul 19, 2017 at 21:47
  • @marsupilam see the appendix :)
    – Symbol 1
    Jul 20, 2017 at 2:02
  • @EvanAad Long story short: visual tip end is the endpoint of the original path. See also my update.
    – Symbol 1
    Jul 20, 2017 at 2:03

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.