[Tex/LaTex] Oriented curve in two dimensions

tikz-pgf

I'm trying to create a TikZ picture of a closed half circle centered at the origin with radius R in the plane. Here's what I have so far:

\documentclass[12pt]{article} 

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw [red,thick,domain=0:180] plot ({cos(\x)}, {sin(\x)});
\draw [red,thick,domain=0:180] plot ({cos(\x)},{0});
\draw [black,domain=-2:2] plot ({\x},{0});
\draw [black,domain=-1:1.5] plot ({0},{\x});
\end{tikzpicture}

\end{document}

That gives me my axes and my closed half circle.

Here's what else I'd like to have:

  • Arrows on the curve indicating counterclockwise orientation
  • Arrows on the positive ends of the positive axes
  • Labels "R" and "-R" under the x-axis where the circle meets the axis
  • A marking on the y-axis (maybe an "x") inside the curve

Are these simple additions? Thanks in advance for your help!

Best Answer

Is this what you are looking for?

enter image description here

The code:

\documentclass[tikz]{standalone} 
\usetikzlibrary{arrows,decorations.markings}
\begin{document}

\scriptsize
\begin{tikzpicture}[>=stealth]
\path[<-] (2,0)node[right]{$x$} edge(-2,0) (0,1.5)node[above]{$y$} edge(0,-1);
\path[draw,red,thick, postaction={decorate,
         decoration={markings,
         mark=between positions 0.15 and 1 step 0.15 with {\arrow[blue]{>};}}}] 
         (0:1) node[below]{$R$} arc (0:180:1) node[below]{$-R$}--cycle;
\node at(0,.5){$\times$};
\end{tikzpicture}

\end{document}

Note that instead of drawing it with plot, I used the simple (single line) arc path, which enables you to do easy decorations. For this simple curve, using plot will not give you much power, but for complicated functions it is indispensable.