1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
% tkz-obj-eu-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-circles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzCircle center and one point
%<--------------------------------------------------------------------------–>
% attention radius circle is defined by center and a point on the circle
% R defined by center and the value of the radius
% no need to define a circle with R tikz uses this method.
% through instead of radius
\def\tkz@numc{0}
\pgfkeys{/tkzcircle/.cd,
R/.code = \def\tkz@numc{0},
diameter/.code = \def\tkz@numc{1},
circum/.code = \def\tkz@numc{2},
in/.code = \def\tkz@numc{3},
ex/.code = \def\tkz@numc{4},
euler/.code = \def\tkz@numc{5},
nine/.code = \def\tkz@numc{5},
apollonius/.code = \def\tkz@numc{6},
spieker/.code = \def\tkz@numc{7},
orthogonal from/.code args = {#1}{\gdef\tkz@numc{8}
\def\tkz@ptfrom{#1}},
orthogonal through/.code args = {#1 and #2}{\gdef\tkz@numc{9}
\def\tkz@ptone{#1}
\def\tkz@pttwo{#2}},
K/.code = \def\tkz@koeff{#1},
K = 1,
circum
}
\def\tkzDefCircle{\pgfutil@ifnextchar[{\tkz@DefCircle}{\tkz@DefCircle[]}}
\def\tkz@DefCircle[#1](#2){%
\begingroup
\pgfqkeys{/tkzcircle}{#1}
\ifcase\tkz@numc%
\tkzDefCircleR(#2)
\or% 1
\tkzDefCircleD(#2)
\or% 2
\tkzDefCircumCircle(#2)
\or% 3
\tkzDefInCircle(#2)
\or% 4
\tkzDefExCircle(#2)
\or% 5
\tkzDefEulerCircle(#2)
\or% 6
\tkzDefApolloniusCircle(#2)
\or% 7
\tkzDefSpiekerCircle(#2)
\or% 8
\tkzDefOrthogonalCircle(#2,\tkz@ptfrom)
\or% 9
\tkzDefOrthoThroughCircle(#2,\tkz@ptone,\tkz@pttwo)
\fi
\endgroup
}
%for compatibility
%<--------------------------------------------------------------------------–>
% R
%<--------------------------------------------------------------------------–>
\def\tkzDefCircleR(#1,#2){%
\begingroup
\edef\tkzLengthResult{\fpeval{round(#2,5)}}
\global\let\tkzLengthResult\tkzLengthResult
\path (#1)--++(\tkzLengthResult,0) coordinate (tkzSecondPointResult);
\tkzRenamePoint(tkzSecondPointResult){tkzPointResult}
\endgroup
}
%<--------------------------------------------------------------------------–>
% Diameter Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefCircleD(#1,#2){%
\begingroup
\tkzDefMidPoint(#1,#2)
\pgfnodealias{tkzFirstPointResult}{tkzPointResult}
\pgfnodealias{tkzSecondPointResult}{#2}
\tkz@@CalcLengthcm(#1,tkzPointResult){tkzLengthResult}
\endgroup
}
%<--------------------------------------------------------------------------–>
% Circum Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefCircumCircle(#1,#2,#3){%
\begingroup
\tkzCircumCenter(#1,#2,#3)
\tkzRenamePoint(tkzPointResult){tkzFirstPointResult}
\tkzRenamePoint(#1){tkzSecondPointResult}
\tkz@@CalcLengthcm(#1,tkzPointResult){tkzLengthResult}%3.06 add [cm]
\endgroup
}
%<--------------------------------------------------------------------------–>
% In(scribe) Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefInCircle(#1,#2,#3){%
\begingroup
\tkzInCenter(#1,#2,#3)
\pgfnodealias{tkz@incenter}{tkzPointResult}
\tkzUProjection(#1,#3)(tkz@incenter)
\pgfnodealias{tkzSecondPointResult}{tkzPointResult}
\tkz@@CalcLengthcm(tkzPointResult,tkz@incenter){tkzLengthResult}
\pgfnodealias{tkzPointResult}{tkz@incenter}
\pgfnodealias{tkzFirstPointResult}{tkz@incenter}
\endgroup
}
%<--------------------------------------------------------------------------–>
% Ex(scribe) Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefExCircle(#1,#2,#3){%
\begingroup
\tkzExCenter(#1,#2,#3)
\pgfnodealias{tkz@excenter}{tkzPointResult}
\tkzUProjection(#1,#3)(tkz@excenter)
\pgfnodealias{tkzSecondPointResult}{tkzPointResult}
\tkz@@CalcLengthcm(tkzPointResult,tkz@excenter){tkzLengthResult}% for tkzGetLength
\pgfnodealias{tkzPointResult}{tkz@excenter}
\pgfnodealias{tkzFirstPointResult}{tkz@excenter}
\endgroup
}
%<--------------------------------------------------------------------------–>
% Radius Ex Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefExRadius(#1,#2,#3){%
\begingroup
\tkzExCenter(#1,#2,#3)
\tkzUProjection(#1,#3)(tkzPointResult)
\endgroup
}
%<--------------------------------------------------------------------------–>
% The nine-point circle, also called Euler's circle or the Feuerbach circle
% best way Ma,Mb,Mc circum center 2020
%<--------------------------------------------------------------------------–>
\def\tkzDefEulerCircle(#1,#2,#3){%
\begingroup
\tkzDefMidPoint(#1,#2) \pgfnodealias{tkz@e1}{tkzPointResult}
\tkzDefMidPoint(#2,#3) \pgfnodealias{tkz@e2}{tkzPointResult}
\tkzDefMidPoint(#1,#3) \pgfnodealias{tkz@e3}{tkzPointResult}
\tkzCircumCenter(tkz@e1,tkz@e2,tkz@e3)
\pgfnodealias{tkzFirstPointResult}{tkzPointResult}
\tkzRenamePoint(tkz@e1){tkzSecondPointResult}
\tkz@@CalcLengthcm(tkzPointResult,tkz@e1){tkzLengthResult}
\endgroup
}
\let\tkzDefNinePointsCircle\tkzEulerCircle%
\let\tkzFeuerBachCircle\tkzEulerCircle%
\def\tkzDefEulerRadius(#1,#2,#3){%
\begingroup
\tkzEulerCenter(#1,#2,#3)
\pgfnodealias{eur@pta}{tkzPointResult}
\tkzDefMidPoint(#1,#2)
\tkz@@CalcLengthcm(eur@pta,tkzPointResult){tkzLengthResult}
\endgroup
}
%<--------------------------------------------------------------------------–>
% Apollonius circle
%<--------------------------------------------------------------------------–>
\def\tkzDefApolloniusCircle(#1,#2){%
\begingroup
\tkzDefBarycentricPoint(#1=1,#2=\tkz@koeff)
\pgfnodealias{apo@pta}{tkzPointResult}
\pgfnodealias{tkzSecondPointResult}{tkzPointResult}
\tkzDefBarycentricPoint(#1=1,#2=-\tkz@koeff)
\pgfnodealias{apo@ptb}{tkzPointResult}
\tkzDefMidPoint(apo@pta,apo@ptb)
\pgfnodealias{tkzFirstPointResult}{tkzPointResult}
\tkz@@CalcLengthcm(tkzFirstPointResult,apo@pta){tkzLengthResult}
\pgfnodealias{tkzThirdPointResult}{apo@ptb}
\endgroup
}
%<--------------------------------------------------------------------------–>
\def\tkzDefOrthogonalCircle(#1,#2,#3){%
\begingroup
\tkzTgtFromP(#1,#2)(#3)
\tkz@@CalcLengthcm(#1,tkzFirstPointResult){tkzLengthResult}
\endgroup
}
%<--------------------------------------------------------------------------–>
\def\tkzDefOrthoThroughCircle(#1,#2,#3,#4){%
\begingroup
\tkz@@CalcLengthcm(#1,#3){tkz@lnb}%
\edef\tkz@lnc{\fpeval{1/\tkz@lnb}}
\tkzVecKNorm[\tkz@lnc](#1,#3)
\pgfnodealias{tkz@PointResult}{tkzPointResult}
\tkzCircumCenter(tkz@PointResult,#3,#4)
\tkz@@CalcLengthcm(tkzPointResult,#3){tkzLengthResult}
\pgfnodealias{tkzFirstPointResult}{tkzPointResult}
\pgfnodealias{tkzSecondPointResult}{#3}
\endgroup
}
%<--------------------------------------------------------------------------–>
% Spieker Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefSpiekerCircle(#1,#2,#3){%
\begingroup
\tkzSpiekerCenter(#1,#2,#3)
\pgfnodealias{tkzFirstPointResult}{tkzPointResult}
\tkzUProjection(tkz@m1,tkz@m2)(tkzPointResult)
\pgfnodealias{tkzSecondPointResult}{tkzPointResult}
\tkz@@CalcLength(tkzSecondPointResult,tkzFirstPointResult){tkzLengthResult}
\endgroup
}
%<--------------------------------------------------------------------------–>
%<--------------------------------------------------------------------------–>
% End Def Circle
%<--------------------------------------------------------------------------–>
\makeatother
\endinput
|