summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-marking.tex
blob: 97bf596219009334e6dd1246219af40c1a02c23b (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
\subsection{Mark a segment \tkzcname{tkzMarkSegment}}
\hypertarget{tms}{}  
  
 \begin{NewMacroBox}{tkzMarkSegment}{\oarg{local options}\parg{pt1,pt2}}% 
The macro allows you to place a mark on a segment.

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition   \\
\midrule
\TOline{pos}{.5}{position of the mark} 
\TOline{color}{black}{color of the mark} 
\TOline{mark}{none}{choice of the mark} 
\TOline{size}{4pt}{size of the mark}
\bottomrule
\end{tabular}

Possible marks are those provided by \TIKZ, but other marks have been created based on an idea by Yves Combe.
\end{NewMacroBox} 

\subsubsection{Several marks }
\begin{tkzexample}[latex=5cm,small] 
\begin{tikzpicture}
  \tkzDefPoint(2,1){A}
  \tkzDefPoint(6,4){B}
  \tkzDrawSegment(A,B)
  \tkzMarkSegment[color=brown,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{Use of \tkzname{mark}}      
\begin{tkzexample}[latex=5cm,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=brown,pos=0.6,mark=||](A,B)
  \tkzMarkSegment[color=red,pos=0.8,mark=|||](A,B)
\end{tikzpicture}
\end{tkzexample}


\subsection{Marking segments \tkzcname{tkzMarkSegments}}
\hypertarget{tmss}{} 
 
\begin{NewMacroBox}{tkzMarkSegments}{\oarg{local options}\parg{pt1,pt2 pt3,pt4 ...}}%
Arguments are a list of pairs of points separated by spaces. The styles of \TIKZ\ are available for plots.
\end{NewMacroBox} 

\subsubsection{Marks for an isosceles triangle}      
\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{Another marking}   
\begin{tkzexample}[latex=5cm,small] 
 \begin{tikzpicture}[scale=1]
  \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|,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}  

\subsection{Mark an arc \tkzcname{tkzMarkArc}}
\hypertarget{tms}{}  
  
 \begin{NewMacroBox}{tkzMarkArc}{\oarg{local options}\parg{pt1,pt2,pt3}}% 
The macro allows you to place a mark on an arc. pt1 is the center, pt2 and pt3 are the endpoints of the arc.

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition   \\
\midrule
\TOline{pos}{.5}{position of the mark} 
\TOline{color}{black}{color of the mark} 
\TOline{mark}{none}{choice of the mark} 
\TOline{size}{4pt}{size of the mark}
\bottomrule
\end{tabular}

Possible marks are those provided by \TIKZ, but other marks have been created based on an idea by Yves Combe.
\begin{tkzltxexample}[]
|, ||,|||, z, s, x, o, oo 
\end{tkzltxexample}
\end{NewMacroBox} 

\subsubsection{Several marks }
\begin{tkzexample}[latex=7cm,small] 
\begin{tikzpicture}
\tkzDefPoint(0,0){O}
\pgfmathsetmacro\r{2}
\tkzDefPoint(30:\r){A}
\tkzDefPoint(85:\r){B}
\tkzDrawCircle(O,A)
\tkzMarkArc[color=red,mark=||](O,A,B)
\tkzDrawPoints(B,A,O)
\end{tikzpicture}
\end{tkzexample}

 
\subsection{Mark an angle mark : {\tkzcname{tkzMarkAngle}}}
More delicate operation because there are many options. The symbols used for marking in addition to those of \TIKZ\ are defined in the file |tkz-lib-marks.tex| and designated by the following characters:\begin{tkzltxexample}[]
|, ||,|||, z, s, x, o, oo 
\end{tkzltxexample}



%                \tkzMarkAngle(B, A, C)
%
% Angle mark
% arc de cercle (simple/double/triple) et mark of equality.
%
% By default: 
%                 arc       = simple
%                 mksize  = 1 (radius of the arc)
%                 style traits pleins
%                 mkpos ?  position: 0.5 (mark position)
%                 mark   none
%
% Parameters (optional)
%             arc     : l, ll, lll
%             mksize  : 1
%             gap     : 3pt
%             dist    : 1?
%             style   : type of lines
%             mkpos   : 0.5
%             mark    : none  , |, ||,|||, z, s, x, o, oo mais tous les 
%  % tikz symbols are allowed

\begin{NewMacroBox}{tkzMarkAngle}{\oarg{local options}\parg{A,O,B}}%
$O$ is the vertex. Attention the arguments vary according to the options. Several markings are possible. You can simply draw an arc or  add a mark on this arc. The style of the arc is chosen with the option \tkzname{arc}, the radius of the arc is given by \tkzname{mksize}, the arc can, of course, be colored.

\medskip

\begin{tabular}{lll}%
\toprule
options             & default & definition                        \\ 
\midrule
\TOline{arc}{l}{choice of l, ll and lll (single, double or triple).}
\TOline{size}{1 (cm)}{arc radius.}
\TOline{mark}{none}{choice of mark.}
\TOline{mksize}{4pt}{symbol size (mark).}
\TOline{mkcolor}{black}{symbol color (mark).}
\TOline{mkpos}{0.5}{position of the symbol on the arc.}
\end{tabular} 
\end{NewMacroBox}  

\DeleteShortVerb{\|}
\subsubsection{Example with \tkzname{mark = x} and with \tkzname{mark =||}}

\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=.75]
    \tkzDefPoints{0/0/O,5/0/A,3/4/B}
    \tkzMarkAngle[size = 4,mark = x,
                  arc=ll,mkcolor = red,mkpos=.33](A,O,B)
    \tkzMarkAngle[size = 2,mark = ||,
                arc=ll,mkcolor = blue,mkpos=.66](A,O,B)
    \tkzDrawLines(O,A O,B)
    \tkzDrawPoints(O,A,B)
