summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-24 21:43:02 +0000
committerKarl Berry <karl@freefriends.org>2020-01-24 21:43:02 +0000
commit4ce6f5f9c360b21c85e05cf51a20445a33aba4cc (patch)
tree7568e73fee89da48bc1ac9a383219336a4f23160 /Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex
parentd5adeaeb325c83b945dd89cac45b12a7410fd32d (diff)
tkz-euclide (24jan20)
git-svn-id: svn://tug.org/texlive/trunk@53531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex')
-rw-r--r--Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex65
1 files changed, 65 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex
new file mode 100644
index 00000000000..7385417e27a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-angles.tex
@@ -0,0 +1,65 @@
+% tkz-tools-angles.tex
+% Copyright 2011 by Alain Matthes
+% This file may be distributed and/or modified
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+\def\fileversion{3.01c}
+\def\filedate{2020/01/23}
+\typeout{2020/01/23 3.01c tkz-tools-angles.tex}
+\makeatletter
+%<--------------------------------------------------------------------------–>
+%<--------------------------------------------------------------------------–>
+% thanks karu : http://tex.stackexchange.com/questions/151667/tkzgetangle-strange-behavior/196224#196224 \tkzGetAngle strange behavior
+% defines \tkz@FirstAngle and \tkz@SecondAngle sens trigo
+%<--------------------------------------------------------------------------–>
+ \def\tkzNormalizeAngle(#1,#2){%
+ \begingroup
+ \pgfmathparse{#1}\xdef\tkz@FirstAngle{\pgfmathresult}%
+ \pgfmathparse{#2}\xdef\tkz@SecondAngle{\pgfmathresult}%
+ \pgfmathgreaterthan{\tkz@FirstAngle}{0}
+ \ifdim\pgfmathresult pt=1 pt\relax%
+ \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle}
+ \ifdim\pgfmathresult pt=1 pt\relax%
+ \pgfmathsubtract{\tkz@FirstAngle}{360}
+ \xdef\tkz@FirstAngle{\pgfmathresult}%
+ \fi
+ \else
+ \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle}
+ \ifdim\pgfmathresult pt=1 pt\relax%
+ \pgfmathadd{\tkz@SecondAngle}{360}
+ \xdef\tkz@SecondAngle{\pgfmathresult}%
+ \fi
+ \fi
+ \endgroup
+ }
+%<--------------------------------------------------------------------------–>
+% Angle
+% Recherche l'angle formé par #1 et #2 par rapport à l'horizontale
+%<--------------------------------------------------------------------------–>
+\def\tkzFindSlopeAngle(#1,#2){%
+\begingroup
+ \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{%
+ \pgfpointanchor{#2}{center}}
+ \global\let\tkzAngleResult\pgfmathresult
+\endgroup
+}
+%<--------------------------------------------------------------------------–>
+% Angle avec trois nodes
+%<--------------------------------------------------------------------------–>
+\def\tkzFindAngle(#1,#2,#3){% new code 2016
+\begingroup
+ \tkzFindSlopeAngle(#2,#1)\tkzGetAngle{tkz@FirstAngle}
+ \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@SecondAngle}
+ \tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle)
+ \edef\tkz@Angle{\fpeval{\tkz@SecondAngle-\tkz@FirstAngle}}
+ \global\let\tkzAngleResult\tkz@Angle
+\endgroup
+}
+%<--------------------------------------------------------------------------–>
+% Find angle
+%<--------------------------------------------------------------------------–>
+\def\tkzGetAngle#1{%
+ \global\expandafter\edef\csname #1\endcsname{\tkzAngleResult}
+}
+\makeatother
+\endinput \ No newline at end of file