summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/latex/TKZdoc-euclide-intersec.tex
blob: ef697668a7d4ce4212dab107c1a523c8412ddf89 (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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
%!TEX root = /Users/ego/Boulot/TKZ/tkz-euclide/doc_fr/TKZdoc-euclide-main.tex


\section{Intersections}



Il est possible de déterminer les coordonnées des points d'intersection entre deux droites, une droite et un cercle et deux cercles.

Les commandes associées n'ont pas d'arguments optionnels et l'usager doit lui même déterminer l'existence des points d'intersection.


\subsection{Intersection de deux droites}


 \begin{NewMacroBox}{tkzInterLL}{\parg{$A,B$}\parg{$C,D$}}
\emph{Définit le point d'intersection \tkzname{tkzPointResult} des deux droites $(AB)$ and $(CD)$. Les points connus sont donnés en couple (deux par droite) entre parenthèses, quant au point obtenu, son nom est placé entre accolades.}       

 \end{NewMacroBox}   
% 

\medskip
\subsubsection{exemple d'intersection entre deux droites}
\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[rotate=-30]
   \tkzDefPoint(2,1){A}   \tkzDefPoint(6,5){B}
   \tkzDefPoint(3,6){C}   \tkzDefPoint(5,2){D}
   \tkzDrawLines(A,B C,D)
   \tkzInterLL(A,B)(C,D)  \tkzGetPoint{I}
   \tkzDrawPoints[color=blue](A,B,C,D) \tkzDrawPoint[color=red](I)
\end{tikzpicture}
\end{tkzexample}
\end{center}  

De nombreux points particuliers sont obtenus avec cette macro par exemple l'orthocentre (OrthoCenter) voir \tkzcname{tkzOrthoCenter}, le centre du cercle circonscrit à un triangle \tkzcname{tkzCircumCenter}. 

\newpage
\subsection{Intersection d'une droite et d'un cercle} % (fold)
\label{sub:intersection_d_une_droite_et_d_un_cercle}
Pour avoir une syntaxe homogène, l'option pour définir le cercle à l'aide de la mesure du rayon est \tkzname{R} comme pour les macros pour  le cercle , les arcs et les secteurs.    

Comme précédemment, la droite est définie par un couple de points. Le cercle
 est aussi défini par un un couple :
 \begin{itemize}
  \item $(O,C)$ qui est un couple de points, le premier désigne le centre et le second est un point quelconque du cercle.
  \item $(O,r)$  La mesure $r$ est celle du rayon. Elle est exprimée soint en \emph{cm}, soit en \emph{pt}.
 \end{itemize}
 

\begin{NewMacroBox}{tkzInterLC}{\parg{$A,B$}\parg{$O,C/r$}\marg{$I$}\marg{$J$}}
Les arguments sont donc deux couples. Le premier couple est un couple de points, le second est soit un couple de points si aucune option n'est utilisée ou bien si l'option \tkzname{N} est utilisée sinon le couple est constitué d'un point (le centre du cercle et d'une mesure, celle du rayon).

\medskip
\begin{tabular}{lll}
\toprule
options            & défaut  & définition                         \\ 
\midrule
\TOline{N}        {N}    { (O,C) détermine le cercle}
\TOline{R}        {N}    { (O, 1 cm) ou (O, 120 pt)}  
\bottomrule
\end{tabular}

\medskip   
\emph{La macro définit les points d' intersection $I$ et $J$ de la droite $(AB)$ et du cercle de centre $O$ de rayon $r$ s'ils existent; dans le cas contraire, une erreur sera signalée dans le fichier .log}
\end{NewMacroBox}

\subsubsection{Exemple simple d'intersection droite-cercle}

Dans l'exemple suivant, le tracé du cercle utilise deux points et  l'intersection de la droite et du cercle utilise deux couples de points

\begin{tkzexample}[latex=7cm]
\begin{tikzpicture}
   \tkzInit[xmax=5,ymax=4]
 \tkzDefPoint(1,1){O} 
 \tkzDefPoint(0,4){A} 
 \tkzDefPoint(5,0){B} 
 \tkzDefPoint(3,3){C}
 \tkzInterLC(A,B)(O,C)  \tkzGetPoints{D}{E}  
 \tkzDrawCircle(O,C)
 \tkzDrawPoints[color=blue](O,A,B,C)
 \tkzDrawPoints[color=red](D,E)
 \tkzDrawLine(A,B)
 \tkzLabelPoints[above right](O,A,B,C,D,E)
\end{tikzpicture} 
\end{tkzexample}  

\subsubsection{Exemple plus complexe d'intersection droite-cercle}
\url{http://gogeometry.com/problem/p190_tangent_circle}

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.25]
  \tkzInit[xmin=0,xmax=8,ymin=-4,ymax=4]  \tkzClip[space=.4]
  \tkzDefPoint(0,0){A}  \tkzDefPoint(8,0){B}
  \tkzDefMidPoint(A,B)  \tkzGetPoint{O}
  \tkzDrawCircle(O,B)
  \tkzDefMidPoint(O,B)  \tkzGetPoint{O'}
  \tkzDrawCircle(O',B)
  \tkzTangent[from=A](O',B) \tkzGetSecondPoint{E}
  \tkzInterLC(A,E)(O,B)     \tkzGetSecondPoint{D}
  \tkzDefPointBy[projection=onto A--B](D)  \tkzGetPoint{F}
  \tkzMarkRightAngle(D,F,B)
  \tkzDrawSegments(A,D A,B D,F) 
  \tkzDrawSegments[color=red,line width=1pt,opacity=.4](A,O F,B)
  \tkzDrawPoints(A,B,O,O',E,D)  \tkzLabelPoints(A,B,O,O',E,D) 
\end{tikzpicture}
\end{tkzexample}
\end{center}

 

\newpage
\subsubsection{Cercle défini par un centre et une mesure, et cas particuliers}
Regardons quelques cas particuliers comme des droites tangentes au cercle. 

\begin{center}
 
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoint(0,8){A}  \tkzDefPoint(8,0){B}
  \tkzDefPoint(8,8){C}  \tkzDefPoint(4,4){I}
  \tkzDefPoint(2,7){E}  \tkzDefPoint(6,4){F}  
  \tkzDrawCircle[R](I,4 cm)
  \tkzInterLC[R](A,C)(I,4 cm)  \tkzGetPoints{I1}{I2}
  \tkzInterLC[R](B,C)(I,4 cm)  \tkzGetPoints{J1}{J2}
  \tkzInterLC[R](A,B)(I,4 cm)  \tkzGetPoints{K1}{K2}
  \tkzDrawPoints[color=red](I1,J1,K1,K2)
  \tkzDrawLines(A,B B,C A,C)
  \tkzInterLC[R](E,F)(I,4 cm)  \tkzGetPoints{I2}{J2}  
  \tkzDrawPoints[color=blue](E,F)
  \tkzDrawPoints[color=red](I2,J2)
  \tkzDrawLine(I2,J2)\end{tikzpicture}
\end{tkzexample}  
 
\end{center}

\newpage
\subsubsection{Exemple plus complexe}
Attention à la syntaxe. Tout d'abord, les calculs pour les points peuvent être faits pendant le passage des arguments, mais il faut respecter la syntaxe de \tkzname{fp}. Vous pouvez constater que j'utilise la macro  \tkzcname{FPpi} car \tkzname{fp} travaille en radians !. De plus quand des calculs nécéssitent l'emploi de parenthèses, celles-ci doivent être insérées dans un groupe \TEX \{ \dots \}.


\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=2.5,rotate=180]
  \tkzDefPoint(0,1){J} \tkzDefPoint(0,0){O}
  \tkzDrawCircle[R](O,1 cm)
  \tkzDrawArc[R,line width=1pt,color=Gold](J,2.5 cm)(180,0)
  \foreach \i in {0,-5,-10,...,-85}{
     \tkzDefPoint({2.5*cos(\i*\FPpi/180)},{1+2.5*sin(\i*\FPpi/180)}){P}
     \tkzDrawSegment[color=orange](J,P)
     \tkzInterLC[R](P,J)(O,1 cm) \tkzGetPoints{M}{N}
     \tkzDrawPoints(N)} 
  \foreach \i in {-90,-95,...,-175,-180}{
    \tkzDefPoint({2.5*cos(\i*\FPpi/180)},{1+2.5*sin(\i*\FPpi/180)}){P} 
    \tkzDrawSegment[color=orange](J,P)
    \tkzInterLC[R](P,J)(O,1 cm) \tkzGetPoints{M}{N}
    \tkzDrawPoints(M)}   
\end{tikzpicture}
\end{tkzexample} 
\end{center}

\newpage
\subsubsection{Calcul de la mesure du rayon} 
 Avec \tkzname{pgfmath} et \tkzcname{pgfmathsetmacro}   
 
La mesure du rayon peut être le résultat d'un calcul que l'on ne fera pas au sein de la macro d'intersection, mais avant. 
On peut calculer une longueur de plusieurs façons. Il est possible bien sûr,
 d'utiliser le module \tkzname{pgfmath} et la macro \tkzcname{pgfmathsetmacro}. Dans certains, les résultats obtenus ne sont pas assez précis ainsi le calcul suivant $0.0002 \div 0.0001$ donne 1.98 avec pgfmath alors que fp.sty donnera 2. C'est pour cela que j'ai préféré interdire le calcul pendant le passage de paramètres, cela permet à chacun de choisir sa méthode.
   
\begin{tkzexample}[latex=7cm]
\begin{tikzpicture}  
  \tkzDefPoint(2,2){A}
  \tkzDefPoint(5,4){B}
  \tkzDefPoint(4,4){O}
  \pgfmathsetmacro{\tkzLen}{0.0002/0.0001}
  \tkzDrawCircle[R](O,\tkzLen cm)
  \tkzInterLC[R](A,B)(O, \tkzLen cm) 
  \tkzGetPoints{I}{J}
  \tkzDrawPoints[color=blue](A,B)
  \tkzDrawPoints[color=red](I,J)
  \tkzDrawLine(I,J) 
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Calcul de la mesure du rayon} 
Avec \tkzname{fp} et \tkzcname{FPeval}
  
\begin{tkzexample}[latex=7cm]
  \begin{tikzpicture}  
  \tkzDefPoint(2,2){A}
  \tkzDefPoint(5,4){B}
  \tkzDefPoint(4,4){O}
  \FPeval{\tkzLen}{0.0002/0.0001} 
  \tkzDrawCircle[R](O,\tkzLen cm)
  \tkzInterLC[R](A,B)(O, \tkzLen cm) 
  \tkzGetPoints{I}{J}
  \tkzDrawPoints[color=blue](A,B)
  \tkzDrawPoints[color=red](I,J)
  \tkzDrawLine(I,J) 
\end{tikzpicture}
  \end{tkzexample}

\subsubsection{Calcul de la mesure du rayon} 
 Avec \TEX\ et \tkzcname{tkzLength}. 
 
 Cette dimension a été créée avec \tkzcname{newdimen}. 2 cm a été transformé en points. Il est bien sûr possible  d'utiliser \TEX\ pour calculer.

\begin{tkzexample}[latex=7cm]   
\begin{tikzpicture}
  \tkzDefPoint(2,2){A}
  \tkzDefPoint(5,4){B}
  \tkzDefPoint(4,4){O}
  \tkzLength=2cm 
  \tkzDrawCircle[R](O,\tkzLength pt)
  \tkzInterLC[R](A,B)(O, \tkzLength pt)
   \tkzGetPoints{I}{J}
  \tkzDrawPoints[color=blue](A,B)
  \tkzDrawPoints[color=red](I,J)
  \tkzDrawLine(I,J) 
\end{tikzpicture}
\end{tkzexample} 



\subsubsection{Des carrés dans un demi-disque}
Un air de Sangaku ! Il s'agit de prouver que l'on peut inscrire dans un demi-disque, deux carrés, et de déterminer la longueur de leurs côtés respectifs en fonction du rayon.

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.5]
 \tkzInit[xmax=8,ymax=5]\tkzClip[space=.25] 
 \tkzDefPoint(0,0){A}
 \tkzDefPoint(8,0){B}
 \tkzDefPoint(4,0){I}
 \tkzDefSquare(A,B)    
   \tkzGetPoints{C}{D}
 \tkzInterLC(I,C)(I,B) 
   \tkzGetPoints{E'}{E}
 \tkzInterLC(I,D)(I,B) 
   \tkzGetPoints{F'}{F} 
 \tkzDefPointsBy[projection = onto A--B](E,F){H,G}
 \tkzDefPointsBy[symmetry   = center H](I){J}
 \tkzDefSquare(H,J)
   \tkzGetPoints{K}{L}
 \tkzDrawSector[fill=Maroon!30](I,B)(A)
 \tkzFillPolygon[color=red!40](H,E,F,G)
 \tkzFillPolygon[color=blue!40](H,J,K,L)
 \tkzDrawPolySeg[color=red](H,E,F,G) 
 \tkzDrawPolySeg[color=red](J,K,L)
 \tkzDrawPoints(E,G,H,F,J,K,L)
\end{tikzpicture}
\end{tkzexample}      
\end{center}


\clearpage \newpage
\subsection{Intersection de deux cercles} 

Le cas le plus fréquent est celui de deux cercles définis par leur centre et un point, mais comme précédemment l'option \tkzname{R} permet d'utiliser les mesures des rayons

\begin{NewMacroBox}{tkzInterCC}{\oarg{options}\parg{$O,A/r$}\parg{$O',A'/r'$}\marg{$I$}\marg{$J$}}

\medskip
\begin{tabular}{lll}
\toprule
options       & défaut  & définition                         \\ 
\midrule
\TOline{N}   {N}    {OA et O'A' sont des rayons, O et O' les centres}
\TOline{R}   {N}    {$r$ et $r'$ sont des dimensions et mesurent les rayons}   
\bottomrule
\end{tabular}

\medskip
\noindent
\emph{Cette macro définit le(s) point(s) d' intersection $I$ et $J$ des deux cercles de centre $O$ et $O'$. Si les deux cercles n'ont pas de point commun alors la macro se termine par une erreur qui n'est pas gérée. \\ 
Il est également possible d'utiliser directement \tkzcname{tkzInterCCN} et  \tkzcname{tkzInterCCR}.}
\end{NewMacroBox}   

\subsubsection{Construction d'un triangle connaissant les mesures des côtés}
On veut obtenir le triangle de Pythagore (3,4,5)  
\begin{center}
\begin{tkzexample}[vbox]  
\begin{tikzpicture}[scale=.8]
  \tkzDefPoint(0,0){A} \tkzDefPoint(5,0){B}
  \tkzDrawCircle[R,dashed](A,4 cm) \tkzDrawCircle[R,dashed](B,3 cm)
  \tkzInterCC[R](A,4 cm)(B,3 cm) \tkzGetPoints{C}{D}
  \tkzDrawPolygon(A,B,C)
  \tkzCompasss(A,C B,C) 
  \tkzLabelSegment[below](A,B){$5$ cm}
  \tkzLabelSegment[above left](A,C){$4$ cm}
  \tkzLabelSegment[above right](B,C){$3$ cm}
  \tkzDrawPoints[color=red](C) 
  \tkzDrawPoints[color=blue](A,B)
\end{tikzpicture}
\end{tkzexample}
\end{center}

\subsubsection{Dupliquer un triangle} 
Trois segments étant donnés, construire un triangle. Il s'agit de récupérer les mesures des longueurs avec \tkzcname{tkzCalcLength}.

\begin{tkzexample}[vbox]
\begin{tikzpicture}
 \tkzDefPoint(1,0){A}  \tkzDefPoint(4,0){B}   % On place les points   
 \tkzDefPoint(1,1){C}  \tkzDefPoint(5,1){D}
 \tkzDefPoint(1,2){E}  \tkzDefPoint(6,2){F}
 \tkzDefPoint(0,4){A'} \tkzDefPoint(3,4){B'}
 \tkzCalcLength[cm](C,D)\tkzGetLength{rCD}
 \tkzCalcLength[cm](E,F)\tkzGetLength{rEF}
 \tkzInterCC[R](A',\rCD cm)(B',\rEF cm)\tkzGetPoints{I}{J}
 \tkzDrawSegments[red](A,B C,D E,F) % Les tracés   
 \tkzDrawLine(A',B')    
 \tkzDrawPoints(D,E,I,J)
 \tkzDrawPolygon[color=red](A',B',I)
 \tkzSetUpLine[color=gray]
 \tkzCompass(A',B')
 \tkzDrawCircle[R](A',\rCD cm)
 \tkzDrawCircle[R](B',\rEF cm)
 \tkzDrawPoints(A,B,C,D,E,F,A',B',I)
 \tkzLabelPoints[left](A,C,E)
 \tkzLabelPoints[right](B,D,F)
 \tkzLabelPoints[below](A',B')
 \tkzLabelPoint[above left](I){$C'$}   
\end{tikzpicture} 
\end{tkzexample}

\subsubsection{Construction d'un triangle équilatéral}

\begin{tkzexample}[vbox] 
\begin{tikzpicture}[rotate=30] 
 \tkzDefPoint(1,1){A}
 \tkzDefPoint(5,1){B}
 \tkzInterCC(A,B)(B,A)\tkzGetPoints{C}{D}
 \tkzDrawPoint[color=black](C)
 \tkzDrawCircle[dashed](A,B)
 \tkzDrawCircle[dashed](B,A)
 \tkzCompass[color=red](A,C)
 \tkzCompass[color=red](B,C)
 \tkzDrawPolygon(A,B,C)
 \tkzLabelSegment[above left](A,C){$4$ cm}
 \tkzLabelSegment[above right](B,C){$4$ cm}
 \tkzLabelSegment[below](A,B){$4$ cm} 
 \tkzLabelPoints[](A,B)
 \tkzLabelPoint[above](C){$C$} 
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Un triangle isocèle.}

\begin{tkzexample}[vbox]
\begin{tikzpicture}[rotate=30] 
 \tkzDefPoint(1,2){A}
 \tkzDefPoint(5,1){B}
 \tkzInterCC[R](A,5cm)(B,5cm)\tkzGetPoints{C}{D}
 \tkzDrawCircle[R,dashed](A,5 cm)
 \tkzDrawCircle[R,dashed](B,5 cm) 
 \tkzDrawPoint[color=blue](C) 
 \tkzCompass[color=red](A,C)
 \tkzCompass[color=red](B,C)
 \tkzDrawPolygon(A,B,C)
 \tkzLabelSegment[above left](A,C){$5$ cm}
 \tkzLabelSegment[above right](B,C){$5$ cm}
 \tkzLabelPoints[](A,B)
 \tkzLabelPoint[above](C){$C$}     
\end{tikzpicture}
\end{tkzexample} 

\subsubsection{Exemple une médiatrice}

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}
  \tkzDefPoint(0,0){A} 
  \tkzDefPoint(3,3){B}  
  \tkzDrawCircle[color=blue](B,A)
  \tkzDrawCircle[color=blue](A,B)
  \tkzInterCC(B,A)(A,B)\tkzGetPoints{M}{N}
  \tkzDrawLine(A,B)
  \tkzDrawPoints(M,N)
  \tkzDrawLine[color=red](M,N)
\end{tikzpicture}
\end{tkzexample}
\end{center} 

\newpage
\subsubsection{Trisection d'un segment}
Voici un exemple complet utilisant toutes les macros précédentes. Il s'agit de partager avec une règle et un compas, un segment en trois segments de même longueur. 

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=.8] 
 \tkzDefPoint(0,0){A}  \tkzDefPoint(3,2){B}
 \tkzInterCC(A,B)(B,A) \tkzGetPoints{C}{D}
 \tkzInterCC(D,B)(B,A) \tkzGetPoints{A}{E}  
 \tkzInterCC(D,B)(A,B) \tkzGetPoints{F}{B}
 \tkzInterLC(E,F)(F,A) \tkzGetPoints{D}{G}   
 \tkzInterLL(A,G)(B,E) \tkzGetPoint{O}      
 \tkzInterLL(O,D)(A,B) \tkzGetPoint{J}
 \tkzInterLL(O,F)(A,B) \tkzGetPoint{I}
 \tkzDrawCircle(D,A)    \tkzDrawCircle(A,B)
 \tkzDrawCircle(B,A)    \tkzDrawCircle(F,A)
 \tkzDrawSegments[color=red](O,G O,B O,D O,F)
 \tkzDrawPoints(A,B,D,E,F,G,I,J)  \tkzLabelPoints(A,B,D,E,F,G,I,J)
 \tkzDrawSegments[blue](A,B B,D A,D A,F F,G E,G B,E)
 \tkzMarkSegments[mark=s|](A,I I,J J,B)
\end{tikzpicture}
\end{tkzexample} 
\end{center}
 
 \endinput