\end{tikzpicture}
\end{tkzexample}

\MakeShortVerb{\|}
\begin{NewMacroBox}{tkzMarkAngles}{\oarg{local options}\parg{A,O,B}\parg{A',O',B'}etc.}%
With common options, there is a macro for multiple angles.
  \end{NewMacroBox}  

\subsection{Problem to mark a small angle: {\tkzname{Option veclen}}}\label{opt-veclen}
  The problem comes from the "decorate" action and  from the value used in size in 
  \tkzcname{tkzMarkAngle}. The solution is to enclose the macro  \tkzcname{tkzMarkAngle}.
  In the next example without the "scope" the result is :  Latex Error:  Dimension too large.
  
  \begin{tkzexample}[latex=6cm,small]
    \begin{tikzpicture}[scale=1]
      \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[common=B](M,B)(O,B) \tkzGetFirstPoint{C}
      \tkzInterLC[common=A](M,A)(O,A) \tkzGetFirstPoint{A'}
      \tkzDrawSegments(A,C M,A M,B A,B)
      \tkzDrawCircle(O,N)
      \begin{scope}[veclen]
        \tkzMarkAngle[mkpos=.2, size=1.2](C,A,M)
      \end{scope}
      \tkzDrawPoints(O, A, B, M, B, C, A')
      \tkzLabelPoints[right](O,A,B)
      \tkzLabelPoints[above left](M,C)
      \tkzLabelPoint[below left](A'){$A'$}
    \end{tikzpicture}
  \end{tkzexample}

  
\subsection{Marking a right angle: {\tkzcname{tkzMarkRightAngle}}}

\begin{NewMacroBox}{tkzMarkRightAngle}{\oarg{local options}\parg{A,O,B}}%
The \tkzname{german} option allows you to change the style of the drawing. The option \tkzname{size} allows to change the size of the drawing.

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition         \\ 
\midrule
\TOline{german}{normal}{ german arc with inner point.}
\TOline{size}{0.2}{ side size.}
\end{tabular} 
\end{NewMacroBox}  

\subsubsection{Example of marking a right angle} 
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}
  \tkzDefPoints{0/0/A,3/1/B,0.9/-1.2/P}
  \tkzDefPointBy[projection = onto B--A](P)  \tkzGetPoint{H}
  \tkzDrawLines[add=.5 and .5](P,H)
  \tkzMarkRightAngle[fill=blue!20,size=.5,draw](A,H,P) 
  \tkzDrawLines[add=.5 and .5](A,B)
  \tkzMarkRightAngle[fill=red!20,size=.8](B,H,P)
  \tkzDrawPoints[](A,B,P,H)  
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Example of marking a right angle, german style} 
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}
  \tkzDefPoints{0/0/A,3/1/B,0.9/-1.2/P}
  \tkzDefPointBy[projection = onto B--A](P)  \tkzGetPoint{H}
  \tkzDrawLines[add=.5 and .5](P,H)
  \tkzMarkRightAngle[german,size=.5,draw](A,H,P) 
  \tkzDrawPoints[](A,B,P,H) 
  \tkzDrawLines[add=.5 and .5](A,B)
  \tkzMarkRightAngle[german,size=.8](P,H,B) 
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Mix of styles} 
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(4,1){B}
  \tkzDefPoint(2,5){C}
  \tkzDefPointBy[projection=onto B--A](C) 
      \tkzGetPoint{H}
  \tkzDrawLine(A,B)
  \tkzDrawLine[add = .5 and .2,color=red](C,H)
  \tkzMarkRightAngle[,size=1,color=red](C,H,A)
  \tkzMarkRightAngle[german,size=.8,color=blue](B,H,C)
  \tkzFillAngle[opacity=.2,fill=blue!20,size=.8](B,H,C)
  \tkzLabelPoints(A,B,C,H)
  \tkzDrawPoints(A,B,C,H)
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Full example} 

