summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex')
-rw-r--r--Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex135
1 files changed, 61 insertions, 74 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex
index 8d340ba99d3..99d35310678 100644
--- a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex
+++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-circles.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-draw-circles.tex
-% Copyright 2020 Alain Matthes
+% Copyright 2022 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.
@@ -7,43 +7,14 @@
% 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.
-% utf8 encoding
-\def\fileversion{3.06c}
-\def\filedate{2020/03/18}
-\typeout{2020/03/18 3.06c tkz-obj-eu-draw-circles.tex}
+\def\fileversion{4.00}
+\def\filedate{2022/01/04}
+\typeout{2022/01/04 4.00 tkz-obj-eu-draw-circles.tex}
\makeatletter
-%for compatibility
-%<--------------------------------------------------------------------------–>
-\def\tkzDefCircleR(#1,#2){%
-\begingroup
- \edef\tkzLengthResult{\fpeval{round(#2,5)}}
- \global\let\tkzLengthResult\tkzLengthResult
- \tkzRenamePoint(#1){tkzPointResult}
-\endgroup
-}
-%<--------------------------------------------------------------------------–>
-% Through Circle center and point
-%<--------------------------------------------------------------------------–>
-\def\tkzDefCircleThrough(#1,#2){%
-\begingroup
- \tkzCalcLength(#1,#2)
- \tkzRenamePoint(#1){tkzPointResult}
-\endgroup
-}
-%<--------------------------------------------------------------------------–>
-% Diameter Circle
-%<--------------------------------------------------------------------------–>
-\def\tkzDefCircleD(#1,#2){%
-\begingroup
- \tkzDefMidPoint(#1,#2)
- \tkzCalcLength(#1,tkzPointResult)
-\endgroup
-}
+
\def\tkz@numdc{0}
\pgfkeys{/tkzdrawc/.cd,
@@ -75,13 +46,13 @@
\begingroup
\pgfqkeys{/tkzdrawc}{#1}
\ifcase\tkz@numdc%
- \tkzDefCircleThrough(#2)
+ \tkzDefCircleThrough(#2)
\or% 1
- \tkzDefCircleR(#2)
+ \tkzDefCircleR(#2)
\or% 2
- \tkzDefCircleD(#2)
+ \tkzDefCircleD(#2)
\or% 3
- \tkzDefCircumCircle(#2)
+ \tkzDefCircumCircle(#2)
\or% 4
\tkzDefInCircle(#2)
\or% 4
@@ -95,8 +66,7 @@
\or% 8
\tkzDefOrthoThroughCircle(#2,\tkz@ptone,\tkz@pttwo)
\fi
- \draw[line style,/tkzdrawc/.cd,#1]
- (tkzPointResult) circle (\tkzLengthResult pt);
+ \draw[line style,/tkzdrawc/.cd,#1] (tkzPointResult) circle (\tkzLengthResult);
\endgroup
}
@@ -126,11 +96,11 @@
\pgfkeys{/tkzdrawsc/.cd,
through/.code = \def\tkz@numdsc{0},
diameter/.code = \def\tkz@numdsc{1},
- swap/.is if = tkz@sawp@sc,
+ swap/.is if = tkz@swap@sc,
swap/.default = true,
swap = false,
through,
- /tkzdrawsc/.search also={/tikz}
+ /tkzdrawsc/.search also={/tikz}
}
\def\tkzDrawSemiCircle{\pgfutil@ifnextchar[{\tkz@DrawSemiCircle}{%
\tkz@DrawSemiCircle[]}}
@@ -142,19 +112,19 @@
\or%
\tkzDrawSemiCircleDiameter(#2)
\fi
- \tkzDrawArc[#1](\tkz@Center,\tkz@FirstPoint)(\tkz@SecondPoint)
+ \tkzDrawArc[#1,delta=0](\tkz@Center,\tkz@FirstPoint)(\tkz@SecondPoint)
\endgroup
}
%<--------------------------------------------------------------------------–>
\def\tkzDrawSemiCircleThrough(#1,#2){%
\tkzDefPointBy[symmetry=center #1](#2)
- \pgfnodealias{tkz@pt}{tkzPointResult}
+ \pgfnodealias{tkz@pt}{tkzPointResult}
\def\tkz@Center{#1}
- \iftkz@sawp@sc
- \gdef\tkz@FirstPoint{tkz@pt}
+ \iftkz@swap@sc
+ \gdef\tkz@FirstPoint{tkz@pt}
\gdef\tkz@SecondPoint{#2}
\else
- \gdef\tkz@FirstPoint{#2}
+ \gdef\tkz@FirstPoint{#2}
\gdef\tkz@SecondPoint{tkz@pt}
\fi
}
@@ -163,7 +133,7 @@
\tkzDefMidPoint(#1,#2)
\pgfnodealias{tkz@Center}{tkzPointResult}
\def\tkz@Center{tkz@Center}
- \iftkz@sawp@sc
+ \iftkz@swap@sc
\def\tkz@FirstPoint{#1}
\def\tkz@SecondPoint{#2}
\else
@@ -171,11 +141,33 @@
\def\tkz@SecondPoint{#1}
\fi
}
-
+%<--------------------------------------------------------------------------–>
+\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\tkz@numfc{0}
\pgfkeys{/fillcircle/.cd, radius/.code = \def\tkz@numfc{0},
- R/.code = \def\tkz@numfc{1},
+ R/.code = \def\tkz@numfc{1},
radius,
/fillcircle/.search also={/tikz}
}
@@ -185,46 +177,42 @@
\pgfqkeys{/fillcircle}{#1}
\ifcase\tkz@numfc%
% first case 0
- \tkzCalcLength(#2,#3)
+ \tkz@@CalcLength(#2,#3){tkzLengthResult}
\fill[/fillcircle/.cd,#1] (#2) circle (\tkzLengthResult pt);%
\or% 1
\fill[/fillcircle/.cd,#1] (#2) circle (#3);%
\fi
\endgroup
}
-%<----------------------- Out Clip Circle ---------------------------------–>
-\def\tkz@numocc{0}
-\pgfkeys{/clipoutcircle/.cd, radius/.code = \def\tkz@numocc{0},
- R/.code = \def\tkz@numocc{1},
- radius}
-%<--------------------------------------------------------------------------–>
-\def\tkzClipOutCircle{\pgfutil@ifnextchar[{\tkz@ClipOutCircle}{%
- \tkz@ClipOutCircle[]}}
-\def\tkz@ClipOutCircle[#1](#2,#3){%
-\pgfqkeys{/clipoutcircle}{#1}
-\ifcase\tkz@numocc
- \tkzCalcLength(#2,#3)
- \clip[tkzreverseclip] (#2) circle (\tkzLengthResult pt);
- \or% 1
- \clip[tkzreverseclip] (#2) circle (#3);
- \fi
-}
+
%<--------------------------- Clip Circle ---------------------------------–>
+\newif\iftkzClipOutCircle
\def\tkz@numcc{0}
\pgfkeys{/tkzclipc/.cd,
- through/.code = \def\tkz@numcc{0},
- R/.code = \def\tkz@numcc{1},
+ through/.code = \def\tkz@numcoc{0},
+ R/.code = \def\tkz@numcoc{1},
+ out code/.is if = tkzClipOutCircle,
+ out/.code = \tkzClipOutCirclefalse,
through}
%<--------------------------------------------------------------------------–>
\def\tkzClipCircle{\pgfutil@ifnextchar[{\tkz@ClipCircle}{\tkz@ClipCircle[]}}
\def\tkz@ClipCircle[#1](#2,#3){%
+\tkzClipOutCircletrue
\pgfqkeys{/tkzclipc}{#1}
-\ifcase\tkz@numcc
- \tkzCalcLength(#2,#3)
+\ifcase\tkz@numcoc
+ \tkz@@CalcLength(#2,#3){tkzLengthResult}
+ \iftkzClipOutCircle
\clip (#2) circle (\tkzLengthResult pt);
+ \else
+ \clip (#2) circle (\tkzLengthResult pt) [tkzreverseclip] ;
+ \fi
\or% 1
+ \iftkzClipOutCircle
\clip (#2) circle (#3);
+ \else
+ \clip (#2) circle (#3) [tkzreverseclip] ;
+ \fi
\fi
}
%<--------------------------- Label Circle --------------------------------–>
@@ -255,6 +243,5 @@
\fi
\endgroup
}
-%<--------------------------------------------------------------------------–>
- \makeatother
+\makeatother
\endinput \ No newline at end of file