summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/latex/TKZdoc-euclide-segments.tex
blob: 902a4970cb2d1cb59afecab905e5534d69aa2d7d (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
%!TEX root = /Users/ego/Boulot/TKZ/tkz-euclide/doc_fr/TKZdoc-euclide-main.tex

\section{Les segments}

Il existe bien sûr, une macro pour tracer simplement un segment (il serait possible comme pour une demi-droite, de créer un style avec \tkzcname{add}) .

\subsection{Tracer un segment \tkzcname{tkzDrawSegment}} 
 \hypertarget{tds}{}      

 \begin{NewMacroBox}{tkzDrawSegment}{\oarg{local options}\parg{pt1,pt2}}
\emph{Les arguments sont une liste de deux points. Les styles de \TIKZ\ sont accessibles pour les tracés}
 
\medskip
\begin{tabular}{lll}
argument    & exemple & définition    \\
\midrule
\TAline{(pt1,pt2)}{(A,B)}{trace le segment $[A,B]$}
\bottomrule 
\end{tabular}

C'est bien sûr équivalent à \tkzcname{draw (A)--(B);} 
\end{NewMacroBox}

\subsubsection{Exemple avec des références de points}     

\begin{tkzexample}[latex=6cm]
\begin{tikzpicture}[scale=1.5]
  \tkzInit[xmin=-1,xmax=3,ymin=-1,ymax=2]
  \tkzClip
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(2,1){B}
  \tkzDrawSegment[color=red,thin](A,B)
  \tkzDrawPoints(A,B)    
  \tkzLabelPoints(A,B)  
\end{tikzpicture}
\end{tkzexample}
  

\subsubsection{Exemple avec des références de points} 
 Il est préférable de référencer les points, car les points sont
 placées en tenant compte de  \tkzcname{tkzInit}.
 
\begin{tkzexample}[latex=6cm]
\begin{tikzpicture}[scale=1.5]
  \tkzInit[xmin=-1,xmax=3,ymin=-1,ymax=2]
  \tkzClip
  \tkzDrawSegment[color=red,thin]({0,0},{2,1})  
\end{tikzpicture}
\end{tkzexample} 

\bigskip
Si les options sont les mêmes on peut tracer plusieurs \hypertarget{segs}{segments} avec la même macro. 
 
\newpage
\subsection{Tracer des segments \tkzcname{tkzDrawSegments}} 
 \hypertarget{tdss}{}      

 \begin{NewMacroBox}{tkzDrawSegments}{\oarg{local options}\parg{pt1,pt2 pt3,pt4 ...}}
\emph{Les arguments sont une liste de couple de deux points. Les styles de \TIKZ\ sont accessibles pour les tracés}
\end{NewMacroBox}

\begin{center}
\begin{tkzexample}[latex=6cm]
\begin{tikzpicture}
  \tkzInit[xmin=-1,xmax=3,ymin=-1,ymax=2]
  \tkzClip[space=1]
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(2,1){B} 
  \tkzDefPoint(3,0){C} 
  \tkzDrawSegments(A,B B,C)
  \tkzDrawPoints(A,B,C)    
  \tkzLabelPoints(A,C) 
  \tkzLabelPoints[above](B)  
\end{tikzpicture}
\end{tkzexample}
\end{center} 

\subsection{Marquer un segment \tkzcname{tkzMarkSegment}}
\hypertarget{tms}{}  
  
 \begin{NewMacroBox}{tkzMarkSegment}{\oarg{local options}\parg{pt1,pt2}} 
\emph{La macro permet de placer une marque sur un segment.}

\medskip
\begin{tabular}{lll}
\toprule
options             & défaut & définition    \\
\midrule
\TOline{pos}{.5}{position de la marque} 
\TOline{color}{black}{couleur de la marque} 
\TOline{mark}{none}{choix de la marque} 
\TOline{size}{4pt}{taille de la marque} 
\bottomrule
\end{tabular}

\emph{Les marques possibles sont celles fournies par \TIKZ, mais d'autres marques ont été crées d'après une idée de Yves Combe.}
\end{NewMacroBox} 

\subsubsection{Marques multiples}
\begin{tkzexample}[latex=6cm,small] 
\begin{tikzpicture}
  \tkzDefPoint(2,1){A}
  \tkzDefPoint(6,4){B}
  \tkzDrawSegment(A,B)
  \tkzMarkSegment[color=Maroon,size=2pt,
        pos=0.4, mark=z](A,B) 
  \tkzMarkSegment[color=blue,
        pos=0.2, mark=oo](A,B)
  \tkzMarkSegment[pos=0.8,
        mark=s,color=red](A,B) 
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Utilisation de \tkzname{mark}}      
\begin{tkzexample}[latex=6cm,small] 
\begin{tikzpicture}
  \tkzDefPoint(2,1){A} 
  \tkzDefPoint(6,4){B}
  \tkzDrawSegment(A,B)
  \tkzMarkSegment[color=gray,
                  pos=0.2,mark=s|](A,B)
  \tkzMarkSegment[color=gray,
                  pos=0.4,mark=s||](A,B)
  \tkzMarkSegment[color=Maroon,
                  pos=0.6,mark=||](A,B)
  \tkzMarkSegment[color=red,
                  pos=0.8,mark=|||](A,B)
\end{tikzpicture}
\end{tkzexample}


\subsection{Marquer des segments \tkzcname{tkzMarkSegments}}
\hypertarget{tmss}{} 
 
