Created
May 26, 2010 16:26
-
-
Save astanin/414709 to your computer and use it in GitHub Desktop.
Draw an angle on tikz plots (LaTeX)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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}; | |
% | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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