[Tex/LaTex] Mark angles with arrows using tkz-euclide

tkz-euclide

I'm using \tkzMarkAngle(A,O,P) to mark angles. I would like this mark, which is only an arc, to be an arrow, to indicate a rotation. How can I do that?

Best Answer

Here's an example (stolen shamelessly from the tkz-euclide manual):

\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\usetkzobj{all}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}[scale=2]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(2,-1){A}
  \tkzDefPoint(2,2){B}
  \tkzDefPointsBy[symmetry=center O](B,A){}
  \tkzDrawLine(A,A')
  \tkzDrawLine(B,B')
  \tkzMarkAngle[mark=s,arc=l,size=2 cm,mkcolor=red,line width=2pt,arrows=->](A,O,B)
\end{tikzpicture}

\end{document}

enter image description here

But you can also use decorations as here:

\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\usetkzobj{all}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}[scale=2,my arrow/.style={decorate,decoration={markings,mark=at position 1 with {\arrow[scale=4]{>}};}}]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(2,-1){A}
  \tkzDefPoint(2,2){B}
  \tkzDefPointsBy[symmetry=center O](B,A){}
  \tkzDrawLine(A,A')
  \tkzDrawLine(B,B')
  \tkzDrawArc[postaction={my arrow}](O,A)(B)
\end{tikzpicture}

\end{document}

To get

enter image description here

UPDATE

It seems that mark=at position 1 with ... doesn't always work when TikZ thinks that 1 is past the end of the path. So, you can modify this by using

mark=at position -0.1pt with ...

The negative distance tells TikZ to place the decoration at the end of the path. I'd recommend a negligible distance. Also, if you've loaded the TikZ library calc, you can write something like

\coordinate (tOA) at ($(O)!2cm!(A)$);
\tkzDrawArc[postaction={my arrow}](O,tOA)(B)

to control how far from the angle vertex the arc is placed.

Related Question