[Tex/LaTex] Best way to denote an angle in TikZ

tikz-pgf

What is the best and simplest way to denote an angle, with an arc and a label telling its name? I wish to be able to control (obviously) the vertices on which the angle lays, the name of the angle and also control the radius of the little arc and whether it should fill the whole part-of-a-circle shape in color.

Best Answer

I just have a look to this question and related ones but I don't see anywhere my solution to mark an angle when you don't know its measure (maybe I haven't read all the post about the topic...).

So here it is:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}
\coordinate[label=below left:$A$] (A) at (0,0);
\coordinate[label=below right:$x$] (X) at (6,1);
\coordinate[label=above left:$y$] (Y) at (3,5);

\draw[thick] (X) -- (A) -- (Y);

% Mark the angle XAY
\begin{scope}
\path[clip] (A) -- (X) -- (Y);
\fill[red, opacity=0.5, draw=black] (A) circle (5mm);
\node at ($(A)+(30:7mm)$) {$\theta$};
\end{scope}

\end{tikzpicture}

\end{document}

I draw a full circle and I hide the bad part of it by clipping with a path built with the three points which define the angle. It seems so easy that it might be a bad way to do it but it works pretty well. Here I put manually the angle measure to place \theta but it could be automated surely.

Please, feel free to comment it if you think there are some situations where it doesn't work!

Mark an angle

Related Question