Skip to content

Instantly share code, notes, and snippets.

@astanin
Created May 26, 2010 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astanin/414709 to your computer and use it in GitHub Desktop.
Save astanin/414709 to your computer and use it in GitHub Desktop.
Draw an angle on tikz plots (LaTeX)
% draw an angle arc on tikz plots
%
% #1: A point of ∠ABC
% #2: B point of ∠ABC
% #3: C point of ∠ABC
% #4: arc radius (length units)
% #5: arc style (e.g. fill=red!50!white or draw)
% #6: label
%
% Issues:
% * avoid polluting coordinates' namespace (name clashes)
% * make it more tikz-ish
\newcommand{\anglearc}[6]{%
%
\begin{scope}
\coordinate (AngleArcA) at (#1);
\coordinate (AngleArcB) at (#2);
\coordinate (AngleArcC) at (#3);
\path [clip] (AngleArcA) -- (AngleArcB) -- (AngleArcC) -- cycle;
\node (AngleArcCircle) [#5,circle,minimum size=#4] at (#2) {};
\end{scope}
\coordinate (AngleArcA1) at (intersection of AngleArcB--AngleArcA and AngleArcCircle);
\coordinate (AngleArcC1) at (intersection of AngleArcB--AngleArcC and AngleArcCircle);
\draw ($ (AngleArcA1)!0.5!(AngleArcC1) !-1.1! (AngleArcB) $) node {#6};
%
}
@astanin
Copy link
Author

astanin commented May 26, 2010

I wrote this macro before I discovered tkz-2d (http://www.texample.net/tikz/examples/tkz-2d/) which seems to be more versatile. See also: http://old.nabble.com/tkz-2d-td12645741.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment