summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-circles.tex
blob: 9a3a726658b22842c05bfb66fdbb8eb9fe582bcf (plain)
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
224
225
226
227
228
229
230
231
232
233
234
235
236
% tkz-obj-eu-circles.tex
% Copyright 2020 by Alain Matthes
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
\def\fileversion{3.02c}
\def\filedate{2020/01/24} 
\typeout{2020/01/24 3.02c  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,
      through/.code                  = \def\tkz@numc{0},
      radius/.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},
      orthogonal from/.code args     = {#1}{\def\tkz@ptfrom{#1}
                                            \def\tkz@numc{7}}, 
      orthogonal through/.code args  = {#1 and #2}{\def\tkz@ptone{#1}
                                                   \def\tkz@pttwo{#2} 
                                                   \def\tkz@numc{8}},
      spieker/.code                  = \def\tkz@numc{9}, 
      K/.code                        = \def\tkz@koeff{#1},
      K                       =  1,
      through
      } 
\def\tkzDefCircle{\pgfutil@ifnextchar[{\tkz@DefCircle}{\tkz@DefCircle[]}}
\def\tkz@DefCircle[#1](#2){% 
\begingroup  
\pgfqkeys{/tkzcircle}{#1}  
\ifcase\tkz@numc%
  \tkzDefCircleThrough(#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
  \tkzDefOrthogonalCircle(#2,\tkz@ptfrom) 
  \or% 8
  \tkzDefOrthoThroughCircle(#2,\tkz@ptone,\tkz@pttwo)
  \or% 9
  \tkzDefSpiekerCircle(#2)
     \fi    
\endgroup
}
%<--------------------------------------------------------------------------–>
%              Circum Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefCircumCircle(#1,#2,#3){%
\begingroup
   \tkzCircumCenter(#1,#2,#3)
   \tkzCalcLength(#1,tkzPointResult) 
\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}
  \tkzCalcLength(tkzPointResult,tkz@incenter)
  \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}
  \tkzCalcLength(tkzPointResult,tkz@excenter)% 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) 
 \tkzCalcLength(tkzPointResult,tkz@e1)
\endgroup
} 
\let\tkzDefNinePointsCircle\tkzEulerCircle%
\let\tkzFeuerBachCircle\tkzEulerCircle%  

\def\tkzDefEulerRadius(#1,#2,#3){%
\begingroup
   \tkzEulerCenter(#1,#2,#3)
   \pgfnodealias{eur@pta}{tkzPointResult}   
   \tkzDefMidPoint(#1,#2)  
   \tkzCalcLength(eur@pta,tkzPointResult)
\endgroup
} 
%<--------------------------------------------------------------------------–>
%                     Apollonius circle
%<--------------------------------------------------------------------------–>
\def\tkzDefApolloniusCircle(#1,#2){%
\begingroup
  \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#1,#2)
  \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
  \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#1,#2)   
  \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
  \tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult)
  \tkzCalcLength(tkzPointResult,tkzFirstPointResult)
\endgroup
}
%<--------------------------------------------------------------------------–>
%                     Apollonius radius
%<--------------------------------------------------------------------------–> 
\pgfkeys{/tkzapor/.cd,
      K/.code    = \def\tkz@koeff{#1},% apollonius
      K          =  1
      } 
\def\tkzDefApolloniusRadius{\pgfutil@ifnextchar[{%
    \tkz@DefApolloniusRadius}{\tkz@DefApolloniusRadius[]}}
\def\tkz@DefApolloniusRadius[#1](#2,#3){% 
\begingroup
  \pgfqkeys{/tkzapor}{#1} 
  \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#2,#3) 
  \pgfnodealias{apo@pta}{tkzPointResult}    
  \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#2,#3) 
  \pgfnodealias{apo@ptb}{tkzPointResult} 
  \tkzDefMidPoint(apo@pta,apo@ptb)  
  \tkzCalcLength(tkzPointResult,apo@pta)   
\endgroup
}   
%<--------------------------------------------------------------------------–>
%                     Apollonius point
%<--------------------------------------------------------------------------–>

\pgfkeys{/tkzapop/.cd,
      K/.code    = \def\tkz@koeff{#1},% apollonius
      K          =  1
      } 
\def\tkzDefApolloniusPoint{\pgfutil@ifnextchar[{\tkz@DefApolloniusPoint}{\tkz@DefApolloniusPoint[]}}
\def\tkz@DefApolloniusPoint[#1](#2,#3){% 
\begingroup
   \pgfqkeys{/tkzapop}{#1}  
   \tkzDefBarycentricPoint(#2=1,#3=\tkz@koeff)
\endgroup
}    
%<--------------------------------------------------------------------------–>
%                     Apollonius center
%<--------------------------------------------------------------------------–>
\pgfkeys{/tkzapoc/.cd,
      K/.code   = \def\tkz@koeff{#1},% apollonius
      K         =  1
      } 
\def\tkzApolloniusCenter{\pgfutil@ifnextchar[{\tkz@ApolloniusCenter}{\tkz@ApolloniusCenter[]}}
\def\tkz@ApolloniusCenter[#1](#2,#3){% 
\begingroup
   \pgfqkeys{/tkzapoc}{#1}  
    \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#2,#3)
    \pgfnodealias{tkzFirstPointResult}{tkzPointResult}
    \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#2,#3)
    \pgfnodealias{tkzSecondPointResult}{tkzPointResult}
    \tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult)  
\endgroup
}     
%<--------------------------------------------------------------------------–>
\def\tkzDefOrthogonalCircle(#1,#2,#3){%   
\begingroup
   \tkzTgtFromP(#1,#2)(#3)
   \tkzCalcLength[cm](#1,tkzFirstPointResult)
\endgroup
} 
%<--------------------------------------------------------------------------–>
\def\tkzDefOrthoThroughCircle(#1,#2,#3,#4){%  
\begingroup
  \tkzCalcLength[cm](#1,#3)\tkzGetLength{tkz@lnb}%
	\edef\tkz@lnc{\fpeval{1/\tkz@lnb}}
  \tkzVecKNorm[\tkz@lnc](#1,#3) 
  \pgfnodealias{tkz@PointResult}{tkzPointResult}
  \tkzCircumCenter(tkz@PointResult,#3,#4)
  \tkzCalcLength(tkzPointResult,#3)
\endgroup
} 
%<--------------------------------------------------------------------------–>
%              Spieker Circle
%<--------------------------------------------------------------------------–>
\def\tkzDefSpiekerCircle(#1,#2,#3){%
\begingroup
  \tkzSpiekerCenter(#1,#2,#3)
  \pgfnodealias{tkz@spka}{tkzPointResult}
  \tkzDefMidPoint(#1,#2)
  \tkzUProjection(#1,#2)(tkzPointResult)
  \tkzCalcLength(tkz@spka,tkzPointResult)
\endgroup
} 
%<--------------------------------------------------------------------------–>
%              End Def Circle
%<--------------------------------------------------------------------------–>  
 \makeatother 
\endinput