summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-circles.tex
blob: 72219d5ef5ef2e5b09fdb4a295096d6d1280d562 (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
\section{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 center 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{tkzGetPoints} to obtain the center and a point on the circle, or by using \\ \tkzname{tkzFirstPointResult} and \tkzname{tkzSecondPointResult} if it is not necessary to keep the results. You can also use  \tkzcname{tkzGetLength} to get the radius.

\medskip
\begin{tabular}{lll}%
\toprule
arguments           & example & explanation                         \\
\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{R}       {circum}{circle characterized by a center and a radius} 
\TOline{diameter}{circum}{circle characterized by two points defining a diameter}
\TOline{circum}       {circum}{circle circumscribed of a triangle} 
\TOline{in}           {circum}{incircle a triangle} 
\TOline{ex}           {circum}{excircle of a  triangle}
\TOline{euler or nine}{circum}{Euler's Circle}
\TOline{spieker}      {circum}{Spieker Circle}
\TOline{apollonius}   {circum}{circle of Apollonius}
\TOline{orthogonal from} {circum}{[orthogonal from = A ](O,M)}
\TOline{orthogonal through}{circum}{[orthogonal through = A and B](O,M)} 
\TOline{K} {1}{coefficient used for a circle of Apollonius} 
 \bottomrule
\end{tabular}

\medskip
\emph{In the following examples, I draw the circles with a macro not yet presented. You may only need the center and a point on the circle. }
\end{NewMacroBox}  

 \subsubsection{Example with  option \tkzname{diameter}}  
 It is simpler here to search directly for the middle of $[AB]$. The result is the center and if necessary 
\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[below](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)
 \tkzGetPoints{I}{x}   
 \tkzDefCircle[circum](A,B,C)
 \tkzGetPoint{K}  
 \tkzDrawCircles[new](I,x K,A) 
 \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)                   
  \tkzGetPoints{J_c}{h}
  \tkzDefPointBy[projection=onto A--C ](J_c)   
  \tkzGetPoint{X_c}
  \tkzDefPointBy[projection=onto A--B ](J_c)   
  \tkzGetPoint{Y_c}     
  \tkzDefCircle[in](A,B,C)    
  \tkzGetPoints{I}{y}
  \tkzDrawCircles[color=lightgray](J_c,h I,y)
  \tkzDefPointBy[projection=onto A--C ](I)
  \tkzGetPoint{F}
  \tkzDefPointBy[projection=onto A--B ](I)
  \tkzGetPoint{D}
  \tkzDrawPolygon(A,B,C)
  \tkzDrawLines[add=0 and 1.5](C,A C,B)
  \tkzDrawSegments(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)
  \tkzLabelPoints[above](Y_c)
  \tkzLabelPoints[left](X_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)
   \tkzGetPoints{E}{e}
   \tkzDefSpcTriangle[medial](A,B,C){M_a,M_b,M_c}
   \tkzDrawCircle[new](E,e)
   \tkzDrawPoints(A,B,C,E,M_a,M_b,M_c)    
   \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)
  \tkzGetPoints{K1}{x}
  \tkzDrawCircle[color = teal!50!black,
      fill=teal!20,opacity=.4](K1,x)
  \tkzDefCircle[apollonius,K=3](A,B)
  \tkzGetPoints{K2}{y}
  \tkzDrawCircle[color=orange!50,
      fill=orange!20,opacity=.4](K2,y) 
  \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) \tkzGetPoints{I}{i}
  \tkzDefCircle[ex](C,A,B) \tkzGetPoints{J}{j}
  \tkzDefCircle[ex](B,C,A) \tkzGetPoints{K}{k}
  \tkzDefCircle[in](B,C,A) \tkzGetPoints{O}{o}
  \tkzDrawCircles[new](J,j I,i K,k O,o) 
  \tkzDrawLines[add=1.5 and 1.5](A,B A,C B,C)
  \tkzDrawPolygon[purple](I,J,K)
  \tkzDrawSegments[new](A,K B,J C,I)
  \tkzDrawPoints(A,B,C)
  \tkzDrawPoints[new](I,J,K)   
  \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)
   \tkzDefCircle[spieker](A,B,C)
   \tkzDrawPoints[new](M_a,M_b,M_c,S_p)
   \tkzDrawCircle[new](tkzFirstPointResult,tkzSecondPointResult)
   \tkzLabelPoints[right](M_a)
   \tkzLabelPoints[left](M_b)
   \tkzLabelPoints[below](A,B,M_c,S_p)
   \tkzLabelPoints[above](C)
\end{tikzpicture}
\end{tkzexample}
 
\subsection{Projection of excenters}

