diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-euclide/tkz-draw-eu-angles.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tkz-euclide/tkz-draw-eu-angles.tex | 268 |
1 files changed, 15 insertions, 253 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-draw-eu-angles.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-draw-eu-angles.tex index b471338fc8a..f4c6c913e28 100644 --- a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-draw-eu-angles.tex +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-draw-eu-angles.tex @@ -10,240 +10,10 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.06c} -\def\filedate{2024/02/04} -\typeout{2024/02/04 5.06c tkz-tool-eu-angles.tex} +\def\fileversion{5.10c} +\def\filedate{2024/04/19} +\typeout{2024/04/19 5.10c tkz-tool-eu-angles.tex} \makeatletter -%<--------------------------------------------------------------------------–> -% tkzSetUpArc -%<--------------------------------------------------------------------------–> -\pgfkeys{/tkzsetuparc/.cd, - color/.store in = \tkz@arc@color, - line width/.store in = \tkz@arc@lw, - style/.store in = \tkz@arc@style, - line width = \tkz@euc@linewidth, - color = \tkz@euc@linecolor, - style = \tkz@euc@linestyle, - /tkzsetuparc/.search also = {/tikz,/tkzcompass}, - } -\def\tkzSetUpArc{\pgfutil@ifnextchar[{\tkz@SetUpArc}{\tkz@SetUpArc[]}} -\def\tkz@SetUpArc[#1]{% -\pgfqkeys{/tkzsetuparc}{#1} -\tikzset{arc style/.style={color = \tkz@arc@color, - line width = \tkz@arc@lw, - style = \tkz@arc@style - }} -}% end setup -%<------------------------------ Arcs -------------------------------------– -% options : delta -% \def\tkz@delta{0} -% \tikzset{arc style/.style={#1}} -% \pgfkeys{/tikz/.cd,delta/.code={\def\tkz@delta{#1}}} -\newif\iftkz@reverse -\gdef\tkz@numa{0} -\pgfkeys{/tkzdrawarc/.cd, - type/.is choice, - type/towards/.code = \def\tkz@numa{0}, - type/rotate/.code = \def\tkz@numa{1}, - type/angles/.code = \def\tkz@numa{2}, - type/R/.code = \def\tkz@numa{3}, - type/R with nodes/.code = \def\tkz@numa{4}, - towards/.style = {type=towards}, - rotate/.style = {type=rotate}, - R/.style = {type=R}, - angles/.style = {type=angles}, - R with nodes/.style = {type=R with nodes}, - diameter/.code = {}, - arc/.code = {}, - size/.code = {}, - mark/.code = {}, - mkpos/.code = {}, - mksize/.code = {}, - mkcolor/.code = {}, - type/.default = towards, - delta/.store in = \tkz@delta, - delta = 0, - reverse/.is if = tkz@reverse, - reverse/.default = true, - reverse = false, - /tkzdrawarc/.search also = {/tikz} -} -\def\tkzDrawArc{\pgfutil@ifnextchar[{\tkz@DrawArc}{\tkz@DrawArc[]}} -\def\tkz@DrawArc[#1](#2,#3)(#4){% -\begingroup -\pgfqkeys{/tkzdrawarc}{#1} -\ifcase\tkz@numa% - \tkzDrawArcTowards[#1](#2,#3)(#4) -\or% 1 - \tkzDrawArcRotate[#1](#2,#3)(#4) -\or% 2 - \tkzDrawArcAngles[#1](#2,#3)(#4) -\or% 3 - \tkzDrawArcRAngles[#1](#2,#3)(#4) -\or% 4 - \tkzDrawArcR[#1](#2,#3)(#4) -\fi -\endgroup -} -%<--------------------------------------------------------------------------–> -% ARC nodes #2 center #3 first point last point #4 -% delta un peu plus à chaque extrémité -% example : \tkzDrawArc(A,B)(C) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcTowards{\pgfutil@ifnextchar[{\tkz@DrawArcN}{\tkz@DrawArcN[]}} -\def\tkz@DrawArcN[#1](#2,#3)(#4){% -\begingroup - \tkz@@CalcLengthcm(#2,#3){tkz@radius} - \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,\tkz@radius)(\tkz@FirstAngle,\tkz@SecondAngle) -\endgroup -} -%<--------------------------------------------------------------------------–> -% nodes #2 center #3 first point rotate #4 with Angle -% delta un peu plus à chaque extrémité -% tkzDrawArcRotate(O,A)(60) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcRotate{\pgfutil@ifnextchar[{\tkz@DrawArcRotate}{% - \tkz@DrawArcRotate[]}} -\def\tkz@DrawArcRotate[#1](#2,#3)(#4){% -\begingroup - \tkz@@CalcLength(#2,#3){tkz@radius} - \tkzFindSlopeAngle(#2,#3) \tkzGetAngle{tkz@FirstA} - \pgfmathadd{\tkz@FirstA}{#4} - \edef\tkz@SecondA{\pgfmathresult} - \pgfmathgreaterthan{#4}{0} - \ifdim\pgfmathresult pt=1 pt\relax% - \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) - \else - \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) - \fi - \endgroup -} -%<--------------------------------------------------------------------------–> -% deux angles -% \tkzDrawArcAngles(O,A)(0,60) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcAngles{\pgfutil@ifnextchar[{\tkz@DrawArcAngles}{% - \tkz@DrawArcAngles[]}} -\def\tkz@DrawArcAngles[#1](#2,#3)(#4,#5){% -\begingroup - \tkz@@CalcLength(#2,#3){tkzLengthResult} - \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult pt)(#4,#5) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Degree #2 center #4 - #3 radius from #5 (degree) to #6(degree) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcRwithNodes{\pgfutil@ifnextchar[{\tkz@DrawArcRwithNodes}{% - \tkz@DrawArcRwithNodes[]}} -\def\tkz@DrawArcRwithNodes[#1](#2,#3,#4)(#5,#6){% -\begingroup - \tkz@@CalcLength(#3,#4){tkzLengthResult} - \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#6)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult)(\tkz@FirstAngle,\tkz@SecondAngle) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Nodes R #2 center #3 radius en cm from #4(node) to #5(node) -% \tkzDrawArcR(O,2)(A,B) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcR{\pgfutil@ifnextchar[{\tkz@DrawArcR}{\tkz@DrawArcR[]}} -\def\tkz@DrawArcR[#1](#2,#3)(#4,#5){% -\begingroup - \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) -\endgroup -} -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% #1 center #2 radius #4 first angle (degree) #5 second angle (degree) -% angles 0 .. 180 or -180 .. 0 -%<--------------------------------------------------------------------------–> -% example : \tkzDrawArc(A,2)(30,90) -\def\tkzDrawArcRAngles{\pgfutil@ifnextchar[{\tkz@DrawArcRAngles}{% - \tkz@DrawArcRAngles[]}} -\def\tkz@DrawArcRAngles[#1](#2,#3)(#4,#5){% - \begingroup - \tkzNormalizeAngle(#4,#5) - \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} - \edef\tkz@FirstAngle{\pgfmathresult}% - \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} - \edef\tkz@SecondAngle{\pgfmathresult} - \iftkz@reverse - \let\tkztemp\tkz@FirstAngle - \let\tkz@FirstAngle\tkz@SecondAngle - \let\tkz@SecondAngle\tkztemp - \fi - \draw[shift = {(#2)},arc style,/tkzdrawarc/.cd,#1]% - (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3); -\endgroup -} -%<--------------------------------------------------------------------------–> -\pgfkeys{ - /@tkzmarkarc/.cd, - pos/.store in = \tkz@mkarcpos, - color/.store in = \tkz@mkcolor, - mark/.store in = \tkz@markarcseg, - size/.store in = \tkz@mkarcsize, - color = teal!20, - size = 4pt, - pos = .5, - mark = none, - /@tkzmarkarc/.search also={/tikz}, -} -\def\tkzMarkArc{\pgfutil@ifnextchar[{\tkz@MarkArc}{\tkz@MarkArc[]}} -\def\tkz@MarkArc[#1](#2,#3,#4){% -\begingroup - \pgfqkeys{/@tkzmarkarc}{#1} \def\tkz@mymarkarc{\pgfsetplotmarksize{\tkz@mkarcsize}\pgfuseplotmark{\tkz@markarcseg}} -\tkz@@CalcLength(#2,#3){tkz@radius} -\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} -\tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} -\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) - \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} - \edef\tkz@FirstAngle{\pgfmathresult}% - \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} - \edef\tkz@SecondAngle{\pgfmathresult} -\begin{scope}[decoration={markings,mark=at position \tkz@mkarcpos with {\tkz@mymarkarc}}] -\path[shift = {(#2)},\tkz@mkcolor,/@tkzmarkarc/.cd,#1,postaction={decorate}]% -(\tkz@FirstAngle:\tkz@radius pt) arc (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt); -\end{scope} -\endgroup -} - -\def\tkzLabelArc{\pgfutil@ifnextchar[{\tkz@LabelArc}{\tkz@LabelArc[]}} -\def\tkz@LabelArc[#1](#2,#3,#4)#5{% -\begingroup -\pgfqkeys{/@tkzmarkarc}{#1} -\tkz@@CalcLength(#2,#3){tkz@radius} -\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} -\tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} -\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) -\pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} -\edef\tkz@FirstAngle{\pgfmathresult}% -\pgfmathadd{\tkz@SecondAngle}{\tkz@delta} -\edef\tkz@SecondAngle{\pgfmathresult} -\begin{scope}[decoration={markings,mark=at position \tkz@mkarcpos with \node{#5};}] - \path[shift = {(#2)},/@tkzmarkarc/.cd,#1,postaction={decorate}]% - (\tkz@FirstAngle:\tkz@radius pt) arc (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt); \end{scope} -\endgroup -} -%<---------------------------------------------------------------------------> -% tkzDrawArcRAN > -%<---------------------------------------------------------------------------> -\def\tkzDrawArcRAN[#1](#2,#3)(#4,#5){% -\begingroup - \draw[shift = {(#2)},/tkzdrawarc/.cd,#1] (#4:#3) arc (#4:#5:#3); -\endgroup -} -%<--------------- tkzPathArcRAN ---------------------------------- -\def\tkzPathArcRAN[#1](#2,#3)(#4,#5){% -\begingroup - \path[shift = {(#2)},/tkzdrawarc/.cd,#1] (#4:#3) arc (#4:#5:#3); -\endgroup -} %<---------------------------------------------------------------------------> % Mark an angle modi 3.03 suppression de \tkz@mksize, %<---------------------------------------------------------------------------> @@ -276,12 +46,12 @@ %\tikzset{lbstyle/.style = {color=\tkz@mainlinecolor}} \pgfkeys{/tkzmkangle/.cd, - arc/.estore in = \tkz@arc, - size/.store in = \tkz@size, - mark/.store in = \tkz@markang, - mkpos/.estore in = \tkz@mkpos, - mksize/.store in = \tkz@mksize, - mkcolor/.store in = \tkz@mkcolor, + arc/.code = \def\tkz@arc{#1}, + size/.code = \def\tkz@size{#1}, + mark/.code = \def\tkz@markang{#1}, + mkpos/.code = \def\tkz@mkpos{#1}, + mksize/.code = \def\tkz@mksize{#1}, + mkcolor/.code = \def\tkz@mkcolor{#1}, arc = l, size = 1, mark = none, @@ -289,7 +59,11 @@ mkcolor = black, mkpos = 0.5, /tkzmkangle/.search also={/tikz} -} +} +% utils + +%----------------------------------------------------------------------- + \def\tkzMarkAngle{\pgfutil@ifnextchar[{\tkz@MarkAngle}{\tkz@MarkAngle[]}} \def\tkz@MarkAngle[#1](#2,#3,#4){% \begingroup @@ -301,8 +75,7 @@ \def\tkz@mymark{\pgfsetplotmarksize{\tkz@mksize}\pgfuseplotmark{\tkz@markang}} % draw the arcs \begin{scope}[veclen] - \begin{scope}[decoration= {markings, - mark=at position \tkz@mkpos with {\tkz@mymark}}] + \begin{scope}[decoration = {markings, mark=at position \tkz@mkpos with {\tkz@mymark}}] \ifx\tkz@arc\tkz@arcsimple \tkzDrawArcRAN[#1,fill=none]% (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% @@ -522,17 +295,6 @@ \endgroup } %<---------------------------------------------------------------------------> -% tkzdefMidArc center and two points -\def\tkzDefMidArc(#1,#2,#3){% -\begingroup -\tkz@@CalcLength(#1,#2){tkz@radius} -\tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstAngle} -\tkzFindSlopeAngle(#1,#3)\tkzGetAngle{tkz@SecondAngle} -\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) - \path[shift = {(#1)}](\tkz@FirstAngle:\tkz@radius pt) arc - (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt) coordinate[midway] (tkzPointResult); -\endgroup -} \makeatother \endinput
\ No newline at end of file |