\begin{NewMacroBox}{tkzMarkSegments}{\oarg{local options}\parg{pt1,pt2 pt3,pt4 ...}}
\emph{Les arguments sont une liste de couple de deux points séparés par des espaces. Les styles de \TIKZ\ sont accessibles pour les tracés.}
\end{NewMacroBox} 

\subsubsection{Marques pour un triangle isocèle}      
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=1]
 \tkzDefPoints{0/0/O,2/2/A,4/0/B,6/2/C}
 \tkzDrawSegments(O,A A,B)
 \tkzDrawPoints(O,A,B)
 \tkzDrawLine(O,B)   
 \tkzMarkSegments[mark=||,size=6pt](O,A A,B)
\end{tikzpicture}
\end{tkzexample} 

\subsection{Exemple de rotation}   
\begin{center}
\begin{tkzexample}[latex=7cm,small] 
 \begin{tikzpicture}[scale=0.5]
  \tkzDefPoint(0,0){A}\tkzDefPoint(3,2){B} 
  \tkzDefPoint(4,0){C}\tkzDefPoint(2.5,1){P}
  \tkzDrawPolygon(A,B,C)
  \tkzDefEquilateral(A,P) \tkzGetPoint{P'}
  \tkzDefPointsBy[rotation=center A angle 60](P,B){P',C'}
  \tkzDrawPolygon(A,P,P')
  \tkzDrawPolySeg(P',C',A,P,B)
  \tkzDrawSegment(C,P)
  \tkzDrawPoints(A,B,C,C',P,P')
  \tkzMarkSegments[mark=s|,mark size=6pt,
  color=blue](A,P P,P' P',A) 
  \tkzMarkSegments[mark=||,color=orange](B,P P',C')
  \tkzLabelPoints(A,C) \tkzLabelPoints[below](P) 
  \tkzLabelPoints[above right](P',C',B) 
  
\end{tikzpicture} 
\end{tkzexample}  
\end{center}  
\newpage  
\hypertarget{tls}{}  
 \begin{NewMacroBox}{tkzLabelSegment}{\oarg{local options}\parg{pt1,pt2}\marg{label}}
\emph{Cette macro permet de placer une étiquette le long d'un segment ou encore d'une ligne. Les options sont celles de \TIKZ\ par exemple \tkzname{pos} } 

\medskip
\begin{tabular}{lll}
argument    & exemple & définition    \\
\midrule
\TAline{label}{\tkzcname{tkzLabelSegment(A,B)\{$5$\}}}{texte de l'étiquette} 
\TAline{(pt1,pt2)}{(A,B)}{étiquette le long de $[A,B]$} 
\bottomrule
\end{tabular}


\medskip
\begin{tabular}{lll}
options  & défaut & définition    \\
\midrule
\TOline{pos}{.5}{position du label} 
\end{tabular}
\end{NewMacroBox}  

 \subsubsection{Labels multiples}      
\begin{tkzexample}[latex=6 cm,small]
\begin{tikzpicture}
\tkzInit
\tkzDefPoint(0,0){A}
\tkzDefPoint(6,0){B}
\tkzDrawSegment(A,B)
\tkzLabelSegment[above,pos=.8](A,B){$a$}
\tkzLabelSegment[below,pos=.2](A,B){$4$}
\end{tikzpicture} 
\end{tkzexample}  

\subsubsection{Labels et Pythagore}
Cet exemple nécessite \tkzcname{usetkzobj{polygons}}
      
\begin{tkzexample}[latex=7cm]
\begin{tikzpicture}[scale=.75]
\tkzInit[xmax=5,ymax=5]
\tkzDefPoint(0,0){C}
\tkzDefPoint(4,0){A}
\tkzDefPoint(0,3){B}
\tkzDefSquare(B,A)\tkzGetPoints{E}{F}
\tkzDefSquare(A,C)\tkzGetPoints{G}{H}
\tkzDefSquare(C,B)\tkzGetPoints{I}{J}
\tkzFillPolygon[draw,
                fill = red!50 ](A,C,G,H)
\tkzFillPolygon[draw,
                fill = blue!50 ](C,B,I,J)
\tkzFillPolygon[draw,
                fill = purple!50](B,A,E,F)
\tkzFillPolygon[draw,opacity=.5,
                fill = orange](A,B,C)
\tkzDrawPolygon[line width = 1pt](A,B,C)
\tkzLabelSegment[above](C,A){$a$}
\tkzLabelSegment[right](B,C){$b$}
\tkzLabelSegment[below left](B,A){$c$}
\end{tikzpicture} 
\end{tkzexample}

\newpage 
\hypertarget{tlss}{} 
 \begin{NewMacroBox}{tkzLabelSegments}{\oarg{local options}\parg{pt1,pt2 pt3,pt4 ...}}
\emph{Les arguments sont une liste de couple de deux points. Les styles de \TIKZ\ sont accessibles pour les tracés.}
\end{NewMacroBox} 
 
\subsubsection{Labels pour un triangle isocèle}      
\begin{center}
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=1]
 \tkzDefPoints{0/0/O,2/2/A,4/0/B,6/2/C}
 \tkzDrawSegments(O,A A,B)
 \tkzDrawPoints(O,A,B)
 \tkzDrawLine(O,B)   
 \tkzLabelSegments[color=red,above=4pt](O,A A,B){$a$}
\end{tikzpicture}
\end{tkzexample}  
\end{center}   
\endinput