summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/latex/TKZdoc-euclide-example.tex
blob: cba1eecd49b03c3d2f587157fef17c73bdd25b90 (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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
%!TEX root = /Users/ego/Boulot/TKZ/tkz-euclide/doc_fr/TKZdoc-euclide-main.tex

\section{Gallery  : Some examples}

Some examples with explanations in english.
%–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>

\subsection{White on Black}
This example shows how to get a segment with a length equal at $\sqrt{a}$ from a segment of length $a$, only with a rule and a compass.


\begin{center}
\begin{tkzexample}[]
  \tikzset{background rectangle/.style={fill=black}} 
\begin{tikzpicture}[show background rectangle]
   \tkzInit[ymin=-1.5,ymax=7,xmin=-1,xmax=+11]
   \tkzClip 
   \tkzDefPoint(0,0){O}
   \tkzDefPoint(1,0){I}
   \tkzDefPoint(10,0){A}
   \tkzDefPointWith[orthogonal](I,A) \tkzGetPoint{H}
   \tkzDefMidPoint(O,A) \tkzGetPoint{M}
   \tkzInterLC(I,H)(M,A)\tkzGetPoints{C}{B}
   \tkzDrawSegments[color=white,line width=1pt](I,H O,A)
   \tkzDrawPoints[color=white](O,I,A,B,M) 
   \tkzMarkRightAngle[color=white,line width=1pt](A,I,B) 
   \tkzDrawArc[color=white,line width=1pt,style=dashed](M,A)(O) 
  \tkzLabelSegment[white,right=1ex,pos=.5](I,B){$\sqrt{a}$} 
  \tkzLabelSegment[white,below=1ex,pos=.5](O,I){$1$}   
  \tkzLabelSegment[pos=.6,white,below=1ex](I,A){$a$} 
\end{tikzpicture}
\end{tkzexample}
\end{center}

\vfill\newpage
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>

\subsection{ Square root of the integers }       
How to get $1$, $\sqrt{2}$, $\sqrt{3}$ with a rule and a compass.
\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}[scale=1.75]
   \tkzInit[xmin=-3,xmax=4,ymin=-2,ymax=4]
   \tkzGrid
   \tkzDefPoint(0,0){O}
   \tkzDefPoint(1,0){a0}
   \newcounter{tkzcounter}
   \setcounter{tkzcounter}{0}
   \newcounter{density}
   \setcounter{density}{20}
   \foreach \i in {0,...,15}{%
      \pgfmathsetcounter{density}{\thedensity+2}
      \setcounter{density}{\thedensity}    
      \stepcounter{tkzcounter}
      \tkzDefPointWith[orthogonal normed](a\i,O)
      \tkzGetPoint{a\thetkzcounter}
      \tkzDrawPolySeg[color=Maroon!\thedensity,%
         fill=Maroon!\thedensity,opacity=.5](a\i,a\thetkzcounter,O)}
 \end{tikzpicture}  
\end{tkzexample}
\end{center}

%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>
 \vfill\newpage
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>
% 
\subsection{How to construct the tangent lines from a point to a circle with a rule and a compass.}
\begin{center}
\begin{tkzexample}[] 
  \begin{tikzpicture}
    \tkzPoint(0,0){O}
    \tkzPoint(9,2){P}
    \tkzDefMidPoint(O,P) \tkzGetPoint{I}
    \tkzDrawCircle[R](O,4cm)
    \tkzDrawCircle[diameter](O,P)
    \tkzCalcLength(I,P)  \tkzGetLength{dIP}
    \tkzInterCC[R](O,4cm)(I,\dIP pt)\tkzGetPoints{Q1}{Q2}
    \tkzDrawPoint[color=red](Q1)
    \tkzDrawPoint[color=red](Q2)
    \tkzDrawLine(P,Q1) 
    \tkzDrawLine(P,Q2) 
    \tkzDrawSegments(O,Q1 O,Q2)
    \tkzDrawLine(P,O)
\end{tikzpicture}
\end{tkzexample}
\end{center} 
% 
% %<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>
 \vfill\newpage
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>

\subsection{Circle and tangent}
We have a point A $(8,2)$, a circle with center A and radius=3cm and a line
  $\delta$ $y=4$. The line intercepts the circle at B. We want to draw the tangent at the circle in B.
   