\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[rotate=-90]
\tkzDefPoint(0,1){A}
\tkzDefPoint(2,4){C}
\tkzDefPointWith[orthogonal normed,K=7](C,A)
\tkzGetPoint{B}
\tkzDrawSegment[green!60!black](A,C)
\tkzDrawSegment[green!60!black](C,B)
\tkzDrawSegment[green!60!black](B,A)
\tkzDefSpcTriangle[orthic](A,B,C){N,O,P}
\tkzDrawLine[dashed,color=magenta](C,P)
\tkzLabelPoint[left](A){$A$}
\tkzLabelPoint[right](B){$B$}
\tkzLabelPoint[above](C){$C$}
\tkzLabelPoint[left](P){$P$}
\tkzLabelSegment[auto](B,A){$c$}
\tkzLabelSegment[auto,swap](B,C){$a$}
\tkzLabelSegment[auto,swap](C,A){$b$}
\tkzMarkAngle[size=1,color=cyan,mark=|](C,B,A)
\tkzMarkAngle[size=1,color=cyan,mark=|](A,C,P)
\tkzMarkAngle[size=0.75,color=orange,
    mark=||](P,C,B)
\tkzMarkAngle[size=0.75,color=orange,
   mark=||](B,A,C)
\tkzMarkRightAngle[german](A,C,B)
\tkzMarkRightAngle[german](B,P,C)
\end{tikzpicture} 
\end{tkzexample} 

\subsection{\tkzcname{tkzMarkRightAngles}}
\begin{NewMacroBox}{tkzMarkRightAngles}{\oarg{local options}\parg{A,O,B}\parg{A',O',B'}etc.}%
With common options, there is a macro for multiple angles.
\end{NewMacroBox}

\subsection{Angles Library} % (fold)
\label{sub:angles_library}

If you prefer to use  \TIKZ\ library \tkzname{angles}, you can mark angles with the macro \tkzcname{tkzPicAngle} and \tkzcname{tkzPicRightAngle}.

\begin{NewMacroBox}{tkzPicAngle}{\oarg{tikz options}\parg{A,O,B}}%
  
\medskip
\begin{tabular}{lll}%
\toprule
options             & example & definition         \\ 
\midrule
\TOline{tikz option}{see below}{drawing of the angle $\widehat{AOB}$.}
\end{tabular} 
\end{NewMacroBox}  

\begin{NewMacroBox}{tkzPicRightAngle}{\oarg{tikz options}\parg{A,O,B}}%
  
\medskip
\begin{tabular}{lll}%
\toprule
options             & example & definition         \\ 
\midrule
\TOline{tikz option}{see below}{drawing of the right angle $\widehat{AOB}$.}
\end{tabular} 

\medskip
\emph{You need to know possible options of the \tkzname{angles} library}
\end{NewMacroBox} 

\subsubsection{Angle with \TIKZ} % (fold)
\label{ssub:angle_with_tikz}


\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}
  \tkzDefPoints{0/0/A,4/0/B}
  \tkzDefTriangle[right,swap](A,B) \tkzGetPoint{C}
  \tkzDrawPolygon(A,B,C)
  \tkzDrawPoints(A,B,C)
  \tkzLabelPoints[below](B,A)
  \tkzLabelPoints[above right](C)
  \tkzPicAngle["$\alpha$",draw=orange,
               <->,angle eccentricity=1.2,
               angle radius=1cm](B,A,C)
  \tkzPicRightAngle[draw,red,thick,
                angle eccentricity=.5,
                pic text=.](C,B,A)
  \end{tikzpicture}
\end{tkzexample}

% subsubsection angle_with_tikz (end)
% subsection angles_library (end)
\endinput