Debian Codegraph @

texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-lua-circles-by.tex

raw
1 % tkz-obj-eu-circles.tex
2 % Copyright 2011-2026 Alain Matthes
3 % SPDX-License-Identifier: LPPL-1.3c
4 % Maintainer: Alain Matthes
5
6 \typeout{2026/01/25 5.13c tkz-obj-eu-circles-by.tex}
7 \makeatletter
8 %<--------------------------------------------------------------------------–>
9 % tkzCircle center and one point
10 %<--------------------------------------------------------------------------–>
11 % attention radius circle is defined by center and a point on the circle
12 % R defined by center and the value of the radius
13 % no need to define a circle with R tikz uses this method.
14 % through instead of radius
15 \def\tkz@numcby{0}
16 \pgfkeys{/tkzDefCircleBy/.cd,
17 translation/.code args = {from #1 to #2} { \def\tkz@numcby{0}
18 \def\tkzfrom{#1}
19 \def\tkzto{#2}},
20 homothety/.code args = {center #1 ratio #2}{ \def\tkz@numcby{1}
21 \def\tkzcenter{#1}
22 \def\tkzratio{#2}},
23 reflection/.code args = {over #1--#2}{ \def\tkz@numcby{2}
24 \def\tkzdeb{#1}
25 \def\tkzfin{#2}},
26 symmetry/.code args = {center #1}{ \def\tkz@numcby{3}
27 \def\tkzcenter{#1}},
28 rotation/.code args = {center #1 angle #2}{ \def\tkz@numcby{4}
29 \def\tkzcenter{#1}
30 \def\tkzangle{#2}},
31 inversion/.code args={center #1 through #2}{ \def\tkz@numcby{5}
32 \def\tkzcenter{#1}
33 \def\tkzpoint{#2}},
34 inversion negative/.code args = {center #1 through #2}{\def\tkz@numcby{6}
35 \def\tkzcenter{#1}
36 \def\tkzpoint{#2}}
37 }
38 \def\tkzDefCircleBy{\pgfutil@ifnextchar[{\tkz@DefCircleBy}{\tkz@DefCircleBy[]}}
39 \def\tkz@DefCircleBy[#1](#2){%
40 \begingroup
41 \pgfqkeys{/tkzDefCircleBy}{#1}
42 \ifcase\tkz@numcby%
43 \tkzDefCircleTranslation(#2)%
44 \or% 1
45 \tkzDefCircleHomothety(#2)
46 \or% 2
47 \tkzDefCircleReflection(#2)
48 \or% 3
49 \tkzDefCircleSymmetry(#2)
50 \or% 4
51 \tkzDefCircleRotation(#2)
52 \or% 5
53 \tkzDefInversionCircle(#2,\tkzcenter,\tkzpoint)
54 \or% 6
55 \tkzDefInversionNegativeCircle(#2,\tkzcenter,\tkzpoint)
56 \fi
57 \endgroup
58 }
59 %<--------------------------------------------------------------------------–>
60 \def\tkzDefCircleTranslation(#1,#2){%
61 \begingroup
62 \tkzUTranslation(\tkzfrom,\tkzto)(#1)
63 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
64 \tkzUTranslation(\tkzfrom,\tkzto)(#2)
65 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
66 \endgroup
67 }
68 %<--------------------------------------------------------------------------–>
69 \def\tkzDefCircleHomothety(#1,#2){%
70 \begingroup
71 \tkzUHomo(\tkzcenter,\tkzratio)(#1)
72 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
73 \tkzUHomo(\tkzcenter,\tkzratio)(#2)
74 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
75 \endgroup
76 }
77 %<--------------------------------------------------------------------------–>
78 \def\tkzDefCircleReflection(#1,#2){%
79 \begingroup
80 \tkzUSymOrth(\tkzdeb,\tkzfin)(#1)
81 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
82 \tkzUSymOrth(\tkzdeb,\tkzfin)(#2)
83 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
84 \endgroup
85 }
86 %<--------------------------------------------------------------------------–>
87 \def\tkzDefCircleSymmetry(#1,#2){%
88 \begingroup
89 \tkzUCSym(\tkzcenter)(#1)
90 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
91 \tkzUCSym(\tkzcenter)(#2)
92 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
93 \endgroup
94 }
95 %<--------------------------------------------------------------------------–>
96 \def\tkzDefCircleRotation(#1,#2){%
97 \begingroup
98 \tkzURotateAngle(\tkzcenter,\tkzangle)(#1)
99 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
100 \tkzURotateAngle(\tkzcenter,\tkzangle)(#2)
101 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
102 \endgroup
103 }
104 %<--------------------------------------------------------------------------–>
105 % #3,#4 cercle d'inversion centre #3. through #4
106 % Si le cercle passe par le pôle l'image est une droite
107 \def\tkzDefInversionCircle(#1,#2,#3,#4){%
108 \begingroup
109 \tkz@@CalcLengthcm(#1,#2){tkz@lna}%
110 \tkz@@CalcLengthcm(#1,#3){tkz@lnb}%
111 \edef\tkzMathResult{\tkz@Dec{\tkz@Round{\tkz@Abs{\tkz@lnb - \tkz@lna}}{6}}}
112 \ifdim\tkzMathResult pt < 0.00001 pt\relax%
113 \tkzURotateAngle(#1,-90)(#2)
114 \pgfnodealias{tkz@a}{tkzPointResult}
115 \tkzUInversePoint(#3,#4)(tkz@a)
116 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
117 \tkzUInversePoint(#3,#4)(#2)
118 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
119 \else
120 \tkzURotateAngle(#1,90)(#2)
121 \pgfnodealias{tkz@a}{tkzPointResult}
122 \tkzURotateAngle(#1,-90)(#2)
123 \pgfnodealias{tkz@b}{tkzPointResult}
124 \tkzUInversePoint(#3,#4)(tkz@a)
125 \pgfnodealias{tkz@p1}{tkzPointResult}
126 \tkzUInversePoint(#3,#4)(tkz@b)
127 \pgfnodealias{tkz@p2}{tkzPointResult}
128 \tkzUInversePoint(#3,#4)(#2)
129 \pgfnodealias{tkz@p3}{tkzPointResult}
130 \tkzDefCircle[circum](tkz@p3,tkz@p1,tkz@p2)
131 \fi
132 \endgroup
133 }
134 %<--------------------------------------------------------------------------–>
135 \def\tkzDefInversionNegativeCircle(#1,#2,#3,#4){%
136 \begingroup
137 \tkzDefInversionCircle(#1,#2,#3,#4)
138 \tkzUCSym(\tkzcenter)(tkzFirstPointResult)
139 \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
140 \tkzUCSym(\tkzcenter)(tkzSecondPointResult)
141 \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
142 \endgroup
143 }
144 %<--------------------------------------------------------------------------–>
145 % End Def Circle
146 %<--------------------------------------------------------------------------–>
147 \makeatother
148 \endinput