6

I would like to draw a filled arrow around a circle. So far my picture is

enter image description here

I need to add tip at the end of the green curve in the above picture. I would like to be able to add tips for either sides. How can I do that.

\documentclass[]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,fit,arrows, positioning}
\usepackage{graphicx}
\usetikzlibrary{calc}



\begin{document}


\begin{tikzpicture}[auto,node distance=3cm,>=stealth']
\coordinate (O) at (5,0);

\draw [very thick,fill=blue,fill opacity=.1] 
( 5, 0) circle (2.0cm) node [opacity=1] {B} ;

\draw[fill=green]
($(O) + (0:23mm)$) arc (0:180:23mm) -- ($(O) + (180:24mm)$) arc (180:0:24mm) -- cycle;

\end{tikzpicture}

\end{document}
4
  • \draw[fill=green,->]? and use <- for the other way?
    – cfr
    Apr 3, 2015 at 3:15
  • @cfr, I've tried this but no luck.
    – CroCo
    Apr 3, 2015 at 3:17
  • Because it is a closed path, I think. If you draw it as a single path, it should work. See below for an example.
    – cfr
    Apr 3, 2015 at 3:23
  • Did you read Arrow with two colors with TikZ? Apr 3, 2015 at 5:52

2 Answers 2

6

Something like this?

double arrow in green

\documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{calc,arrows.meta}

\begin{document}

  \begin{tikzpicture}[auto,node distance=3cm,>={Stealth[width=4mm, length=6mm, fill=green]}]
    \coordinate (O) at (5,0);

    \draw [very thick,fill=blue,fill opacity=.1]
    ( 5, 0) circle (2.0cm) node [opacity=1] {B} ;

    \draw[double=green, double distance=1mm, <->]
    ($(O) + (0:23.5mm)$) arc (0:180:23.5mm);

  \end{tikzpicture}

\end{document}

EDIT

If you have an old version of TiKZ, the above will not work. In that case, you should either update your TeX distribution (recommended) or, if you're unable to do that, try this instead:

\documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{calc,arrows}

\begin{document}

  \begin{tikzpicture}[auto,node distance=3cm,>=stealth']
    \coordinate (O) at (5,0);

    \draw [very thick,fill=blue,fill opacity=.1]
    ( 5, 0) circle (2.0cm) node [opacity=1] {B} ;

    \draw[double=green, double distance=1mm, <->, green]
    ($(O) + (0:23.5mm)$) arc (0:180:23.5mm);

  \end{tikzpicture}

\end{document}

older double green arrows

4
  • I'm getting this error ! I can't find file tikzlibraryarrows.meta.code.tex.
    – CroCo
    Apr 3, 2015 at 3:26
  • @CroCo You have an old version of TiKZ. You can use arrows and just adapt the syntax. I only used arrows.meta because that's what I know and I'm not familiar with the configuration for the tips from arrows.
    – cfr
    Apr 3, 2015 at 3:28
  • @CroCo See edit. The second version just uses the older arrows library and should work.
    – cfr
    Apr 3, 2015 at 3:38
  • I've updated TiKz and now it is working. Thank you so much.
    – CroCo
    Apr 3, 2015 at 4:04
5

Here is solution (using my answer to Arrow with two colors with TikZ):

enter image description here

\documentclass[margin=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,arrows}
\tikzset{
  double arrows/.style args={#1 colored by #2 and #3}{
    >=stealth,
    <->,line width=#1,#2, % first arrow
    postaction={draw,<->,#3,line width=(#1)/3,
                shorten <=2*(#1)/3,shorten >=2*(#1)/3}, % second arrow
  }
}

\begin{document}
\begin{tikzpicture}
\coordinate (O) at (5,0);

\draw [very thick,fill=blue,fill opacity=.1] 
(O) circle (2.0cm) node [opacity=1] {B} ;

\draw[double arrows=1.5mm colored by black and green]
($(O) + (0:23mm)$) ++(0,-1.5mm) -- ++(0,1.5mm) arc (0:180:23mm) -- ++(0,-1.5mm);
\end{tikzpicture}%
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .