Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to create a curved single arrow inside some circles indicating rotation. Currently I'm doing it using the \draw arc but the result is very ugly, the arrow tip is very weird when I make the arrow thick. Since each of the arrows must have different thickness, I can't just make them thin.

This is what I have right now: enter image description here

I'd like the arrows to look like the arrow at the bottom but with varying thickness, which is created with the single arrow from the tikzlibrary shapes.arrows.

This is my current code:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes.arrows}

\begin{document}

\begin{tikzpicture} %[>=latex]

% cross
\draw[gray,line width=3pt,opacity=0.5,line cap=round] (-2,0) -- (2,0);
\draw[gray,line width=3pt,opacity=0.5,line cap=round] (0,-2) -- (0,2);

%rotors
\draw[inner sep=3pt,outer sep=0,fill=blue,fill opacity=0.3,draw=blue] (-2,0) circle     [radius=1cm];
\draw[inner sep=3pt,outer sep=0,fill=blue,fill opacity=0.3,draw=blue] (2,0) circle     [radius=1cm];
\draw[inner sep=3pt,outer sep=0,fill=red,fill opacity=0.3,draw=red] (0,-2) circle [radius=1cm];
\draw[inner sep=3pt,outer sep=0,fill=red,fill opacity=0.3,draw=red] (0,2) circle [radius=1cm];

% rotation direction arrows
\draw [->,line width=5pt] (-2.4,0.3) arc[x radius=0.5cm, y radius =.5cm, start angle=-220, end angle=40];
\draw [->,line width=1pt] (1.6,0.3) arc[x radius=0.5cm, y radius =.5cm, start angle=-220, end angle=40];
\draw [<-,line width=2.5pt] (-0.4,-1.7) arc[x radius=0.5cm, y radius =.5cm, start angle=-220, end angle=40];
\draw [<-,line width=2.5pt] (-0.4,2.3) arc[x radius=0.5cm, y radius =.5cm, start angle=-220, end angle=40];

% rotors asterisk to indicate front and side
\draw plot[mark=asterisk,mark size=5pt,mark options={color=red}] coordinates {(-2,0)};
\draw plot[mark=asterisk,mark size=5pt,mark options={color=green}] coordinates {(2,0)};
\draw plot[mark=asterisk,mark size=5pt,mark options={color=cyan}] coordinates {(0,-2)};
\draw plot[mark=asterisk,mark size=5pt,mark options={color=red}] coordinates {(0,2)};

% translation direction
\node[fill=black,single arrow,minimum height=3cm] (arrow)  at (0,-3.5){};

\end{tikzpicture}
\end{document}
share|improve this question
    
Possible duplicate: Repositioning and resizing arrow tip on circular (arc) path. –  Paul Gaborit Jan 30 '13 at 7:52
    
@PaulGaborit this questions originally asks for a curved single arrow, not for tip positioning. It came out, however, that curved single arrows seem not possible. –  perr0 Jan 30 '13 at 15:00
    
curved single arrow shape does not exist... but it may be possible to create one. –  Paul Gaborit Jan 30 '13 at 15:28
    
@PaulGaborit I thought it was possible after seeing this question: tex.stackexchange.com/questions/75432/…. It is about text, but there is definitely a curved arrow in there. Although I don't understand how that was made, I thought it would be possible to do the same here. –  perr0 Jan 30 '13 at 17:45
    
In the linked question, the arrow head is made via -latex and line width=5ex. This arrow head is not curved. –  Paul Gaborit Jan 30 '13 at 19:43
show 1 more comment

1 Answer

up vote 9 down vote accepted

This is due to the large curvature with thick linewidth. TikZ makes some inner calculations before putting the arrow heads such as measuring the finishing angle and going a little backwards to make sure the arrow head joins the lineend nicely etc. I think in this example you can get away with small corrections. I've added tiny extensions in the angle that I want to place the arrow head in the examples.

I really recommend using nodes and coordinates for referring to known points. Also to avoid the repetitions you can create custom styles. ++ syntax is used for adding some coordinate to the last point of the current path. Finally arc (start angle:end angle:xrad and yrad) is sufficient.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes.arrows}

\begin{document}

\begin{tikzpicture}[
rotor/.style={inner sep=3pt,outer sep=0,fill opacity=0.3,minimum width=2cm,circle},
crossline/.style={gray,line width=3pt,opacity=0.5,line cap=round}
]

% cross
\draw[crossline] (-2,0) -- (2,0);
\draw[crossline] (0,-2) -- (0,2);

%rotors
\node[rotor,fill=blue,draw=blue] (n1) at (-2,0) {};
\node[rotor,fill=blue,draw=blue] (n2) at (2,0)  {};
\node[rotor,fill=red,draw=red]   (n3) at (0,-2) {};
\node[rotor,fill=red,draw=red]   (n4) at (0,2)  {};

% rotation direction arrows
\draw [->,line width=5pt] (n1) ++(140:5mm) arc (-220:40:5mm) --++(110:2mm);
\draw [->,line width=1pt] (n2) ++(140:5mm) arc (-220:40:5mm);
\draw [<-,line width=2.5pt] (n3) ++(138:5mm) --++(60:-1pt) arc (-220:40:5mm) ;
\draw [<-,line width=2.5pt] (n4) ++(138:5mm) --++(60:-1pt) arc (-220:40:5mm);

% rotors asterisk to indicate front and side
\draw plot[mark=asterisk,mark size=5pt,mark options={color=red}] coordinates {(-2,0)};
\draw plot[mark=asterisk,mark size=5pt,mark options={color=green}] coordinates {(2,0)};
\draw plot[mark=asterisk,mark size=5pt,mark options={color=cyan}] coordinates {(0,-2)};
\draw plot[mark=asterisk,mark size=5pt,mark options={color=red}] coordinates {(0,2)};

% translation direction
\node[fill=black,single arrow,minimum height=3cm] (arrow)  at (0,-3.5){};

\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer
    
how can I change the arrow tip to look like the bottom arrow? I tried adding >=latex to tikzpicture options, but then the thick tip get really ugly. –  perr0 Jan 30 '13 at 1:08
    
Instead of -> which is the default arrow head you can use -latex but that arrow head is larger than the default so the correction needs to be more significant. You can replace that line with \draw [-latex,line join=round,line width=5pt] (n1) ++(140:5mm) arc (-220:40:5mm) --++(110:3mm); Single arrow is a node shape not an arrow head. –  percusse Jan 30 '13 at 1:16
    
I know single arrow is a node shape, but I was wondering if it was possible to use that node shape (single arrow) as its is more elegante, IMO. This arrow with -> looks like it's hand drawn. –  perr0 Jan 30 '13 at 1:38
    
You can not curve a node shape. But you have many arrow head options in the manual under the arrow library section. –  percusse Jan 30 '13 at 1:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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