\begin{NewMacroBox}{tkzDefProjExcenter}{\oarg{local options}\parg{A,B,C}\parg{a,b,c}\marg{X,Y,Z}}%
Each excenter has three projections on the sides of the triangle ABC. We can do this with one macro\\ \tkzcname{tkzDefProjExcenter[name=J](A,B,C)(a,b,c)\{Y,Z,X\}}.

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition                        \\
\midrule
\TOline{name} {no defaut}{used to name the vertices}
\bottomrule
\end{tabular}

\begin{tabular}{lll}%
arguments & default & definition \\
\midrule
\TAline{(pt1=$\alpha_1$,pt2=$\alpha_2$,\dots)}{no default}{Each point has a assigned weight}
\end{tabular}

\medskip
\end{NewMacroBox}

\subsubsection{\tkzname{Excircles}}

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}[scale=.6]
\tikzset{line style/.append style={line width=.2pt}}
\tikzset{label style/.append style={color=teal,font=\footnotesize}}
\tkzDefPoints{0/0/A,5/0/B,0.8/4/C}
\tkzDefSpcTriangle[excentral,name=J](A,B,C){a,b,c} 
\tkzDefSpcTriangle[intouch,name=I](A,B,C){a,b,c}
\tkzDefProjExcenter[name=J](A,B,C)(a,b,c){X,Y,Z}
\tkzDefCircle[in](A,B,C)   \tkzGetPoint{I} \tkzGetSecondPoint{T}  
\tkzDrawCircles[red](Ja,Xa Jb,Yb Jc,Zc)
\tkzDrawCircle(I,T) 
\tkzDrawPolygon[dashed,color=blue](Ja,Jb,Jc)
\tkzDrawLines[add=1.5 and 1.5](A,C A,B B,C)
\tkzDrawSegments(Ja,Xa Ja,Ya Ja,Za
                 Jb,Xb Jb,Yb Jb,Zb
                 Jc,Xc Jc,Yc Jc,Zc
                 I,Ia I,Ib I,Ic)
\tkzMarkRightAngles[size=.2,fill=gray!15](Ja,Za,B Ja,Xa,B Ja,Ya,C Jb,Yb,C)
\tkzMarkRightAngles[size=.2,fill=gray!15](Jb,Zb,B Jb,Xb,C Jc,Yc,A Jc,Zc,B) Jc,Xc,C I,Ia,B I,Ib,C I,Ic,A)
\tkzDrawSegments[blue](Jc,C Ja,A Jb,B)
\tkzDrawPoints(A,B,C,Xa,Xb,Xc,Ja,Jb,Jc,Ia,Ib,Ic,Ya,Yb,Yc,Za,Zb,Zc)
\tkzLabelPoints(A,Ya,Yb,Ja,I)
\tkzLabelPoints[left](Jb,Ib,Yc)
\tkzLabelPoints[below](Zb,Ic,Jc,B,Za,Xa)
\tkzLabelPoints[above right](C,Zc,Yb)
\tkzLabelPoints[right](Xb,Ia,Xc)
\end{tikzpicture}
\end{tkzexample}
 
\subsubsection{\tkzname{Orthogonal from}}
Orthogonal circle of given center. \tkzcname{tkzGetPoints\{z1\}\{z2\}} gives two points of the circle.

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoints{0/0/O,1/0/A}
  \tkzDefPoints{1.5/1.25/B,-2/-3/C}
  \tkzDefCircle[orthogonal from=B](O,A)
  \tkzGetPoints{z1}{z2}
  \tkzDefCircle[orthogonal from=C](O,A)
  \tkzGetPoints{t1}{t2}
  \tkzDrawCircle(O,A)
  \tkzDrawCircles[new](B,z1 C,t1)
  \tkzDrawPoints(t1,t2,C)
  \tkzDrawPoints(z1,z2,O,A,B)
  \tkzLabelPoints[right](O,A,B,C)
\end{tikzpicture}
\end{tkzexample}

\subsubsection{\tkzname{Orthogonal through}}
Orthogonal circle passing through two given points.
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=1]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(1,0){A}
  \tkzDrawCircle(O,A)
  \tkzDefPoint(-1.5,-1.5){z1}
  \tkzDefPoint(1.5,-1.25){z2}
  \tkzDefCircle[orthogonal through=z1 and z2](O,A)
   \tkzGetPoint{c}
  \tkzDrawCircle[new](tkzPointResult,z1)
  \tkzDrawPoints[new](O,A,z1,z2,c)
  \tkzLabelPoints[right](O,A,z1,z2,c)
\end{tikzpicture}
\end{tkzexample}

\endinput