summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/TKZdoc-euclide-circles.tex
blob: f0cdae595e4f6f1c008beaf7496ad84a137af2dc (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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
\section{The Circles}

Among the following macros, one will allow you to draw a circle, which is not a real feat. To do this, you will need to know the center of the circle and either the radius of the circle or a point on the circumference. It seemed to me that the most frequent use was to draw a circle with a given centre passing through a given point. This will be the default method, otherwise you will have to use the \tkzname{R} option. There are a large number of special circles, for example the circle circumscribed by a triangle.

\begin{itemize}
  \item  I have created a first macro \tkzcname{tkzDefCircle} which allows, according to a particular circle, to retrieve its center and the measurement of the radius in cm. This recovery is done with the macros \tkzcname{tkzGetPoint} and \tkzcname{tkzGetLength};
 
 \item then a macro \tkzcname{tkzDrawCircle};
 
 \item then a macro that allows you to color in a disc, but without drawing the circle \tkzcname{tkzFillCircle};
 
 \item sometimes, it is necessary for a drawing to be contained in a disk, this is the role assigned to \tkzcname{tkzClipCircle};

 
 \item  it finally remains to be able to give a label to designate a circle and if several possibilities are offered, we will see here \tkzcname{tkzLabelCircle}.
\end{itemize} 

\subsection{Characteristics of a circle: \tkzcname{tkzDefCircle}}
 
This macro allows you to retrieve the characteristics (center and radius) of certain circles.

\begin{NewMacroBox}{tkzDefCircle}{\oarg{local options}\parg{A,B} or \parg{A,B,C}}%
\tkzHandBomb\ Attention the arguments are lists of two or three points. This macro is either used in partnership with \\ \tkzcname{tkzGetPoint} and/or \tkzcname{tkzGetLength} to obtain the center and the radius of the circle, or by using \\ \tkzname{tkzPointResult} and \tkzname{tkzLengthResult} if it is not necessary to keep the results.

\medskip
\begin{tabular}{lll}%
\toprule
arguments           & example & explication                         \\
\midrule
\TAline{\parg{pt1,pt2} or \parg{pt1,pt2,pt3}}{\parg{A,B}} {$[AB]$ is radius $A$ is the center}
\bottomrule
\end{tabular} 

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition                         \\ 
\midrule
\TOline{through}      {through}{circle characterized by two points defining a radius} 
\TOline{diameter}     {through}{circle characterized by two points defining a diameter}
\TOline{circum}       {through}{circle circumscribed of a triangle} 
\TOline{in}           {through}{incircle a triangle} 
\TOline{ex}           {through}{excircle of a  triangle}
\TOline{euler or nine}{through}{Euler's Circle}
\TOline{spieker}      {through}{Spieker Circle}
\TOline{apollonius}   {through}{circle of Apollonius} 
\TOline{K} {1}{coefficient used for a circle of Apollonius} 
 \bottomrule
\end{tabular}

{In the following examples, I draw the circles with a macro not yet presented, but this is not necessary. In some cases you may only need the center or the radius.}
\end{NewMacroBox}  

 \subsubsection{Example with a random point and  option \tkzname{through}} 

\begin{tkzexample}[latex=7 cm,small]
\begin{tikzpicture}[scale=1]
  \tkzDefPoint(0,4){A}
  \tkzDefPoint(2,2){B}
  \tkzDefMidPoint(A,B) \tkzGetPoint{I}
  \tkzDefRandPointOn[segment = I--B]
  \tkzGetPoint{C}
  \tkzDefCircle[through](A,C) 
  \tkzGetLength{rACcm}
  \tkzcmtopt(\rACcm){rACpt}
  \tkzDrawCircle(A,C)
  \tkzDrawPoints(A,B,C)
  \tkzLabelPoints(A,B,C) 
  \tkzLabelCircle[draw,
           text width=3cm,text centered,
           font=\scriptsize,below=1cm](A,C)(-90)%
  {The radius measurement is:
   \rACcm cm i.e. \rACpt pt}  
\end{tikzpicture}   
 \end{tkzexample}  
 
 \subsubsection{Example with  option \tkzname{diameter}}  
 It is simpler here to search directly for the middle of $[AB]$.
 \begin{tkzexample}[latex=7cm,small]  
 \begin{tikzpicture}[scale=1]
    \tkzDefPoint(0,0){A} 
    \tkzDefPoint(2,2){B}
    \tkzDefCircle[diameter](A,B)  
    \tkzGetPoint{O}  
    \tkzDrawCircle(O,B) 
    \tkzDrawSegment(A,B)
    \tkzDrawPoints(A,B,O)   
    \tkzLabelPoints(A,B,O)
 \end{tikzpicture} 
 \end{tkzexample}    

 \subsubsection{Circles inscribed and circumscribed for a given triangle} 
 
\begin{tkzexample}[latex=7cm,small]  
\begin{tikzpicture}[scale=.75]
 \tkzDefPoint(2,2){A}  \tkzDefPoint(5,-2){B}
 \tkzDefPoint(1,-2){C}
 \tkzDefCircle[in](A,B,C)
 \tkzGetPoint{I}    \tkzGetLength{rIN}
 \tkzDefCircle[circum](A,B,C)
 \tkzGetPoint{K}   \tkzGetLength{rCI}   
 \tkzDrawCircles[R,new](I,{\rIN} K,{\rCI}) 
 \tkzLabelPoints[below](B,C)
 \tkzLabelPoints[above left](A,I,K)
 \tkzDrawPolygon(A,B,C)
 \tkzDrawPoints(A,B,C,I,K) 
\end{tikzpicture} 
\end{tkzexample}

 \subsubsection{Example with option \tkzname{ex}}
We want to define an excircle of a  triangle relatively to point $C$

\begin{tkzexample}[latex=8cm,small]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoints{ 0/0/A,4/0/B,0.8/4/C}
  \tkzDefCircle[ex](B,C,A)                   
  \tkzGetPoint{J_c} \tkzGetLength{rc}
  \tkzDefPointBy[projection=onto A--C ](J_c)   
  \tkzGetPoint{X_c}
  \tkzDefPointBy[projection=onto A--B ](J_c)   
  \tkzGetPoint{Y_c}     
  \tkzDrawPolygon(A,B,C)
  \tkzDrawCircle[R,color=lightgray](J_c,\rc)
  % possible  \tkzDrawCircle[ex](A,B,C) 
  \tkzDrawCircle[in,new](A,B,C)    
  \tkzGetPoint{I} 
  \tkzDefPointBy[projection=onto A--C ](I)   
  \tkzGetPoint{F} 
  \tkzDefPointBy[projection=onto A--B ](I)   
  \tkzGetPoint{D}    
  \tkzDrawLines[add=0 and 2.2,dashed](C,A C,B)
  \tkzDrawSegments[dashed](J_c,X_c I,D  I,F%
          J_c,Y_c)
  \tkzMarkRightAngles(A,F,I B,D,I J_c,X_c,A%
         J_c,Y_c,B)
  \tkzDrawPoints(B,C,A,I,D,F,X_c,J_c,Y_c)
  \tkzLabelPoints(B,A,J_c,I,D,X_c,Y_c)
  \tkzLabelPoints[above left](C)
  \tkzLabelPoints[left](F)
\end{tikzpicture}    
\end{tkzexample}
  
 \subsubsection{Euler's circle for a given triangle with option \tkzname{euler}}
 
We verify that this circle passes through the middle of each side.
\begin{tkzexample}[latex=6cm,small]  
\begin{tikzpicture}[scale=.75]
   \tkzDefPoint(5,3.5){A} 
   \tkzDefPoint(0,0){B} \tkzDefPoint(7,0){C}
   \tkzDefCircle[euler](A,B,C)
   \tkzGetPoint{E}  \tkzGetLength{rEuler}
   \tkzDefSpcTriangle[medial](A,B,C){M_a,M_b,M_c}
   \tkzDrawPoints(A,B,C,E,M_a,M_b,M_c)    
   \tkzDrawCircle[R](E,\rEuler)
   \tkzDrawPolygon(A,B,C)    
   \tkzLabelPoints[below](B,C)  
   \tkzLabelPoints[left](A,E)   
\end{tikzpicture}
\end{tkzexample}

 \subsubsection{Apollonius circles for a given segment option \tkzname{apollonius}} 
 
\begin{tkzexample}[latex=9cm,small]    
\begin{tikzpicture}[scale=0.75]
  \tkzDefPoint(0,0){A} 
  \tkzDefPoint(4,0){B}
  \tkzDefCircle[apollonius,K=2](A,B)
  \tkzGetPoint{K1}
  \tkzGetLength{rAp}
  \tkzDrawCircle[R,color = teal!50!black,
      fill=teal!20,opacity=.4](K1,\rAp)
  \tkzDefCircle[apollonius,K=3](A,B)
  \tkzGetPoint{K2}   \tkzGetLength{rAp}
  \tkzDrawCircle[R,color=orange!50,
   fill=orange!20,opacity=.4](K2,\rAp) 
  \tkzLabelPoints[below](A,B,K1,K2)
  \tkzDrawPoints(A,B,K1,K2) 
  \tkzDrawLine[add=.2 and 1](A,B)  
\end{tikzpicture}
\end{tkzexample}  

 \subsubsection{Circles exinscribed to a given triangle option \tkzname{ex}}
 You can also get the center and the projection of it on one side of the triangle. 
 
 with \tkzcname{tkzGetFirstPoint\{Jb\}} and \tkzcname{tkzGetSecondPoint\{Tb\}}.
 
\begin{tkzexample}[latex=8cm,small]  
\begin{tikzpicture}[scale=.6]
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(3,0){B}
  \tkzDefPoint(1,2.5){C}
  \tkzDefCircle[ex](A,B,C) \tkzGetPoint{I} 
    \tkzGetLength{rI}
  \tkzDefCircle[ex](C,A,B) \tkzGetPoint{J} 
    \tkzGetLength{rJ}
  \tkzDefCircle[ex](B,C,A) \tkzGetPoint{K} 
    \tkzGetLength{rK}
   \tkzDefCircle[in](B,C,A) \tkzGetPoint{O}
     \tkzGetLength{rO} 
  \tkzDrawLines[add=1.5 and 1.5](A,B A,C B,C)
  \tkzDrawPoints(I,J,K)
  \tkzDrawPolygon(A,B,C)
  \tkzDrawPolygon[dashed](I,J,K)
  \tkzDrawCircle[R,teal](O,\rO)
  \tkzDrawSegments[dashed](A,K B,J C,I)
  \tkzDrawPoints(A,B,C)
  \tkzDrawCircles[R,new](J,{\rJ} I,{\rI}%
                         K,{\rK})    
  \tkzLabelPoints(A,B,C,I,J,K)
\end{tikzpicture}
\end{tkzexample}
 
  \subsubsection{Spieker circle with option \tkzname{spieker}}   
The  incircle of the medial triangle $M_aM_bM_c$ is the Spieker circle:


\begin{tkzexample}[latex=6cm, small]
\begin{tikzpicture}[scale=1]
  \tkzDefPoints{ 0/0/A,4/0/B,0.8/4/C}
   \tkzDefSpcTriangle[medial](A,B,C){M_a,M_b,M_c}
   \tkzDefTriangleCenter[spieker](A,B,C) 
   \tkzGetPoint{S_p}
   \tkzDrawPolygon(A,B,C)
   \tkzDrawPolygon[cyan](M_a,M_b,M_c)
   \tkzDrawPoints(B,C,A)
   \tkzDrawPoints[new](M_a,M_b,M_c,S_p)
   \tkzDrawCircle[in,new](M_a,M_b,M_c)
   \tkzAutoLabelPoints[center=S_p,dist=.3](M_a,M_b,M_c)
   \tkzLabelPoints[right](S_p)
   \tkzAutoLabelPoints[center=S_p](A,B,C)
\end{tikzpicture}
\end{tkzexample}
 
 \subsubsection{Examples from js bibra tex.stackexchange.com}      

\begin{tikzpicture}[scale=0.4]
\tkzDefPoint(6,4){A}
\tkzDefPoint(6,-4){B}
\tkzDefMidPoint(B,A)\tkzGetPoint{P}
\tkzDefLine[orthogonal =through P](A,B)\tkzGetPoint{X}
\tkzDefCircle[through](X,P)
\tkzCalcLength(X,P)\tkzGetLength{rXP}
\tkzDefShiftPoint[X](180:\rXP*2){y}
\tkzDefPointWith[linear,K=0.3](y,P) \tkzGetPoint{x}
\tkzDrawPoints(X,x) 
\tkzDrawCircles(x,P X,P)
\tkzLabelLine[pos=0.5,above](x,P){r1}
\tkzDefShiftPoint[X](-60:\rXP){X'}
\tkzDrawSegments[<->, >=triangle 45](X,X' P,x)  
\tkzLabelLine[pos=0.5,above, sloped](X,X'){r}
\tkzLabelPoints[above](x)
\tkzLabelPoints[above](X)
\end{tikzpicture}

\begin{tkzexample}[code only, small]
\begin{tikzpicture}[scale=0.4]
\tkzDefPoint(6,4){A}
\tkzDefPoint(6,-4){B}
\tkzDefMidPoint(B,A)\tkzGetPoint{P}
\tkzDefLine[orthogonal =through P](A,B)
\tkzGetPoint{X}
\tkzDefCircle[through](X,P)
\tkzCalcLength(X,P)\tkzGetLength{rXP}
\tkzDefShiftPoint[X](180:\rXP*2){y}
\tkzDefPointWith[linear,K=0.3](y,P)
 \tkzGetPoint{x}
\tkzDrawPoints(X,x) 
\tkzDrawCircles(x,P X,P)
\tkzLabelLine[pos=0.5,above](x,P){r1}
\tkzDefShiftPoint[X](-60:\rXP){X'}
\tkzDrawSegments[<->, >=triangle 45](X,X' P,x)  
\tkzLabelLine[pos=0.5,above, sloped](X,X'){r}
\tkzLabelPoints[above](x)
\tkzLabelPoints[above](X)
\end{tikzpicture}
\end{tkzexample}

\begin{tikzpicture}
    \tkzDefPoint(0,4){A}
    \tkzDefPoint(2,2){B}
    \tkzDefMidPoint(B,A)\tkzGetPoint{P}
    \tkzDefLine[orthogonal =through P](B,A)
    \tkzGetPoint{X}
    \tkzDefCircle[through](X,P)
    \tkzGetLength{rXPpt}
    \tkzpttocm(\rXPpt){rXPcm}
    \tkzDefPointWith[linear,K=0.3](X,P) 
    \tkzGetPoint{x}
    \tkzDefCircle[through](x,P)
    \tkzGetLength{rxPpt}
    \tkzpttocm(\rxPpt){rxPcm}    
    \tkzDrawCircles(X,P x,P)
    \tkzDrawPoints(X,x)
    \tkzDrawSegment[<->, >=triangle 45](x,P)
    \tkzDrawSegment(P,X)
    \tkzLabelPoints(X,x)
    \tkzLabelLine[pos=0.5,left](x,P){r}
    \tkzCalcLength[cm](X,P)\tkzGetLength{rXP}
    \tkzDefShiftPoint[X](-90:\rXP){y}
    \tkzDrawSegments[<->, >=triangle 45](X,y)  
    \tkzLabelLine[pos=0.5,left](X,y){R}    
\end{tikzpicture}

\begin{tkzexample}[code only, small]
\begin{tikzpicture}
    \tkzDefPoint(0,4){A}
    \tkzDefPoint(2,2){B}
    \tkzDefMidPoint(B,A)\tkzGetPoint{P}
    \tkzDefLine[orthogonal =through P](B,A)
    \tkzGetPoint{X}
    \tkzDefCircle[through](X,P)
    \tkzGetLength{rXPpt}
    \tkzpttocm(\rXPpt){rXPcm}
    \tkzDefPointWith[linear,K=0.3](X,P) 
    \tkzGetPoint{x}
    \tkzDefCircle[through](x,P)
    \tkzGetLength{rxPpt}
    \tkzpttocm(\rxPpt){rxPcm}   
    \tkzDrawCircles(X,P x,P)
    \tkzDrawPoints(X,x)
    \tkzDrawSegment[<->, >=triangle 45](x,P)
    \tkzDrawSegment(P,X)
    \tkzLabelPoints(X,x)
    \tkzLabelLine[pos=0.5,left](x,P){r}
    \tkzCalcLength[cm](X,P)\tkzGetLength{rXP}
    \tkzDefShiftPoint[X](-90:\rXP){y}
    \tkzDrawSegments[<->, >=triangle 45](X,y)  
    \tkzLabelLine[pos=0.5,left](X,y){R}    
\end{tikzpicture}
\end{tkzexample}
\endinput