summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-08 21:50:43 +0000
committerKarl Berry <karl@freefriends.org>2022-02-08 21:50:43 +0000
commite2c17c234c6f771a8184b3ed6ca58c92d3fbbdba (patch)
treec8b543fcf54e3098dc51eeb8da8de1a2f32bc79c /Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex
parentf2ca214be1bdabc702c43c320fae979a464bd2e6 (diff)
tkz-euclide (8feb22)
git-svn-id: svn://tug.org/texlive/trunk@61948 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex')
-rw-r--r--Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex157
1 files changed, 92 insertions, 65 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex
index fb1633937f1..74d351e2e41 100644
--- a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-eu-intersections.tex
+++ b/Master/texmf-dist/tex/latex/tkz-euclide/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