\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}
  \tkzInit[xmax=14,ymin=-2,ymax=6]
  \tkzDrawX[noticks,label=$(d)$]
  \tkzPoint[pos=above right](8,2){A};
  \tkzPoint[color=red,pos=above right](0,0){O};
  \tkzDrawCircle[R,color=blue,line width=.8pt](A,3 cm)
  \tkzHLine[color=red,style=dashed]{4} 
  \tkzText[above](12,4){$\delta$}
  \FPeval\alphaR{arcsin(2/3)}% on a les bonnes valeurs
  \FPeval\xB{8-3*cos(\alphaR)}
  \tkzPoint[pos=above left](\xB,4){B};
  \tkzDrawSegment[line width=1pt](A,B)
  \tkzDefLine[orthogonal=through B](A,B) \tkzGetPoint{b}
  \tkzDefPoint(1,0){i}
  \tkzInterLL(B,b)(O,i) \tkzGetPoint{B'}
  \tkzDrawPoint(B')
  \tkzDrawLine(B,B')
 \end{tikzpicture}
\end{tkzexample}
\end{center}

 \vfill\newpage
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>

\subsection{About right triangle}

We have a segment $[AB]$ and we want to determine a point $C$ such as $AC=8 cm$ and $ABC$ is a right triangle in $B$.

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}
  \tkzInit
  \tkzClip
  \tkzPoint[pos=left](2,1){A}
  \tkzPoint(6,4){B} 
  \tkzDrawSegment(A,B)
  \tkzDrawPoint[color=red](A)
  \tkzDrawPoint[color=red](B)
  \tkzDefPointWith[orthogonal,K=-1](B,A)    
  \tkzDrawLine[add = .5 and .5](B,tkzPointResult)
  \tkzInterLC[R](B,tkzPointResult)(A,8 cm) \tkzGetPoints{C}{J}
  \tkzDrawPoint[color=red](C)
  \tkzCompass(A,C)
  \tkzMarkRightAngle(A,B,C)
  \tkzDrawLine[color=gray,style=dashed](A,C)
\end{tikzpicture} 
\end{tkzexample}
\end{center}

 %<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>
 \vfill\newpage %<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>

\subsection{Archimedes}

This is an ancient problem  proved by the great Greek mathematician Archimedes .
The figure below shows a semicircle, with diameter $AB$. A tangent line is drawn and  touches the semicircle at $B$.  An other tangent line at a point, $C$, on the semicircle is drawn. We project the point $C$ on the segment$[AB]$  on a point $D$ . The two tangent lines intersect at the point $T$.

Prove that the line $(AT)$ bisects $(CD)$

\begin{center}
\begin{tkzexample}[]  
\begin{tikzpicture}[scale=1.25] 
   \tkzInit[ymin=-1,ymax=7]
   \tkzClip
   \tkzDefPoint(0,0){A}\tkzDefPoint(6,0){D} 
   \tkzDefPoint(8,0){B}\tkzDefPoint(4,0){I}
   \tkzDefLine[orthogonal=through D](A,D)
   \tkzInterLC[R](D,tkzPointResult)(I,4 cm) \tkzGetFirstPoint{C}
   \tkzDefLine[orthogonal=through C](I,C)   \tkzGetPoint{c}
   \tkzDefLine[orthogonal=through B](A,B)   \tkzGetPoint{b}
   \tkzInterLL(C,c)(B,b) \tkzGetPoint{T} 
   \tkzInterLL(A,T)(C,D) \tkzGetPoint{P}
   \tkzDrawArc(I,B)(A) 
   \tkzDrawSegments(A,B A,T C,D I,C) \tkzDrawSegment[color=orange](I,C)
   \tkzDrawLine[add = 1 and 0](C,T)  \tkzDrawLine[add = 0 and 1](B,T)
   \tkzMarkRightAngle(I,C,T)
   \tkzDrawPoints(A,B,I,D,C,T)  
   \tkzLabelPoints(A,B,I,D)  \tkzLabelPoints[above right](C,T)
   \tkzMarkSegment[pos=.25,mark=s|](C,D) \tkzMarkSegment[pos=.75,mark=s|](C,D)
\end{tikzpicture}  
\end{tkzexample}
\end{center}  

\subsection{Example from Dimitris Kapeta}

You need in this example to use \tkzname{mkpos=.2} with \tkzcname{tkzMarkAngle} because the measure of $ \widehat{CAM}$ is too small.
Another possiblity is to use \tkzcname{tkzFillAngle}.

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}[scale=1.25]
  \tkzInit[xmin=-5.2,xmax=3.2,ymin=-3.2,ymax=3.3]
  \tkzClip 
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(2.5,0){N}
  \tkzDefPoint(-4.2,0.5){M}
  \tkzDefPointBy[rotation=center O angle 30](N)
  \tkzGetPoint{B}
  \tkzDefPointBy[rotation=center O angle -50](N)
  \tkzGetPoint{A}
  \tkzInterLC(M,B)(O,N) \tkzGetFirstPoint{C}
  \tkzInterLC(M,A)(O,N) \tkzGetSecondPoint{A'} 
  \tkzMarkAngle[fill=blue!25,mkpos=.2, size=0.5](A,C,B) 
  \tkzMarkAngle[fill=green!25,mkpos=.2, size=0.5](A,M,C)
  \tkzDrawSegments(A,C M,A M,B)
  \tkzDrawCircle(O,N)
  \tkzLabelCircle[above left](O,N)(120){$\mathcal{C}$}
  \tkzMarkAngle[fill=red!25,mkpos=.2, size=0.5cm](C,A,M)
  \tkzDrawPoints(O, A, B, M, B, C)
  \tkzLabelPoints[right](O,A,B)
  \tkzLabelPoints[above left](M,C)
  \tkzLabelPoint[below left](A'){$A'$}
\end{tikzpicture}
\end{tkzexample}
\end{center}

\newpage
\subsection{Example 1 from John Kitzmiller }
This figure is the last of beamer document. You can find the document on  my site 

Prove $\bigtriangleup LKJ$ is equilateral
  
\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.5]
  \tkzDefPoint[label=below left:A](0,0){A}
  \tkzDefPoint[label=below right:B](6,0){B}
  \tkzDefTriangle[equilateral](A,B) \tkzGetPoint{C}
  \tkzMarkSegments[mark=|](A,B A,C B,C)
  \tkzDefBarycentricPoint(A=1,B=2) \tkzGetPoint{C'}
  \tkzDefBarycentricPoint(A=2,C=1) \tkzGetPoint{B'}
  \tkzDefBarycentricPoint(C=2,B=1) \tkzGetPoint{A'}
  \tkzInterLL(A,A')(C,C') \tkzGetPoint{J}
  \tkzInterLL(C,C')(B,B') \tkzGetPoint{K}
  \tkzInterLL(B,B')(A,A') \tkzGetPoint{L}
  \tkzLabelPoint[above](C){C}
  \tkzDrawPolygon(A,B,C) \tkzDrawSegments(A,J B,L C,K)
  \tkzMarkAngles[fill= orange,size=1cm,opacity=.3](J,A,C K,C,B L,B,A)
  \tkzLabelPoint[right](J){J}
  \tkzLabelPoint[below](K){K}
  \tkzLabelPoint[above left](L){L}
  \tkzMarkAngles[fill=orange, opacity=.3,thick,size=1,](A,C,J C,B,K B,A,L)
  \tkzMarkAngles[fill=green, size=1, opacity=.5](A,C,J C,B,K B,A,L)
  \tkzFillPolygon[color=yellow, opacity=.2](J,A,C)
  \tkzFillPolygon[color=yellow, opacity=.2](K,B,C)
  \tkzFillPolygon[color=yellow, opacity=.2](L,A,B)
  \tkzDrawSegments[line width=3pt,color=cyan,opacity=0.4](A,J C,K B,L)
  \tkzDrawSegments[line width=3pt,color=red,opacity=0.4](A,L B,K C,J)
  \tkzMarkSegments[mark=o](J,K K,L L,J)
\end{tikzpicture}  
\end{tkzexample}  

\end{center} 

\newpage
\subsection{Example 2 from John Kitzmiller }    
Prove $\dfrac{AC}{CE}=\dfrac{BD}{DF} \qquad$

Another interesting example from John, you can see how to use some extra options like \tkzname{decoration} and \tkzname{postaction}  from \TIKZ\ with \tkzname{tkz-euclide}.

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.5,decoration={markings,
  mark=at position 3cm with {\arrow[scale=2]{>}};}]
  \tkzInit[xmin=-0.25,xmax=6.25, ymin=-0.5,ymax=4]
  \tkzClip
  \tkzDefPoints{0/0/E, 6/0/F, 0/1.8/P, 6/1.8/Q, 0/3/R, 6/3/S}
  \tkzDrawLines[postaction={decorate}](E,F P,Q R,S)
  \tkzDefPoints{3.5/3/A, 5/3/B}
  \tkzDrawSegments(E,A F,B)
  \tkzInterLL(E,A)(P,Q) \tkzGetPoint{C}
  \tkzInterLL(B,F)(P,Q) \tkzGetPoint{D}
  \tkzLabelPoints[above right](A,B)
  \tkzLabelPoints[below](E,F)
  \tkzLabelPoints[above left](C)
  \tkzDrawSegments[style=dashed](A,F)
  \tkzInterLL(A,F)(P,Q) \tkzGetPoint{G}
  \tkzLabelPoints[above right](D,G) 
  \tkzDrawSegments[color=teal, line width=3pt, opacity=0.4](A,C A,G)
  \tkzDrawSegments[color=magenta, line width=3pt, opacity=0.4](C,E G,F)
  \tkzDrawSegments[color=teal, line width=3pt, opacity=0.4](B,D)
  \tkzDrawSegments[color=magenta, line width=3pt, opacity=0.4](D,F)
\end{tikzpicture} 
\end{tkzexample}
\end{center}

\newpage
\subsection{Example 3 from John Kitzmiller }    
Prove $\dfrac{BC}{CD}=\dfrac{AB}{AD} \qquad$ (Angle Bisector)


\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.5] 
  \tkzInit[xmin=-4,xmax=5,ymax=4.5]   \tkzClip[space=.5]
  \tkzDefPoints{0/0/B, 5/0/D}         \tkzDefPoint(70:3){A}
  \tkzDrawPolygon(B,D,A)
  \tkzDefLine[bisector](B,A,D)         \tkzGetPoint{a}
  \tkzInterLL(A,a)(B,D)                \tkzGetPoint{C}
  \tkzDefLine[parallel=through B](A,C) \tkzGetPoint{b}
  \tkzInterLL(A,D)(B,b)                \tkzGetPoint{P}
  \begin{scope}[decoration={markings,
    mark=at position .5 with {\arrow[scale=2]{>}};}]
    \tkzDrawSegments[postaction={decorate},dashed](C,A P,B) 
  \end{scope}
  \tkzDrawSegment(A,C) \tkzDrawSegment[style=dashed](A,P)  
  \tkzLabelPoints[below](B,C,D) \tkzLabelPoints[above](A,P)
  \tkzDrawSegments[color=magenta, line width=3pt, opacity=0.4](B,C P,A)
  \tkzDrawSegments[color=teal,     line width=3pt, opacity=0.4](C,D A,D)
  \tkzDrawSegments[color=magenta, line width=3pt, opacity=0.4](A,B)
  \tkzMarkAngles[size=0.7](B,A,C C,A,D)
  \tkzMarkAngles[size=0.7, fill=green,  opacity=0.5](B,A,C A,B,P)
  \tkzMarkAngles[size=0.7, fill=yellow, opacity=0.3](B,P,A C,A,D)
  \tkzMarkAngles[size=0.7, fill=green,  opacity=0.6](B,A,C A,B,P B,P,A C,A,D)
  \tkzLabelAngle[pos=1](B,A,C){1}     \tkzLabelAngle[pos=1](C,A,D){2}
  \tkzLabelAngle[pos=1](A,B,P){3})    \tkzLabelAngle[pos=1](B,P,A){4}
  \tkzMarkSegments[mark=|](A,B A,P) 
\end{tikzpicture}   
\end{tkzexample}
\end{center} 

\newpage
\subsection{Example 4 from John Kitzmiller }    
Prove $\overline{AG}\cong\overline{EF} \qquad$ (Detour)

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=2]
  \tkzInit[xmax=5, ymax=5]
  \tkzDefPoint(0,3){A}    \tkzDefPoint(6,3){E}  \tkzDefPoint(1.35,3){B}
  \tkzDefPoint(4.65,3){D} \tkzDefPoint(1,1){G}  \tkzDefPoint(5,5){F} 
  \tkzDefMidPoint(A,E)    \tkzGetPoint{C}       
  \tkzFillPolygon[yellow, opacity=0.4](B,G,C)
  \tkzFillPolygon[yellow, opacity=0.4](D,F,C)
  \tkzFillPolygon[blue, opacity=0.3](A,B,G)
  \tkzFillPolygon[blue, opacity=0.3](E,D,F)
  \tkzMarkAngles[size=0.6,fill=green](B,G,A D,F,E)
  \tkzMarkAngles[size=0.6,fill=orange](B,C,G D,C,F)
  \tkzMarkAngles[size=0.6,fill=yellow](G,B,C F,D,C)
  \tkzMarkAngles[size=0.6,fill=red](A,B,G E,D,F)
  \tkzMarkSegments[mark=|](B,C D,C)  \tkzMarkSegments[mark=s||](G,C F,C)
  \tkzMarkSegments[mark=o](A,G E,F)  \tkzMarkSegments[mark=s](B,G D,F)
  \tkzDrawSegment[color=red](A,E)
  \tkzDrawSegment[color=blue](F,G)
  \tkzDrawSegments(A,G G,B E,F F,D) 
  \tkzLabelPoints[below](C,D,E,G)    \tkzLabelPoints[above](A,B,F)  
\end{tikzpicture}
\end{tkzexample}
\end{center}   
\endinput