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}
CroCo
  • 5,902

2 Answers2

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

cfr
  • 198,882
  • I'm getting this error ! I can't find file tikzlibraryarrows.meta.code.tex. – CroCo Apr 03 '15 at 03: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 03 '15 at 03:28
  • @CroCo See edit. The second version just uses the older arrows library and should work. – cfr Apr 03 '15 at 03:38
  • I've updated TiKz and now it is working. Thank you so much. – CroCo Apr 03 '15 at 04: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}
Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283