diff options
author | Norbert Preining <norbert@preining.info> | 2022-02-09 03:00:53 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-02-09 03:00:53 +0000 |
commit | 8363587176bd1746ab2d65ee183b196e6d3458cf (patch) | |
tree | 64a89e6416d2b23d149b3dd918af467ae0b7441a /macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex | |
parent | 98810f6d7d064e61186d0ce674c4ee9de47a1f55 (diff) |
CTAN sync 202202090300
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex')
-rw-r--r-- | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex | 157 |
1 files changed, 92 insertions, 65 deletions
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex index fb1633937f..74d351e2e4 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex @@ -13,9 +13,9 @@ % The Current Maintainer of this work is Alain Matthes. % utf8 encoding -\def\fileversion{4.03} -\def\filedate{2022/01/19} -\typeout{2022/01/19 4.03 tkz-tools-intersections.tex} +\def\fileversion{4.04} +\def\filedate{2022/01/22} +\typeout{2022/01/22 4.04 tkz-tools-intersections.tex} \makeatletter %<--------------------------------------------------------------------------–> % intersection de deux lignes @@ -127,28 +127,29 @@ \def\tkzTestInterLC(#1,#2)(#3,#4){% \tkz@Projection(#1,#2)(#3){tkz@pth}% distance centre à la ligne \tkz@@CalcLength(#3,tkz@pth){tkz@mathLen}% -\tkz@@CalcLength(#3,#4){tkzLengthResult} +\tkz@@CalcLength(#3,#4){tkzLengthResult}%calcul du rayon \ifdim\tkz@mathLen pt>\tkzLengthResult pt\relax% -\def\tkzflagLC{-1} +\tkzFlagLCfalse \else -\def\tkzflagLC{1} +\tkzFlagLCtrue \fi } %<--------------------------------------------------------------------------–> \def\tkz@numlc{0} \pgfkeys{/linecircle/.cd, - node/.code = \def\tkz@numlc{0}, - R/.code = \def\tkz@numlc{1}, - with nodes/.code = \def\tkz@numlc{2}, - common/.store in = \tkz@common, - common = {}, + node/.code = \def\tkz@numlc{0}, + R/.code = \def\tkz@numlc{1}, + with nodes/.code = \def\tkz@numlc{2}, + common/.store in = \tkz@common, + near/.store in = \tkz@near, + common = {}, + near = {}, node } %<--------------------------------------------------------------------------–> \def\tkzInterLC{\pgfutil@ifnextchar[{\tkz@InterLC}{\tkz@InterLC[]}} \def\tkz@InterLC[#1](#2,#3)(#4,#5){% \begingroup -\pgfkeys{linecircle/.cd} \pgfqkeys{/linecircle}{#1} \pgfinterruptboundingbox \ifcase\tkz@numlc% @@ -164,7 +165,8 @@ {tkzSecondPointResult}% \fi \ifx\tkz@common\tkzutil@empty - \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} + \ifx\tkz@near\tkzutil@empty + \tkzFindAngle(tkzSecondPointResult,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} \ifdim\tkz@an pt<180 pt\relax% \else \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} @@ -172,8 +174,18 @@ \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} \fi \else + \tkz@@CalcLength(#2,tkzFirstPointResult){tkzLengthFirst} + \tkz@@CalcLength(#2,tkzSecondPointResult){tkzLengthSecond} + \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi + \else \tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} - \ifdim\tkz@mathLen pt<0.05pt\relax% + \ifdim\tkz@mathLen pt<0.1pt\relax% \else \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} @@ -256,60 +268,10 @@ \tkzInterLCR(#1,#2)(#3,\tkz@radius pt){#6}{#7} \endgroup } - -%<--------------------------------------------------------------------------–> -% Intersection de deux cercles -%<--------------------------------------------------------------------------–> -\def\tkz@numcc{0} -\pgfkeys{ -/circlecircle/.cd, - node/.code = {\global\def\tkz@numcc{0}}, - R/.code = {\global\def\tkz@numcc{1}}, - with nodes/.code = {\global\def\tkz@numcc{2}}, - common/.store in = \tkz@common, - common = {}, -} %<--------------------------------------------------------------------------–> -\def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{\tkz@InterCC[]}} -\def\tkz@InterCC[#1](#2,#3)(#4,#5){% -\begingroup -\pgfkeys{/circlecircle/.cd,node} -\pgfqkeys{/circlecircle}{#1} -\ifcase\tkz@numcc% - % first case 0 - \tkz@save@length - \tkz@@CalcLengthcm(#2,#3){tkz@rayA} - \tkz@@CalcLengthcm(#4,#5){tkz@rayB} - \tkz@restore@length - \tkzInterCCR(#2,\tkz@rayA)(#4,\tkz@rayB){tkzFirstPointResult}{% - tkzSecondPointResult} - \or% 1 - \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% - \or%2 - \tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult} -\fi - \ifx\tkz@common\tkzutil@empty - \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} - \ifdim\tkz@an pt<180 pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \else -\tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} - \ifdim\tkz@mathLen pt<0.05pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \fi -\endgroup -} +% Intersection of 2 circles %<--------------------------------------------------------------------------–> %<--------------------------------------------------------------------------–> - % méthode % /* circle_circle_intersection() * % * Determine the points where 2 circles in a common plane intersect. @@ -385,6 +347,71 @@ % % return 1; % } +%<--------------------------------------------------------------------------–> +% Intersection de deux cercles +%<--------------------------------------------------------------------------–> +%<---------- test ------------------------------------------------------–> +% test avec des nodes +\def\tkzTestInterCC(#1,#2)(#3,#4){% +\tkz@@CalcLength(#1,#3){tkz@mathLen}% distance entre les centres +\tkz@@CalcLength(#2,#1){tkz@rA}%calcul du rayon +\tkz@@CalcLength(#4,#3){tkz@rB}%calcul du rayon +\edef\tkz@rS{\fpeval{\tkz@rA+\tkz@rB}} +\ifdim\tkz@mathLen pt > \tkz@rS pt\relax% +\tkzFlagCCfalse +\else +\tkzFlagCCtrue +\fi +} + +\def\tkz@numcc{0} +\pgfkeys{ +/circlecircle/.cd, + node/.code = \def\tkz@numcc{0}, + R/.code = \def\tkz@numcc{1}, + with nodes/.code = \def\tkz@numcc{2}, + common/.store in = \tkz@common, + common = {}, + node +} +%<--------------------------------------------------------------------------–> +\def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{\tkz@InterCC[]}} +\def\tkz@InterCC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/circlecircle}{#1} +\ifcase\tkz@numcc% + % first case 0 + \tkz@save@length + \tkz@@CalcLengthcm(#2,#3){tkz@rayA} + \tkz@@CalcLengthcm(#4,#5){tkz@rayB} + \tkz@restore@length + \tkzInterCCR(#2,\tkz@rayA)(#4,\tkz@rayB){tkzFirstPointResult}{% + tkzSecondPointResult} + \or% 1 + \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% + \or%2 + \tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult} +\fi + \ifx\tkz@common\tkzutil@empty + \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \else +\tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} + \ifdim\tkz@mathLen pt<0.05pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> \def\tkzInterCCR(#1,#2)(#3,#4)#5#6{% \begingroup |