diff options
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-euclide/latex/drawings')
9 files changed, 2155 insertions, 0 deletions
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex new file mode 100644 index 0000000000..3676422441 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex @@ -0,0 +1,538 @@ +% tkz-tool-eu-angles.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c 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, +%<---------------------------------------------------------------------------> +% \tkzMarkAngle(B, A, C) +% +% Marque d'angle +% arc de cercle (simple/double/triple) et marque d'églité. +% +% Par défaut: +% arc = simple +% size = 1 (rayon de l'arc) +% style traits pleins +% mkpos ? position: 0.5 (position de la marque) +% mark rien du tout (ignoré si type est utilisé) +% +% Paramètres (optionnels) +% arc : l, ll, lll +% mksize : 1 +% gap : 3pt +% dist ? +% style : type de traits +% position: 0.5 +% mark : none , |, ||,|||, z, s, x, o, oo mais tous les +% % symboles de tikz sont permis +%<------------------------- Label on angle --------------------------------> +\def\tkz@arcsimple{l} +\def\tkz@arcdouble{ll} +\def\tkz@arctriple{lll} + +%\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 = l, + size = 1, + mark = none, + mksize = 4pt, + mkcolor = black, + mkpos = 0.5, + /tkzmkangle/.search also={/tikz} +} +\def\tkzMarkAngle{\pgfutil@ifnextchar[{\tkz@MarkAngle}{\tkz@MarkAngle[]}} +\def\tkz@MarkAngle[#1](#2,#3,#4){% +\begingroup +\pgfqkeys{/tkzmkangle}{#1} +\tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} +\tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} +\tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + +\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}}] + \ifx\tkz@arc\tkz@arcsimple + \tkzDrawArcRAN[#1,fill=none]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle) + \else + \ifx\tkz@arc\tkz@arcdouble + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm-2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle) + \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm+2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle)% + \else + \ifx\tkz@arc\tkz@arctriple + \tkzDrawArcRAN[#1,fill=none]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm-2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm+2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle)% + \fi + \fi + \fi + \end{scope} +\end{scope} + +\endgroup +} +%<---------------------------------------------------------------------------> +% multiple +\def\tkz@multiMA#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzMarkAngle[\tkz@optma](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<---------------------------------------------------------------------------> +\def\tkzMarkAngles{\pgfutil@ifnextchar[{\tkz@MarkAngles}{\tkz@MarkAngles[]}} +\def\tkz@MarkAngles[#1](#2){% +\xdef\tkz@optma{#1} + \begingroup + \let\next\tkz@multiMA + \next#2 \@nil % +\endgroup +} +% fin de \tkzMarkAngle +%<---------------------------------------------------------------------------> +% Pic Angle +%<---------------------------------------------------------------------------> +\def\tkzPicAngle{\pgfutil@ifnextchar[{\tkz@PicAngle}{\tkz@PicAngle[]}} +\def\tkz@PicAngle[#1](#2,#3,#4){% +\begingroup +\draw pic [#1]{angle=#2--#3--#4}; +\endgroup +} +\def\tkzPicRightAngle{\pgfutil@ifnextchar[{\tkz@PicRightAngle}{\tkz@PicRightAngle[]}} +\def\tkz@PicRightAngle[#1](#2,#3,#4){% +\begingroup +\draw pic [#1]{right angle=#2--#3--#4}; +\endgroup +} +%<---------------------------------------------------------------------------> +% FillAngle +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzFill/.cd, + size/.store in = \tkz@size, + size = 1, + /tkzFill/.search also = {/tikz} + } + +\def\tkzFillAngle{\pgfutil@ifnextchar[{\tkz@FillAngle}{\tkz@FillAngle[]}} +\def\tkz@FillAngle[#1](#2,#3,#4){% +\begingroup +\pgfqkeys{/tkzFill}{#1} + \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} + \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} + \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + \path[shift = {(#3)},fill=\tkz@euc@linecolor!10,/tkzFill/.cd,#1]% + (#3) -- (\tkz@FirstAngle:\tkz@size) arc% + (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@size)--cycle; +\endgroup +} +%<---------------------------------------------------------------------------> +% multiple +\def\tkz@multiFA#1 #2\@nil{\protected@edef\tkz@temp{% + \noexpand \tkzFillAngle[\tkz@optfa](#1)}% + \tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<---------------------------------------------------------------------------> +\def\tkzFillAngles{\pgfutil@ifnextchar[{\tkz@MFillAngles}{\tkz@MFillAngles[]}} +\def\tkz@MFillAngles[#1](#2){% +\xdef\tkz@optfa{#1} +\begingroup + \let\next\tkz@multiFA + \next#2 \@nil % +\endgroup +} +%<------------------------- Label on angle --------------------------------> +\pgfkeys{/tkzlabelangle/.cd, + dist/.store in = \tkzlabeldist, + angle/.store in = \tkzlabelangle, + dist = 1, + angle = {}, + /tkzlabelangle/.search also={/tikz} +} +\def\tkzLabelAngle{\pgfutil@ifnextchar[{\tkz@LabelAngle}{\tkz@LabelAngle[]}} +\def\tkz@LabelAngle[#1](#2,#3,#4)#5{%2016 added normalize from karu's code +\begingroup + \pgfqkeys{/tkzlabelangle}{#1} + \ifx\tkzutil@empty\tkzlabelangle% no value so calc angle of bisector + \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} + \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} + \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + \edef\tkzlabelAngle{\fpeval{(\tkz@SecondAngle+\tkz@FirstAngle)/2}} + \fi + \path (#3) --+(\tkzlabelAngle:\tkzlabeldist) node[label angle style,% + /tkzlabelangle/.cd,#1] {#5}; +\endgroup +} +%<---------------------------------------------------------------------------> +%<---------------------------------------------------------------------------> +% multiple labels +\def\tkz@multiLBA#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzLabelAngle[\tkz@optlba](#1){\tkz@labelangle}}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +% %<--------------------------------------------------------------------- +\def\tkzLabelAngles{\pgfutil@ifnextchar[{\tkz@LabelAngles}{% + \tkz@LabelAngles[]}} +\def\tkz@LabelAngles[#1](#2)#3{% + \def\tkz@optlba{#1} + \def\tkz@labelangle{#3} + \begingroup + \let\next\tkz@multiLBA + \next#2 \@nil % + \endgroup +} +%<----------------------------------------------------------------------- +% Symbole droites perpendiculaires +%<---------------------------------------------------------------------- +\pgfkeys{/tkzrightangle/.cd, + norm tkz code/.is if = normtkzcode@execute, + german/.code = \normtkzcode@executefalse, + size/.store in = \tkz@ra@size, + dotsize/.store in = \tkz@dotsize, + size = .25, + dotsize = 3 pt, + /tkzrightangle/.search also={/tikz}, +} +\newcommand*{\tkzMarkRightAngle}[1][]{\tkz@MarkRightAngle[#1]} +\def\tkz@MarkRightAngle[#1](#2,#3,#4){% +\begingroup +\normtkzcode@executetrue +\pgfqkeys{/tkzrightangle}{#1} + \tkzpointnormalised{\pgfpointdiff{\pgfpointanchor{#3}{center}}{% + \pgfpointanchor{#2}{center}}} + \tkz@ax=\pgf@x\relax% + \tkz@ay=\pgf@y\relax% + \tkzpointnormalised{\pgfpointdiff{\pgfpointanchor{#3}{center}}{% + \pgfpointanchor{#4}{center}}} + \tkz@bx=\pgf@x\relax% + \tkz@by=\pgf@y\relax% + \ifnormtkzcode@execute% + \draw[/tkzrightangle/.cd,#1] + (#3) --++( 28.45274*\tkz@ra@size\tkz@ax , 28.45274*\tkz@ra@size\tkz@ay) + --++( 28.45274*\tkz@ra@size\tkz@bx , 28.45274*\tkz@ra@size\tkz@by) + --++(-28.45274*\tkz@ra@size\tkz@ax ,-28.45274*\tkz@ra@size\tkz@ay) + -- (#3); + \else% + % find angles + \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} + \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} + \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + \edef\tkzCircleAngle{\fpeval{(\tkz@SecondAngle+\tkz@FirstAngle)/2}} + \tkzDrawArcRAN[/tkzrightangle/.cd,#1](#3,\tkz@ra@size)% + (\tkz@FirstAngle,\tkz@SecondAngle) + \path (#3) --+ (\tkzCircleAngle:\tkz@ra@size/2) + node[fill,circle,minimum size=\tkz@dotsize, + inner sep=0 pt,/tkzrightangle/.cd,#1] {}; +\fi% +\endgroup +} +%<---------------------------------------------------------------------------> +\def\tkz@multiRA#1 #2\@nil{% +\protected@edef\tkz@temp{ + \noexpand \tkzMarkRightAngle[\tkz@optRA](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi +\next#2\@nil +} +%<---------------------------------------------------------------------------> +\def\tkzMarkRightAngles{\pgfutil@ifnextchar[{\tkz@RightAngles}{% + \tkz@RightAngles[]}} +\def\tkz@RightAngles[#1](#2){% +\xdef\tkz@optRA{#1} +\begingroup + \let\next\tkz@multiRA + \next#2 \@nil % +\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 diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex new file mode 100644 index 0000000000..8a9764d763 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex @@ -0,0 +1,165 @@ +% tkz-obj-eu-draw-circles.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-draw-circles.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% tkzSetUpCircle +%<--------------------------------------------------------------------------–> +\pgfkeys{% + /tkzsetupcirc/.cd, + color/.code = \def\tkz@circle@color{#1}, + line width/.code = \def\tkz@circle@linewidth{#1}, + style/.code = \def\tkz@circle@style{#1}, + /tkzsetupcirc/.search also = {/tikz} + } + %<--------------------------------------------------------------------------–> + +\def\tkzSetUpCircle{\pgfutil@ifnextchar[{\tkz@SetUpCircle}{\tkz@SetUpCircle[]}} +\def\tkz@SetUpCircle[#1]{% +\pgfkeys{% + tkzsetupcirc/.cd, + line width = \tkz@euc@circlelw, + color = \tkz@euc@circlecolor, + style = \tkz@euc@circlestyle +} +\pgfqkeys{/tkzsetupcirc}{#1} +\tikzset{% + circle style/.append style = { % + color = \tkz@circle@color, + line width = \tkz@circle@linewidth, + style = \tkz@circle@style, + #1} + } +}% end setup + %<--------------------------------------------------------------------------–> + +\def\tkzDrawCircle{\pgfutil@ifnextchar[{\tkz@DrawCircle}{\tkz@DrawCircle[]}} +\def\tkz@DrawCircle[#1](#2,#3){% +\begingroup +\node [draw,circle through=(#3), circle style,#1] at (#2) {}; +%perhaps I need to use the last method + % \tkzCalcLength(#2,#3) \tkzGetLength{tkz@ncradius} + % \draw[circle style,#1](#2) circle (\tkz@ncradius); +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@multicircles#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzDrawCircle[\tkz@optcircle](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +}% +%<--------------------------------------------------------------------------–> +\def\tkzDrawCircles{\pgfutil@ifnextchar[{\tkz@DrawCircles}{\tkz@DrawCircles[]}} +\def\tkz@DrawCircles[#1](#2){% +\xdef\tkz@optcircle{#1} +\begingroup + \let\next\tkz@multicircles + \next#2 \@nil % +\endgroup +}% +%<--------------------------------------------------------------------------–> +% #2 #3 rayon + +\def\tkzDrawSemiCircle{\pgfutil@ifnextchar[{\tkz@DrawSemiCircle}{% + \tkz@DrawSemiCircle[]}} +\def\tkz@DrawSemiCircle[#1](#2,#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \path(#2)--++(-\tkz@ax,-\tkz@ay) coordinate (tkz@pt); + \tkzDrawArc[#1,delta=0](#2,#3)(tkz@pt) +\endgroup +}% +%<--------------------------------------------------------------------------–> +\def\tkz@multisemicircles#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzDrawSemiCircle[\tkz@optsemicircle](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +}% +%<--------------------------------------------------------------------------–> +\def\tkzDrawSemiCircles{\pgfutil@ifnextchar[{\tkz@DrawSemiCircles}{% +\tkz@DrawSemiCircles[]}} +\def\tkz@DrawSemiCircles[#1](#2){% +\xdef\tkz@optsemicircle{#1} +\begingroup + \let\next\tkz@multisemicircles + \next#2 \@nil % +\endgroup +}% +%<---------------------------- Fill Circle --------------------------------–> +\def\tkzFillCircle{\pgfutil@ifnextchar[{\tkz@FillCircle}{\tkz@FillCircle[]}} +\def\tkz@FillCircle[#1](#2,#3){% +\begingroup + \node [fill,circle through=(#3),#1] at (#2) {}; +\endgroup +}% +\def\tkz@multifillcircles#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzFillCircle[\tkz@optfillcircle](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +}% +\def\tkzFillCircles{\pgfutil@ifnextchar[{\tkz@FillCircles}{% +\tkz@FillCircles[]}} +\def\tkz@FillCircles[#1](#2){% +\xdef\tkz@optfillcircle{#1} +\begingroup + \let\next\tkz@multifillcircles + \next#2 \@nil % +\endgroup +}% + +%<--------------------------- Clip Circle ---------------------------------–> +\pgfkeys{/tkzclipc/.cd, + out code/.is if = tkzClipOutCircle, + out/.code = \tkzClipOutCirclefalse +}% +%<--------------------------------------------------------------------------–> +\def\tkzClipCircle{\pgfutil@ifnextchar[{\tkz@ClipCircle}{\tkz@ClipCircle[]}} +\def\tkz@ClipCircle[#1](#2,#3){% +\tkzClipOutCircletrue +\pgfqkeys{/tkzclipc}{#1} + \tkz@@CalcLength(#2,#3){tkzLengthResult} + \iftkzClipOutCircle + \clip (#2) circle (\tkzLengthResult pt); + \else + \clip (#2) circle (\tkzLengthResult pt) [tkzreverseclip] ; + \fi +} +%<--------------------------- Label Circle --------------------------------–> +\def\tkzLabelCircle{\pgfutil@ifnextchar[{\tkz@LabelCircle}{% + \tkz@LabelCircle[]}} +% [option] (#2,#3) #2 center #3 un point du cercle #4 angle #5 the label +\def\tkz@LabelCircle[#1](#2,#3)(#4)#5{% +\begingroup + \tkzURotateAngle(#2,#4)(#3) + \node[label style,#1] at (tkzPointResult) {#5}; +\endgroup +} +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex new file mode 100644 index 0000000000..76f3a888be --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex @@ -0,0 +1,100 @@ +% tkz-obj-eu-compass.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-compass.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Author Alain Matthes +% idea from Y. Combe +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Utilisation du Compas : Compass +%<--------------------------------------------------------------------------–> +% Setup Compass +%<--------------------------------------------------------------------------–> +\pgfkeys{tkzsucompass/.cd, + line width/.store in = \tkz@compass@lw, + color/.store in = \tkz@compass@color, + style/.store in = \tkz@compass@style, + line width = \tkz@euc@compasswidth, + color = \tkz@euc@compasscolor, + style = \tkz@euc@compassstyle, + /tkzsucompass/.search also = {/tikz,/tkzcompass} + } +%<--------------------------------------------------------------------------–> +\def\tkzSetUpCompass{\pgfutil@ifnextchar[{\tkz@SetUpCompass}{\tkz@SetUpCompass[]}} +%<--------------------------------------------------------------------------–> +\def\tkz@SetUpCompass[#1]{% +\pgfqkeys{/tkzsucompass}{#1} +\tikzset{compass style/.style={% + color = \tkz@compass@color, + line width = \tkz@compass@lw, + style = \tkz@compass@style + }} +} +%<--------------------------------------------------------------------------–> +% \tkzCompass(A, B) +% +% Marque de compas auto-ajustée en longueur +% #2 center #3 le point +% Par défaut: +% longueur : 1cm, mais avec un maximum d'un angle de 180° +% angle calculé pour la longueur +% style traits pleins + +%<--------------------------------------------------------------------------–> + \pgfkeys{/tkzcompass/.cd, + delta/.store in = \tkz@delta, + length/.store in = \tkz@length, + length = 1, + delta = 0, + /tkzcompass/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, /tikz/\searchname/.retry=#1}} +} + +\def\tkzCompass{\pgfutil@ifnextchar[{\tkz@Compass}{\tkz@Compass[]}} +\def\tkz@Compass[#1](#2,#3){% +\begingroup +\pgfkeys{tkzcompass/.cd,#1} +\tkz@@CalcLength(#2,#3){tkz@tempLen} +\ifnum\tkz@delta=0 % + \pgfmathsetmacro{\tkz@delta}{min(deg(\tkz@length cm/ \tkz@tempLen pt),180)/2} +\fi +\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@angle}% +\draw[shift ={(#2)},compass style,/tkzcompass/.cd,#1]% + (\tkz@angle-\tkz@delta:\tkz@tempLen pt)% + arc (\tkz@angle-\tkz@delta:\tkz@angle+\tkz@delta:\tkz@tempLen pt); +\endgroup} +%<--------------------------------------------------------------------------–> +\def\tkz@multiCompass#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzCompass[\tkz@optcompass](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +\def\tkzCompasss{\pgfutil@ifnextchar[{\tkz@Compasss}{\tkz@Compasss[]}} + +\def\tkz@Compasss[#1](#2){% +\global\edef\tkz@optcompass{#1} +\begingroup + \let\next\tkz@multiCompass + \next#2 \@nil % +\endgroup +}% + +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex new file mode 100644 index 0000000000..216bc15fcb --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex @@ -0,0 +1,281 @@ +% tkz-obj-eu-draw-lines.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-draw-lines.tex} +\makeatletter + +%<--------------------------------------------------------------------------–> +% Setup Line +%<--------------------------------------------------------------------------–> +\pgfkeys{% + tkzsuline/.cd, + line width/.code = \def\tkz@line@width{#1}, + color/.code = \def\tkz@line@color{#1}, + style/.code = \def\tkz@line@style{#1}, + add/.code args = {#1 and #2} {\def\tkz@line@left{#1} + \def\tkz@line@right{#2}}, + /tkzsuline/.search also = {/tikz} +} +%<--------------------------------------------------------------------------–> +\def\tkzSetUpLine{\pgfutil@ifnextchar[{\tkz@SetUpLine}{\tkz@SetUpLine[]}} +\def\tkz@SetUpLine[#1]{% +\pgfkeys{% + tkzsuline/.cd, + line width = \tkz@euc@linewidth, + color = \tkz@euc@linecolor, + style = \tkz@euc@linestyle, + add = {\tkz@euc@lineleft} and {\tkz@euc@lineright}} +\pgfqkeys{/tkzsuline}{#1} +\tikzset{% + line style/.append style ={% + line width = \tkz@line@width, + color = \tkz@line@color, + style = \tkz@line@style, + add = {\tkz@line@left} and {\tkz@line@right}, + line cap = round, + #1} + } +}% end setup +%<--------------------------------------------------------------------------–> +% Drawing a line +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% \pgfkeys{/tkzdrawl/.cd, +% /tkzdrawl/.search also={/tikz} +% } +\def\tkzDrawLine{\pgfutil@ifnextchar[{\tkz@DrawLine}{\tkz@DrawLine[]}} +\def\tkz@DrawLine[#1](#2,#3){% +\begingroup + % \pgfqkeys{/tkzdrawl}{#1} + \draw[line style,#1] (#2) to (#3); +\endgroup +} +%<-------------------------------------------------------------------------– +% tkzDrawLines +%<-------------------------------------------------------------------------– +\def\tkz@@multiLines#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzDrawLine[\tkz@optline](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzDrawLines{\pgfutil@ifnextchar[{\tkz@DrawLines}{\tkz@DrawLines[]}} +\def\tkz@DrawLines[#1](#2){% +\xdef\tkz@optline{#1} +\begingroup + \let\next\tkz@@multiLines + \next#2 \@nil % +\endgroup +}% +%<-------------------------------------------------------------------------–> +% Label +%<-------------------------------------------------------------------------–> +\def\tkzLabelLine{\pgfutil@ifnextchar[{\tkz@AddLabelLine}{\tkz@AddLabelLine[]}} +\def\tkz@AddLabelLine[#1](#2,#3)#4{\path (#2) to node[#1]{#4}(#3);} + + +%<--------------------------------------------------------------------------–> +% draw segment (s) +%<--------------------------------------------------------------------------–> +\pgfkeys{/tkzdraws/.cd, + /tkzdraws/.search also={/tikz}, +} +\def\tkzDrawSegment{\pgfutil@ifnextchar[{\tkz@DrawSegment}{% + \tkz@DrawSegment[]}} +\def\tkz@DrawSegment[#1](#2,#3){% +\scope + \pgfqkeys{/tkzdraws}{#1} + \draw[line style,add=0 and 0,#1] (#2) to (#3); +\endscope +}% + +\def\tkz@multiDrawSeg#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzDrawSegment[\tkz@optseg](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +\def\tkzDrawSegments{\pgfutil@ifnextchar[{\tkz@DrawSegments}{% + \tkz@DrawSegments[]}} +\def\tkz@DrawSegments[#1](#2){% +\def\tkz@optseg{#1} +\begingroup + \let\next\tkz@multiDrawSeg + \next#2 \@nil % +\endgroup +} +%<--------------------------------------------------------------------------–> +% Mark Segment +%<--------------------------------------------------------------------------–> +\pgfkeys{ + /@tkzmarkoptions/.cd, + pos/.store in = \tkz@mkpos, + color/.store in = \tkz@mkcolor, + mark/.store in = \tkz@markseg, + size/.store in = \tkz@mksize, + size = 4pt, + color = \tkz@mk@color, + pos = .5, + mark = |, + /@tkzmarkoptions/.search also={/tikz}, +} +\def\tkzMarkSegment{\pgfutil@ifnextchar[{\tkz@MarkSegment}{\tkz@MarkSegment[]}} +\def\tkz@MarkSegment[#1](#2,#3){% +\begingroup + \pgfqkeys{/@tkzmarkoptions}{#1} +\def\tkz@mymark{\pgfsetplotmarksize{\tkz@mksize}\pgfuseplotmark{\tkz@markseg}} +\begin{scope} + [decoration={markings,mark=at position \tkz@mkpos with {\tkz@mymark}}] + \path [\tkz@mkcolor,/@tkzmarkoptions/.cd,#1,postaction={decorate}] (#2) -- (#3); +\end{scope} +\endgroup +} +%<--------------------------------------------------------------------------–> +% multiple +\def\tkz@multiMS#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzMarkSegment[\tkz@optsg](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzMarkSegments{\pgfutil@ifnextchar[{\tkz@MarkSegments}{\tkz@MarkSegments[]}} +\def\tkz@MarkSegments[#1](#2){% +\def\tkz@optsg{#1} + \begingroup + \let\next\tkz@multiMS + \next#2 \@nil % +\endgroup +} +%<-------------------------------------------------------------------------–> +% Label on segment +%<-------------------------------------------------------------------------–> +\def\tkzLabelSegment{\pgfutil@ifnextchar[{\tkz@LabelSegment}% + {\tkz@LabelSegment[]}} +\def\tkz@LabelSegment[#1](#2,#3)#4{% +\begingroup + \path (#2) to node[label style,#1]{#4} (#3) ; +\endgroup +} +%<--------------------------------------------------------------------------–> +% multiple +\def\tkz@multiLS#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzLabelSegment[\tkz@optls](#1){\tkz@labelseg}}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzLabelSegments{\pgfutil@ifnextchar[{\tkz@LabelSegments}{\tkz@LabelSegments[]}} +\def\tkz@LabelSegments[#1](#2)#3{% +\def\tkz@optls{#1} +\def\tkz@labelseg{#3} + \begingroup + \let\next\tkz@multiLS + \next#2 \@nil % +\endgroup +} +%<--------------------------------------------------------------------------–> +% PolySeg +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolySeg{\pgfutil@ifnextchar[{\tkz@DrawPolySeg}{\tkz@DrawPolySeg[]}} +\def\tkz@DrawPolySeg[#1](#2,#3){% +\begingroup +\draw[line style,#1] (#2) + \foreach \pt in {#2,#3}{--(\pt)};% +\endgroup +} + + +%<--------------------------------------------------------------------------–> +% add dim + % \draw[dim={5,7pt,}] (A) -- (B); + % \draw[dim={7,10pt,transform shape}] (B) -- (C); + % \draw[dim={X,,}] (A) -- (C); +%<--------------------------------------------------------------------------–> +% new code from muzimuzhi Z +%https://tex.stackexchange.com/questions/553430/change-color-and-style-of-dimension-lines-in-tkz-euclide/553441 + +\pgfkeys{/pgf/decoration/.cd, distance/.initial = 10pt} + +\pgfdeclaredecoration{add dim}{final}{ +\state{final}{% +\pgfmathsetmacro{\dist}{\pgfkeysvalueof{/pgf/decoration/distance}} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{1.2*\dist}} + \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} + \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{1.2*\dist}} + % start of patch + \pgfusepath{stroke} + \pgfsetarrowsstart{latex} + \pgfsetarrowsend{latex} + \expandafter\pgfsetdash\tkz@dim@dashpattern + \pgfsetstrokecolor{\tkz@dim@color} + % end of patch + \pgfpathmoveto{\pgfpoint{0pt}{\dist}} + \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}} + \pgfusepath{stroke} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} +}} + + +\tikzset{ + dim/.style args={#1,#2,#3}{% + postaction={ + decoration={ + show path construction, + lineto code={ + % dim fence + \draw[dim fence style/.try] + (\tikzinputsegmentfirst) -- + ($ (\tikzinputsegmentfirst)!1.2*(#2)!90:(\tikzinputsegmentlast) $) + (\tikzinputsegmentlast) -- + ($ (\tikzinputsegmentlast)!1.2*(#2)!-90:(\tikzinputsegmentfirst) $); + % dim + \draw[dim style/.try] + ($ (\tikzinputsegmentfirst)!#2!90:(\tikzinputsegmentlast) $) -- + node[inner sep=0pt, font=\footnotesize, fill=\tkz@fillcolor, pos=.5, #3] {#1} + ($ (\tikzinputsegmentlast)!#2!-90:(\tikzinputsegmentfirst) $); + } + }, + decorate, + } + }, + dim/.default={,0pt,}, + dim style/.style={ + latex-latex, + }, +} + +%<--------------------------- style line ---------------------------------> +\tikzset{add/.style args={#1 and #2}{to path={% + ($(\tikztostart)!-#1!(\tikztotarget)$)--($(\tikztotarget)!-#2!(\tikztostart)$)% + \tikztonodes}} +} +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex new file mode 100644 index 0000000000..eeffaecff2 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex @@ -0,0 +1,171 @@ + % tkz-obj-eu-points.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-points.tex} +\makeatletter +%<---------------------------------------------------------------------------> +% tkzSetUpPoint définit la forme d'un point +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzsetuppt/.cd, + size/.store in = \tkz@pt@size, + color/.store in = \tkz@pt@color, + fill/.store in = \tkz@pt@fill, + shape/.store in = \tkz@pt@shape, + size = \tkz@euc@pointsize, + color = \tkz@euc@pointcolor, + fill = \tkz@euc@pointcolor, + shape = \tkz@euc@pointshape, + /tkzsetuppt/.search also = {/tikz}, + } +\def\tkzSetUpPoint{\pgfutil@ifnextchar[{\tkz@SetUpPoint}{% + \tkz@SetUpPoint[]}} +\def\tkz@SetUpPoint[#1]{% +\pgfqkeys{/tkzsetuppt}{#1} +% redefine point style with new values +\tikzset{point style/.style={draw = \tkz@pt@color, + inner sep = 0pt, + shape = \tkz@pt@shape, + minimum size = \tkz@pt@size, + fill = \tkz@pt@fill}} +}% end setup +%<---------------------------------------------------------------------------> +% Draw Point +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzdrawpt/.cd, + size/.code = {\tikzset{point style/.append style={minimum size = #1}}}, + size = \tkz@euc@pointsize, + /tkzdrawpt/.search also = {/tikz}, +} +%<-------------------------------------------------------------------------- +\def\tkzDrawPoint{\pgfutil@ifnextchar[{\tkz@DrawPoint}{\tkz@DrawPoint[]}} +\def\tkz@DrawPoint[#1](#2){% +\begingroup + \pgfqkeys{/tkzdrawpt}{#1} + \node[point style,/tkzdrawpt/.cd,#1] at (#2) {};%2016 +\endgroup +} +%<---------------------------------------------------------------------------> +\def\tkzDrawPoints{\pgfutil@ifnextchar[{\tkz@drawpts}{\tkz@drawpts[]}} +%<---------------------------------------------------------------------------> +\def\tkz@drawpts[#1](#2){% +\begingroup + \pgfqkeys{/tkzdrawpt}{#1} + \foreach \point in {#2}{\node[point style,/tkzdrawpt/.cd,#1] at (\point) {};} %2016 +\endgroup +} +%<--------------------------------------------------------------------------> +% tkzLabelPoint Affichage des LABELS pour un point +%<--------------------------------------------------------------------------> +\def\tkzLabelPoint{\pgfutil@ifnextchar[{\tkz@LabelPoint}{\tkz@LabelPoint[]}} +\def\tkz@LabelPoint[#1](#2)#3{% + \node[label style,#1] at (#2) {#3};}% +%<---------------------------------------------------------------------------> + +\def\tkzLabelPoints{\pgfutil@ifnextchar[{\tkz@LabelPoints}{\tkz@LabelPoints[]}}% +\def\tkz@LabelPoints[#1](#2){% + \foreach \point in {#2}{ + \node[label style,#1] at (\point) {$\point$};} +}% +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzsetuppt/.cd, + size/.store in = \tkz@pt@size, + color/.store in = \tkz@pt@color, + fill/.store in = \tkz@pt@fill, + shape/.store in = \tkz@pt@shape, + size = \tkz@euc@pointsize, + color = \tkz@euc@pointcolor, + fill = \tkz@euc@pointcolor, + shape = \tkz@euc@pointshape, + /tkzsetuppt/.search also = {/tikz}, + } +\def\tkzSetUpPoint{\pgfutil@ifnextchar[{\tkz@SetUpPoint}{% + \tkz@SetUpPoint[]}} +\def\tkz@SetUpPoint[#1]{% +\pgfqkeys{/tkzsetuppt}{#1} +% redefine point style with new values +\tikzset{point style/.style={draw = \tkz@pt@color, + inner sep = 0pt, + shape = \tkz@pt@shape, + minimum size = \tkz@pt@size, + fill = \tkz@pt@fill}} +}% end setup +%<---------------------------------------------------------------------------> +% +%<---------------------------------------------------------------------------> +\def\tkzSetUpLabel{\pgfutil@ifnextchar[{\tkz@SetUpLabel}{% + \tkz@SetUpLabel[]}} +\def\tkz@SetUpLabel[#1]{% +\tikzset{label style/.style={#1}} +}% end setup +%<---------------------------------------------------------------------------> + +\pgfkeys{/tkzautolab/.cd, + center/.store in = \tkz@center, + dist/.store in = \tkz@dist, + dist = 0.15, + /tkzautolab/.search also = {/tikz}, +} +\def\tkzAutoLabelPoints{\pgfutil@ifnextchar[{\tkz@AutoLabelPoints}{\tkz@AutoLabelPoints[]}}% +\def\tkz@AutoLabelPoints[#1](#2){% +\begingroup +\pgfqkeys{/tkzautolab}{#1} + \foreach \point in {#2}{ + \path (\tkz@center) -- ($ (\point) + \tkz@dist*($(\point)-(\tkz@center)$) $) node[/tkzautolab/.cd,label style,#1]{$\point$};} +\endgroup +}% +%<---------------------------------------------------------------------------> +% PointShowCoord +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzprcoord/.cd, + xlabel/.store in = \tkz@xlabel, + ylabel/.store in = \tkz@ylabel, + xstyle/.code = {\tikzset{xcoord style/.append style={#1}}}, + ystyle/.code = {\tikzset{ycoord style/.append style={#1}}}, + noxdraw/.is if = tkz@coord@noxdraw, + noxdraw/.default = true, + noydraw/.is if = tkz@coord@noydraw, + noydraw/.default = true, + xlabel = {}, + ylabel = {}, + xstyle = {}, + ystyle = {}, + noxdraw = false, + noydraw = false, + /tkzprcoord/.search also = {/tikz}, +} +\def\tkzPointShowCoord{\pgfutil@ifnextchar[{\tkz@PointShowCoord}{\tkz@PointShowCoord[]}} +\def\tkz@PointShowCoord[#1](#2){% +\begingroup +\pgfqkeys{/tkzprcoord}{#1} +% 2019 for showcoord + \iftkznodedefined{tkz@xline}{}{% + \path (0,0) --(1,0) node(tkz@xline){}; + \path (0,0) --(0,1) node(tkz@yline){}; + } +\iftkz@coord@noxdraw\else\draw[arrow coord style,/tkzprcoord/.cd,#1] (#2)--(#2 |- tkz@xline);\fi +\iftkz@coord@noydraw\else\draw[arrow coord style,/tkzprcoord/.cd,#1] (#2)--(#2 -| tkz@yline);\fi +\ifx\tkzutil@empty\tkz@xlabel +\else +\path (#2)--(#2 |- tkz@xline) + node[xcoord style] {\tkz@xlabel}; +\fi +\ifx\tkzutil@empty\tkz@ylabel +\else + \path (#2)--(#2 -| tkz@yline) + node[ycoord style] {\tkz@ylabel}; +\fi +\endgroup +} +\let\tkzShowPointCoord\tkzPointShowCoord +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex new file mode 100644 index 0000000000..a0f59a0a65 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex @@ -0,0 +1,106 @@ +% tkz-obj-eu-polygons.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-polygons.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Polygon +%<--------------------------------------------------------------------------–> +%<---------------------------- Draw --------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolygon{\pgfutil@ifnextchar[{\tkz@DrawPolygon}{% + \tkz@DrawPolygon[]}} +\def\tkz@DrawPolygon[#1](#2,#3){% + \begingroup + \draw[line style,line join=round,#1] (#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle;% + \endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@multipolygons#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzDrawPolygon[\tkz@optpolygon](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolygons{\pgfutil@ifnextchar[{\tkz@DrawPolygons}{\tkz@DrawPolygons[]}} +\def\tkz@DrawPolygons[#1](#2){% +\xdef\tkz@optpolygon{#1} +\begingroup + \let\next\tkz@multipolygons + \next#2 \@nil % +\endgroup +}% +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +%<---------------------------- FILL --------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzFillPolygon{\pgfutil@ifnextchar[{\tkz@FillPolygon}{% + \tkz@FillPolygon[]}} +\def\tkz@FillPolygon[#1](#2,#3){% + \begingroup + \fill[#1] (#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle;% +\endgroup +} +%<--------------------------------------------------------------------------–> +%<-------------- Labels for Regular Polygon -------------------------–> +% +%<--------------------------------------------------------------------------–> +\pgfkeys{/deflabelregpoly/.cd, + name/.store in = \tkz@regpolname, + sep/.store in = \tkz@regpolsep, + name = P, + sep = 1.1 +} + +\def\tkzLabelRegPolygon{\pgfutil@ifnextchar[{\tkz@labelPolygon}{% + \tkz@labelPolygon[]}} +\def\tkz@labelPolygon[#1](#2)#3{% +\begingroup +\pgfqkeys{/deflabelregpoly}{#1} + \foreach \v [count=\vi from 1] in {#3} {% + \path (#2) to [pos=1.1] node {$\v$} (\tkz@regpolname\vi) ; + \pgfnodealias{\v}{\tkz@regpolname\vi} + } +\endgroup +} +%<---------------------------- CLIP --------------------------------–> +% +%<--------------------------------------------------------------------------–> + +\pgfkeys{tkzclippolygon/.cd, + out code/.is if = tkzClipOutPoly, + out/.code = \tkzClipOutPolyfalse} + +\def\tkzClipPolygon{\pgfutil@ifnextchar[{\tkz@ClipPolygon}{\tkz@ClipPolygon[]}} +\def\tkz@ClipPolygon[#1](#2,#3){% +\tkzClipOutPolytrue +\pgfqkeys{/tkzclippolygon}{#1}% +\iftkzClipOutPoly +\clip (#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle; +\else + \clip(#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle[tkzreverseclip] ; +\fi +}% +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex new file mode 100644 index 0000000000..fb995eead7 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex @@ -0,0 +1,121 @@ +% tkz-obj-eu-protractor.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-protractor.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% !!! idea from Y. Combe !!! +%<--------------------------------------------------------------------------–> +% \tkzProtractor Protractor +% +% Rapporteur ajustable et positionable +% +% Par défaut: +% centre en (0,0) +% rayon de 5 cm +% ligne de base horizontale. +% épaisseur de ligne 0.4 pt +% +% Paramètres (optionnels, gérés par xkeyval) +% shift : coordonées (n'importe quelle forme +% acceptée par tikz). +% scale : facteur d'échelle +% rotate : rotation +% lw : line width (épaisseur des lignes) +% ce paramètre subit le facteur d'échelle. +%<--------------------------------------------------------------------------–> +\def\FullProtractor{% +\draw[fill=black!50!yellow!20!,even odd rule,semitransparent]% + (0,0) circle (4cm); +\draw (0,0) circle (3.3cm); +\draw (0,0) circle (4cm); +\draw[fill=black] (0,0) circle (.08mm); +\node[draw, circle, inner sep=.2mm] (a) at (0,0) {}; +\foreach \x in {0, 90, ..., 360}{% + \draw[very thin, gray!40] (a) -- (\x:4cm);} +\foreach \x in {0,...,359} {\draw (\x:3.8cm) -- (\x:4cm);} +\foreach \x in {0,5,...,355} {\draw (\x:3.725cm) -- (\x:4cm);} +\foreach \x in {0,10,...,350}{% + \node[rotate=(\x-90)] at (\x:3.6cm) {\tiny\x}; +} + \draw [>=stealth',->, thick,black] (0:2.5) arc(0:32:2.5); + \draw [>=stealth',->, thick,black] (0:2) arc(0:32:2); + \draw [>=stealth',->, thick,black] (0:1.5) arc(0:32:1.5); +} + +\def\FullProtractorReturn{% +\draw[fill=black!50!yellow!20!,even odd rule,semitransparent] (0,0) circle (4cm); +\draw (0,0) circle (3.3cm); +\draw (0,0) circle (4cm); +\draw[fill=black] (0,0) circle (.08mm); +\node[draw, circle, inner sep=.2mm] (a) at (0,0) {}; +\foreach \x in {0, 90, ..., 360}{% + \draw[very thin, gray!40] (a) -- (\x:4cm);} +\foreach \x in {0,...,359} {\draw (\x:3.8cm) -- (\x:4cm);} +\foreach \x in {0,5,...,355} {\draw (\x:3.725cm) -- (\x:4cm);} +\begin{scope} + \foreach \x in {0,10,...,350}{% + \node[rotate=(-\x-90)] at (-\x:3.6cm) {\tiny\x}; +} + \end{scope} + \draw [>=stealth',->, thick,black] (0:2.5) arc(0:-32:2.5); + \draw [>=stealth',->, thick,black] (0:2) arc(0:-32:2); + \draw [>=stealth',->, thick,black] (0:1.5) arc(0:-32:1.5); +} + +\pgfkeys{ + protractor/.cd, + lw/.code = {\def\cmdMO@Rap@lw{#1}}, + shift/.code = {\def\cmdMO@Rap@shift{#1}}, + rotate/.code = {\def\cmdMO@Rap@rotate{#1}}, + scale/.code = {\def\cmdMO@Rap@scale{#1}}, + return/.is if = tkz@RappReturn, + return/.code = \tkz@RappReturnfalse, + /protractor/.search also={/tikz}, + lw = 0.4pt, + scale=1, + shift={(0,0)}, + rotate=0 + } + +\def\tkzProtractor{\pgfutil@ifnextchar[{\tkz@Protractor}{\tkz@Protractor[]}} +\def\tkz@Protractor[#1](#2,#3){% +\tkz@RappReturnfalse +\pgfqkeys{/protractor}{#1} + \tkz@@extractxy{#2} + \global\tkz@ax\pgf@x + \global\tkz@ay\pgf@y + \tkzFindSlopeAngle(#2,#3) + \tkzGetAngle{cmdMO@Rap@rotate}% + \global\let\tkz@@Protractor\FullProtractor% + \iftkz@RappReturn + \global\let\tkz@@Protractor\FullProtractorReturn + \else + \global\let\tkz@@Protractor\FullProtractor + \fi + \pgfmathsetlengthmacro{\MO@lw}{\cmdMO@Rap@lw * \cmdMO@Rap@scale} + \begin{scope}[shift = {(\tkz@ax,\tkz@ay)},% + scale = \cmdMO@Rap@scale,% + rotate = \cmdMO@Rap@rotate,% + every node/.style = {scale =\cmdMO@Rap@scale, + rotate =\cmdMO@Rap@rotate},% + line width=\MO@lw]% + \tkz@@Protractor +\end{scope} +} +%<--------------------------------------------------------------------------–> +% fin de \tkzProtractor +%<--------------------------------------------------------------------------–> +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex new file mode 100644 index 0000000000..685ee59242 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex @@ -0,0 +1,326 @@ +% tkz-obj-eu-sectors.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-sectors.tex} +\makeatletter +%<----------------------- Sectors ------------------------------–> +\gdef\tkz@nums{0} +\pgfkeys{/drawsector/.cd, + towards/.code = {\def\tkz@nums{0}}, + rotate/.code = {\def\tkz@nums{1}}, + R/.code = {\def\tkz@nums{2}}, + R with nodes/.code = {\def\tkz@nums{3}}, + towards, + /drawsector/.search also = {/tikz}, +} + +\def\tkzDrawSector{\pgfutil@ifnextchar[{\tkz@DrawSector}{\tkz@DrawSector[]}} +\def\tkz@DrawSector[#1](#2,#3)(#4){% +\begingroup +\pgfqkeys{/drawsector}{#1} +\ifcase\tkz@nums% + \tkzDrawSectorN[#1](#2,#3)(#4) +\or% 1 + \tkzDrawSectorRotate[#1](#2,#3)(#4) +\or% 2 + \tkzDrawSectorRAngles[#1](#2,#3)(#4) +\or% 3 + \tkzDrawSectorR[#1](#2,#3)(#4) +\fi +\endgroup +} +\def\tkzDrawSectorRAngles{\pgfutil@ifnextchar[{\tkz@DrawSectorRAngles}{% + \tkz@DrawSectorRAngles[]}} +\def\tkz@DrawSectorRAngles[#1](#2,#3)(#4,#5){% +\begingroup + \pgfmathparse{#4}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#5}\edef\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} + \edef\tkz@FirstAngle{\pgfmathresult}% + \fi + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi + \fi + \draw[shift = {(#2)},/drawsector/.cd,#1]% + (#2) --(\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3)--cycle; + \endgroup + } % revoir il y a plus simple que ce shift !!! +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorN(O,A)(B) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorN{\pgfutil@ifnextchar[{\tkz@DrawSectorN}{% + \tkz@DrawSectorN[]}} +\def\tkz@DrawSectorN[#1](#2,#3)(#4){% +\begingroup + \tkz@@CalcLengthcm(#2,#3){tkz@radius} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius)(\tkz@FirstAngle,% + \tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorRotate(O,A)(angle de rotation) ??? pb avec angle negatif +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorRotate{\pgfutil@ifnextchar[{\tkz@DrawSectorRotate}{% + \tkz@DrawSectorRotate[]}} +\def\tkz@DrawSectorRotate[#1](#2,#3)(#4){% +\begingroup + \tkz@@CalcLengthcm(#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@DrawSectorRAngles[#1](#2,\tkz@radius)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius)(\tkz@SecondA,\tkz@FirstA) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorAngles(O,A)(ang1,ang2) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorAngles{\pgfutil@ifnextchar[{\tkz@DrawSectorAngles}{% + \tkz@DrawSectorAngles[]}} +\def\tkz@DrawSectorAngles[#1](#2,#3)(#4,#5){% +\begingroup + \tkz@@CalcLengthcm(#2,#3){tkz@radius} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(#4,#5) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorRwithNodesAngles(O,A,B)(ang1,ang2) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorRwithNodesAngles{\pgfutil@ifnextchar[{% + \tkz@DrawSectorRwithNodesAngles}{% + \tkz@DrawSectorRwithNodesAngles[]}} +\def\tkz@DrawSectorRwithNodesAngles[#1](#2,#3,#4)(#5,#6){% +\begingroup + \tkz@@CalcLengthcm(#3,#4){tkz@radius} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(#5,#6) +\endgroup +} +% %<--------------------------------------------------------------------------–> + +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorR(O, rad)(A,B) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorR{\pgfutil@ifnextchar[{\tkz@DrawSectorR}{% + \tkz@DrawSectorR[]}} +\def\tkz@DrawSectorR[#1](#2,#3)(#4,#5){% +\begingroup + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawSectorRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Fill +%<--------------------------------------------------------------------------–> +\gdef\tkz@nums{0} +\pgfkeys{/@fillsector/.cd, + towards/.code = {\def\tkz@nums{0}}, + rotate/.code = {\def\tkz@nums{1}}, + R/.code = {\def\tkz@nums{2}}, + R with nodes/.code = {\def\tkz@nums{3}}, + towards, + /@fillsector/.search also={/tikz}, +} + +\def\tkzFillSector{\pgfutil@ifnextchar[{\tkz@FillSector}{\tkz@FillSector[]}} +\def\tkz@FillSector[#1](#2,#3)(#4){% +\begingroup +\pgfqkeys{/@fillsector}{#1} +\ifcase\tkz@nums% + \tkzFillSectorN[#1](#2,#3)(#4) +\or% 1 + \tkzFillSectorRotate[#1](#2,#3)(#4) +\or% 2 + \tkzFillSectorRAngles[#1](#2,#3)(#4) +\or% 3 + \tkzFillSectorR[#1](#2,#3)(#4) +\fi +\endgroup +} + + +\def\tkzFillSectorRAngles{\pgfutil@ifnextchar[{\tkz@FillSectorRAngles}{% + \tkz@FillSectorRAngles[]}} +\def\tkz@FillSectorRAngles[#1](#2,#3)(#4,#5){% +\begingroup + \pgfmathparse{#4}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#5}\edef\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} + \edef\tkz@FirstAngle{\pgfmathresult}% + \fi + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi\fi + \pgfmathsubtract{\tkz@FirstAngle}{0} + \edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathadd{\tkz@SecondAngle}{0} + \edef\tkz@SecondAngle{\pgfmathresult} + \path[shift = {(#2)},/@fillsector/.cd,fill=\tkz@fillcolor,#1] (#2) -- % + (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3)--cycle; +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorN(O,A)(B) +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorN{\pgfutil@ifnextchar[{\tkz@FillSectorN}{\tkz@FillSectorN[]}} +\def\tkz@FillSectorN[#1](#2,#3)(#4){% +\begingroup + \tkz@@CalcLength(#2,#3){tkz@radius} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} + \tkz@FillSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstAngle,% + \tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorRotate(O,A)(angle de rotation) ??? pb avec angle negatif +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorRotate{\pgfutil@ifnextchar[{\tkz@FillSectorRotate}{% + \tkz@FillSectorRotate[]}} +\def\tkz@FillSectorRotate[#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@FillSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@FillSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \fi + \endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorAngles(O,A)(ang1,ang2) +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorAngles{\pgfutil@ifnextchar[{\tkz@FillSectorAngles}{% + \tkz@FillSectorAngles[]}} +\def\tkz@FillSectorAngles[#1](#2,#3)(#4,#5){% +\begingroup + \tkz@@CalcLength(#2,#3){tkz@radius} + \tkz@FillSectorRAngles[#1](#2,\tkz@radius pt)(#4,#5) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorR(O, rad)(A,B) +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorR{\pgfutil@ifnextchar[{\tkz@FillSectorR}{% + \tkz@FillSectorR[]}} +\def\tkz@FillSectorR[#1](#2,#3)(#4,#5){% +\begingroup + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} + \tkz@FillSectorRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------- Clip Sector ----------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkz@ClipSectorRAngles(#1,#2)(#3,#4){% +\begingroup + \pgfmathparse{#3}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#4}\edef\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} + \edef\tkz@FirstAngle{\pgfmathresult}% + \fi + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi + \fi + \clip[shift = {(#1)}] (#1) --(\tkz@FirstAngle:#2)% + arc(\tkz@FirstAngle:\tkz@SecondAngle:#2) -- cycle; + \endgroup + } % revoir il y a plus simple que ce shift !!! +%<--------------------------------------------------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkz@ClipSectorRotate(#1,#2)(#3){% +\begingroup + \tkz@@CalcLength(#1,#2){tkz@radius} + \tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstA} + \pgfmathadd{\tkz@FirstA}{#3} + \edef\tkz@SecondA{\pgfmathresult} + \pgfmathgreaterthan{#3}{0} + \ifdim\pgfmathresult pt=1 pt\relax% + \tkz@ClipSectorRAngles(#1,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@ClipSectorRAngles(#1,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \fi + \endgroup +} +%<--------------------------------------------------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkz@ClipSectorN(#1,#2)(#3){% +\begingroup + \tkz@@CalcLength(#1,#2){tkz@radius} + \tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#1,#3)\tkzGetAngle{tkz@SecondAngle} + \tkz@ClipSectorRAngles(#1,\tkz@radius pt)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkz@numcs{0} +\pgfkeys{/clipsector/.cd, + towards/.code = {\def\tkz@numcs{0}}, + rotate/.code = {\def\tkz@numcs{1}}, + R/.code = {\def\tkz@numcs{2}}, +} +%<--------------------------------------------------------------------------–> +\def\tkzClipSector{\pgfutil@ifnextchar[{\tkz@ClipSector}{% + \tkz@ClipSector[]}} + +\def\tkz@ClipSector[#1](#2,#3)(#4){% +\pgfkeys{/clipsector/.cd} +\pgfqkeys{/clipsector}{#1} +\ifcase\tkz@numcs% + \tkz@ClipSectorN(#2,#3)(#4) + \or% 1 + \tkz@ClipSectorRotate(#2,#3)(#4) + \or% 2 + \tkz@ClipSectorRAngles(#2,#3)(#4) + \fi +} +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex new file mode 100644 index 0000000000..2f5d97bc98 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex @@ -0,0 +1,347 @@ +%tkz-obj-eu-show.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-eu-show.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% finding specific points in a triangle +%<--------------------------------------------------------------------------–> +% equi points +%<--------------------------------------------------------------------------–> +% draw ? show ? +\pgfkeys{/tkzEquiPt/.cd, + from/.store in = {\tkz@frompoint}, + dist/.store in = {\tkz@equ@dist}, + show/.is if = tkz@equi@show, + dist = 2, + show = false, + /tkzEquiPt/.search also={/tikz} +} + +\def\tkzDefEquiPoints{\pgfutil@ifnextchar[{\tkz@DefEquiPoints}{% + \tkz@DefEquiPoints[]}} +\def\tkz@DefEquiPoints[#1](#2,#3){% +\pgfqkeys{/tkzEquiPt}{#1} +\begingroup + \tkzUProjection(#2,#3)(\tkz@frompoint) + \pgfnodealias{tkzEQpoint}{tkzPointResult} + \tkzVecKNorm[\tkz@equ@dist](tkzEQpoint,#2) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzVecKNorm[-\tkz@equ@dist](tkzEQpoint,#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \iftkz@equi@show + \tkzCompass[compass style,#1](\tkz@frompoint,tkzFirstPointResult) + \tkzCompass[compass style,#1](\tkz@frompoint,tkzSecondPointResult) + \fi +\endgroup +} + +%<--------------------------- The SHOW --------------------------------–> +%<--------------------------------------------------------------------------–> +\global\def\tkz@numsh{0} +\pgfkeys{/show/.cd, + mediator/.code = \def\tkz@numsh{0}, + perpendicular/.code args = {through #1} {\global\def\tkz@numsh{1}% + \def\tkz@through{#1}}, + orthogonal/.code args = {through #1} {\global\def\tkz@numsh{1}% + \global\def\tkz@through{#1}}, + parallel/.code args = {through #1} {\global\def\tkz@numsh{2}% + \global\def\tkz@through{#1}}, + bisector/.code = \global\def\tkz@numsh{3}, + K/.code = \def\tkz@koeff{#1}, + length/.code = \def\tkz@show@length{#1}, + ratio/.code = \def\tkz@show@ratio{#1}, + gap/.code = \def\tkz@show@gap{#1}, + size/.code = \def\tkz@show@size{#1}, + /show/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tkzcompass/\searchname/.retry=#1, + /tikz/\searchname/.retry=#1}% + } + } +\def\tkzShowLine{\pgfutil@ifnextchar[{\tkz@ShowLine}{\tkz@ShowLine[]}} +\def\tkz@ShowLine[#1](#2){% +\begingroup +\pgfqkeys{/show}{ K = 1, + gap = 2, + ratio = .5, + length = 1, + size = 1 + } +\pgfqkeys{/show}{#1} +\ifcase\tkz@numsh% + % first case 0 + \tkzShowMediatorLine[#1](#2) + \or% 1 + \tkzShowOrthLine[#1](#2)(\tkz@through) + \or% 2 + \tkzShowLLLine[#1](#2)(\tkz@through) + \or% 3 + \tkzShowBisectorLine[#1](#2) +\fi +\endgroup +} + +\def\tkzShowMediatorLine{% + \pgfutil@ifnextchar[{\tkz@ShowMediatorLine}{\tkz@ShowMediatorLine[]}} +\def\tkz@ShowMediatorLine[#1](#2,#3){% +\begingroup +\pgfkeys{show/.cd, gap = 2, + ratio = .5, + length = 1 + } +\pgfkeys{show/.cd,#1} + \path (#2) -- (#3) coordinate[pos=.5](tkzmidpoint); + \tkzURotateAngle(#2,60)(#3) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzURotateAngle(#3,60)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkz@VecKOrthNorm[1](tkzmidpoint,#2) + \pgfnodealias{MED@tmp1}{tkzPointResult} + \tkz@VecKOrthNorm[1](tkzmidpoint,#3) + \pgfnodealias{MED@tmp2}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp1) + \pgfnodealias{MED@1}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp2) + \pgfnodealias{MED@2}{tkzPointResult} + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@1) + \tkzCompass[compass style,#1](#3,MED@1) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@2) + \tkzCompass[compass style,#1](#3,MED@2) +\endgroup +} + +\def\tkzShowLLLine{\pgfutil@ifnextchar[{\tkz@ShowLLLine}{\tkz@ShowLLLine[]}} +\def\tkz@ShowLLLine[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{show/.cd,gap=2,ratio=.75,length=1} +\pgfkeys{show/.cd,#1} + \tkz@VecKCoLinear[1](#2,#3,#4) + \pgfnodealias{tkz@lltmp}{tkzPointResult} + \tkzCompass[compass style,#1](#4,tkz@lltmp) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#3,tkz@lltmp) +\endgroup +} + +%<--------------------------------------------------------------------------–> +% tkzLineOrth +%<--------------------------------------------------------------------------–> +% pas de projection ortho car le point peut être sur la droite. +% manque les tests . Il faudrait voir si on peut projeter et choisir +\def\tkzShowOrthLine{\pgfutil@ifnextchar[{\tkz@ShowOrthLine}{\tkz@ShowOrthLine[]}} +\def\tkz@ShowOrthLine[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{show/.cd, + ratio = .75, + length = 1, + gap = -1, + size = 1} +\pgfkeys{show/.cd,#1} + \tkzDefPointWith(#2,#3) + \pgfnodealias{tkz@OLtmp}{tkzPointResult} + \tkz@VecKCoLinear[1](#2,tkz@OLtmp,#4) + \pgfnodealias{tkzPointCo}{tkzPointResult} + \tkzInterLL(#2,#3)(#4,tkzPointCo) + \pgfnodealias{tkzPOpoint}{tkzPointResult} + \tkz@@CalcLength(#4,tkzPOpoint){tkz@mathLen} + \tkz@VecKNorm[1](#2,#3) + \pgfnodealias{PO@tmp}{tkzPointResult} + \tkz@VecKCoLinear[1](#2,PO@tmp,tkzPOpoint) + \pgfnodealias{PO@tmp2}{tkzPointResult} + \tkz@VecKCoLinear[-1](#2,PO@tmp,tkzPOpoint) + \pgfnodealias{PO@tmp1}{tkzPointResult} + \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp1,tkzPOpoint) + \pgfnodealias{PO@1}{tkzPointResult} + \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp2,tkzPOpoint) + \pgfnodealias{PO@2}{tkzPointResult} + \ifdim\tkz@mathLen pt>10 pt\relax + \tkz@VecKNorm[1](#4,tkzPOpoint) + \pgfnodealias{PO@tmp1}{tkzPointResult} + \else + \tkz@VecKOrthNorm[1](tkzPOpoint,PO@2) + \pgfnodealias{PO@tmp1}{tkzPointResult} + \fi + \tkz@VecKCoLinear[-\tkz@show@gap](PO@tmp1,tkzPOpoint,tkzPOpoint) + \pgfnodealias{PO@3}{tkzPointResult} + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@1) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@2) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](PO@1,PO@3) + \tkzCompass[compass style,#1,length=\tkz@show@length](PO@2,PO@3) +\endgroup +} +%<-------------------------------------------------------------------------–> +% bisector Line +%<-------------------------------------------------------------------------–> +\def\tkzShowBisectorLine{% + \pgfutil@ifnextchar[{\tkz@ShowBisectorLine}{\tkz@ShowBisectorLine[]}} +\def\tkz@ShowBisectorLine[#1](#2,#3,#4){% +\begingroup +\pgfkeys{show/.cd, gap = 2, + ratio =. 5, + length = 1, + size = 1 + } +\pgfkeys{show/.cd,#1} + \tkzVecKNorm(#3,#2) + \pgfnodealias{tkz@pt1}{tkzPointResult} + \tkzVecKNorm(#3,#4) + \pgfnodealias{tkz@pt2}{tkzPointResult} + \tkzDefMidPoint(tkz@pt1,tkz@pt2) + \pgfnodealias{tkz@pt3}{tkzPointResult} + \tkzDefEquilateral(tkz@pt2,tkz@pt1) + \pgfnodealias{tkz@pt4}{tkzPointResult} + \tkzDefMidPoint(tkz@pt3,tkz@pt4) + \pgfnodealias{tkz@ptm}{tkzPointResult} + \tkzVecKNorm(#3,tkz@ptm) + \pgfnodealias{tkzBisPoint}{tkzPointResult} + \tkzVecKNorm[\tkz@show@size](#3,#2) + \pgfnodealias{BI@1}{tkzPointResult} + \tkzVecKNorm[\tkz@show@size](#3,#4) + \pgfnodealias{BI@2}{tkzPointResult} + \tkzVecK[\tkz@show@gap](#3,tkzBisPoint) + \pgfnodealias{tkzBisPoint}{tkzPointResult} + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@1) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@2) + \tkzCompass[compass style,#1,length=\tkz@show@length](BI@1,tkzBisPoint) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](BI@2,tkzBisPoint) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Transformations Géométriques +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% The SHOW +%<--------------------------------------------------------------------------–> +\def\tkz@numst{0} +\pgfkeys{/showtsf/.cd, + reflection/.code args={over #1--#2}{% + \def\tkzdeb{#1} + \def\tkzfin{#2} + \def\tkz@numst{0}}, + symmetry/.code args={center #1}{% + \def\tkzcenter{#1} + \def\tkz@numst{1}}, + projection/.code args={onto #1--#2}{% + \def\tkzdeb{#1} + \def\tkzfin{#2} + \def\tkz@numst{2}}, +translation/.code args={from #1 to #2}{% + \def\tkzfrom{#1}% + \def\tkzto{#2}% + \def\tkz@numst{3}}, + K/.code = \def\tkz@koeff{#1}, + length/.code = \def\tkz@show@length{#1}, + ratio/.code = \def\tkz@show@ratio{#1}, + gap/.code = \def\tkz@show@gap{#1}, + size/.code = \def\tkz@show@size{#1}, +/showtsf/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tkzcompass/\searchname/.retry=#1, + /tikz/\searchname/.retry=#1}} +} +%<--------------------------------------------------------------------------–> +\def\tkzShowTransformation{\pgfutil@ifnextchar[{\tkz@ShowTransformation}{% + \tkz@ShowTransformation[]}} +\def\tkz@ShowTransformation[#1](#2){% +\begingroup + \pgfqkeys{/showtsf}{K=1,gap=2,size=1,ratio=.5,length=1} + \pgfqkeys{/showtsf}{#1} + \pgfinterruptboundingbox +\ifcase\tkz@numst% + % first case 0 + \tkzShowSymOrth[#1](\tkzdeb,\tkzfin)(#2) + \or% 1 + \tkzShowCSym[#1](\tkzcenter)(#2) + \or% 2 + \tkzShowProjection[#1](\tkzdeb,\tkzfin)(#2) + \or% 3 + \tkzShowTranslation[#1](\tkzfrom,\tkzto)(#2) + \fi + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzShowTranslation{\pgfutil@ifnextchar[{\tkz@ShowTranslation}{% + \tkz@ShowTranslation[]}} + +\def\tkz@ShowTranslation[#1](#2,#3)(#4){% +\begingroup +\tkz@VecKCoLinear[1](#2,#3,#4) \pgfnodealias{tkz@lltmp}{tkzPointResult} +\tkzCompass[compass style,#1](#4,tkz@lltmp) +\tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#3,tkz@lltmp) +\endgroup} +%<--------------------------------------------------------------------------–> +\def\tkzShowSymOrth{\pgfutil@ifnextchar[{\tkz@ShowSymOrth}{% + \tkz@ShowSymOrth[]}} +\def\tkz@ShowSymOrth[#1](#2,#3)(#4){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate](#4)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#2,#3)(#4,tkz@point) + \pgfnodealias{tkzPointofSym}{tkzPointResult} + \tkz@VecK[2](#4,tkzPointofSym) + \pgfnodealias{tkz@pointtsf}{tkzPointResult} + \tkzCompass[compass style,#1](#2,#4) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#3,#4) + \tkzCompass[compass style,#1](#2,tkz@pointtsf) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#3,tkz@pointtsf) +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzShowCSym{\pgfutil@ifnextchar[{\tkz@ShowCSym}{\tkz@ShowCSym[]}} + +\def\tkz@ShowCSym[#1](#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% +\path[coordinate](#2)--++(-\tkz@ax,-\tkz@ay) coordinate (tkz@pointtsf); + \tkzCompass[compass style,#1](#2,tkz@pointtsf) + \tkzCompass[compass style,#1](#2,#3) +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzShowProjection{\pgfutil@ifnextchar[{\tkz@ShowProjection}{% + \tkz@ShowProjection[]}} +\def\tkz@ShowProjection[#1](#2,#3)(#4){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate](#4)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#2,#3)(#4,tkz@point) + \pgfnodealias{tkz@pointtsf}{tkzPointResult} + \tkz@VecKCoLinear[1](#2,#3,tkz@pointtsf) + \pgfnodealias{SO@tmp1}{tkzPointResult} + \tkz@VecKCoLinear[-1](#2,#3,tkz@pointtsf) + \pgfnodealias{SO@tmp2}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp1) + \pgfnodealias{SO@1}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp2) + \pgfnodealias{SO@2}{tkzPointResult} + \tkz@VecKNorm[-\tkz@show@gap](tkz@pointtsf,#4) + \pgfnodealias{SO@3}{tkzPointResult} + \tkzCompass[compass style,#1](#4,SO@1) + \tkzCompass[compass style,#1](#4,SO@2) + \tkzCompass[compass style,#1](SO@1,SO@3) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](SO@2,SO@3) +\endgroup +} +\makeatother +\endinput
\ No newline at end of file |