Debian Codegraph @

texmf-dist/doc/latex/tkz-euclide/TKZdoc-euclide-marking.tex

raw
1 \subsection{Mark a segment \tkzcname{tkzMarkSegment}}
2 \hypertarget{tms}{}
3
4 \begin{NewMacroBox}{tkzMarkSegment}{\oarg{local options}\parg{pt1,pt2}}%
5 The macro allows you to place a mark on a segment.
6
7 \medskip
8 \begin{tabular}{lll}%
9 \toprule
10 options & default & definition \\
11 \midrule
12 \TOline{pos}{.5}{position of the mark}
13 \TOline{color}{black}{color of the mark}
14 \TOline{mark}{none}{choice of the mark}
15 \TOline{size}{4pt}{size of the mark}
16 \bottomrule
17 \end{tabular}
18
19 Possible marks are those provided by \TIKZ, but other marks have been created based on an idea by Yves Combe.
20 \end{NewMacroBox}
21
22 \subsubsection{Several marks }
23 \begin{tkzexample}[latex=5cm,small]
24 \begin{tikzpicture}
25 \tkzDefPoint(2,1){A}
26 \tkzDefPoint(6,4){B}
27 \tkzDrawSegment(A,B)
28 \tkzMarkSegment[color=brown,size=2pt,pos=0.4, mark=z](A,B)
29 \tkzMarkSegment[color=blue,pos=0.2, mark=oo](A,B)
30 \tkzMarkSegment[pos=0.8,mark=s,color=red](A,B)
31 \end{tikzpicture}
32 \end{tkzexample}
33
34 \subsubsection{Use of \tkzname{mark}}
35 \begin{tkzexample}[latex=5cm,small]
36 \begin{tikzpicture}
37 \tkzDefPoint(2,1){A}
38 \tkzDefPoint(6,4){B}
39 \tkzDrawSegment(A,B)
40 \tkzMarkSegment[color=gray,pos=0.2,mark=s|](A,B)
41 \tkzMarkSegment[color=gray,pos=0.4,mark=s||](A,B)
42 \tkzMarkSegment[color=brown,pos=0.6,mark=||](A,B)
43 \tkzMarkSegment[color=red,pos=0.8,mark=|||](A,B)
44 \end{tikzpicture}
45 \end{tkzexample}
46
47
48 \subsection{Marking segments \tkzcname{tkzMarkSegments}}
49 \hypertarget{tmss}{}
50
51 \begin{NewMacroBox}{tkzMarkSegments}{\oarg{local options}\parg{pt1,pt2 pt3,pt4 ...}}%
52 Arguments are a list of pairs of points separated by spaces. The styles of \TIKZ\ are available for plots.
53 \end{NewMacroBox}
54
55 \subsubsection{Marks for an isosceles triangle}
56 \begin{tkzexample}[latex=6cm,small]
57 \begin{tikzpicture}[scale=1]
58 \tkzDefPoints{0/0/O,2/2/A,4/0/B,6/2/C}
59 \tkzDrawSegments(O,A A,B)
60 \tkzDrawPoints(O,A,B)
61 \tkzDrawLine(O,B)
62 \tkzMarkSegments[mark=||,size=6pt](O,A A,B)
63 \end{tikzpicture}
64 \end{tkzexample}
65
66 \subsection{Another marking}
67 \begin{tkzexample}[latex=5cm,small]
68 \begin{tikzpicture}[scale=1]
69 \tkzDefPoint(0,0){A}\tkzDefPoint(3,2){B}
70 \tkzDefPoint(4,0){C}\tkzDefPoint(2.5,1){P}
71 \tkzDrawPolygon(A,B,C)
72 \tkzDefEquilateral(A,P) \tkzGetPoint{P'}
73 \tkzDefPointsBy[rotation=center A angle 60](P,B){P',C'}
74 \tkzDrawPolygon(A,P,P')
75 \tkzDrawPolySeg(P',C',A,P,B)
76 \tkzDrawSegment(C,P)
77 \tkzDrawPoints(A,B,C,C',P,P')
78 \tkzMarkSegments[mark=s|,size=6pt,
79 color=blue](A,P P,P' P',A)
80 \tkzMarkSegments[mark=||,color=orange](B,P P',C')
81 \tkzLabelPoints(A,C) \tkzLabelPoints[below](P)
82 \tkzLabelPoints[above right](P',C',B)
83 \end{tikzpicture}
84 \end{tkzexample}
85
86 \subsection{Mark an arc \tkzcname{tkzMarkArc}}
87 \hypertarget{tms}{}
88
89 \begin{NewMacroBox}{tkzMarkArc}{\oarg{local options}\parg{pt1,pt2,pt3}}%
90 The macro allows you to place a mark on an arc. pt1 is the center, pt2 and pt3 are the endpoints of the arc.
91
92 \medskip
93 \begin{tabular}{lll}%
94 \toprule
95 options & default & definition \\
96 \midrule
97 \TOline{pos}{.5}{position of the mark}
98 \TOline{color}{black}{color of the mark}
99 \TOline{mark}{none}{choice of the mark}
100 \TOline{size}{4pt}{size of the mark}
101 \bottomrule
102 \end{tabular}
103
104 Possible marks are those provided by \TIKZ, but other marks have been created based on an idea by Yves Combe.
105 \begin{tkzltxexample}[]
106 |, ||,|||, z, s, x, o, oo
107 \end{tkzltxexample}
108 \end{NewMacroBox}
109
110 \subsubsection{Several marks }
111 \begin{tkzexample}[latex=7cm,small]
112 \begin{tikzpicture}
113 \tkzDefPoint(0,0){O}
114 \pgfmathsetmacro\r{2}
115 \tkzDefPoint(30:\r){A}
116 \tkzDefPoint(85:\r){B}
117 \tkzDrawCircle(O,A)
118 \tkzMarkArc[color=red,mark=||](O,A,B)
119 \tkzDrawPoints(B,A,O)
120 \end{tikzpicture}
121 \end{tkzexample}
122
123
124 \subsection{Mark an angle mark : {\tkzcname{tkzMarkAngle}}}
125 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}[]
126 |, ||,|||, z, s, x, o, oo
127 \end{tkzltxexample}
128
129
130
131 % \tkzMarkAngle(B, A, C)
132 %
133 % Angle mark
134 % arc (simple/double/triple) and mark of equality.
135 %
136 % By default:
137 % arc = simple
138 % mksize = 1 (radius of the arc)
139 % style traits pleins
140 % mkpos ? position: 0.5 (mark position)
141 % mark none
142 %
143 % Parameters (optional)
144 % arc : l, ll, lll
145 % mksize : 1
146 % gap : 3pt
147 % dist : 1?
148 % style : type of lines
149 % mkpos : 0.5
150 % mark : none , |, ||,|||, z, s, x, o, oo mais tous les
151 % % tikz symbols are allowed
152
153 \begin{NewMacroBox}{tkzMarkAngle}{\oarg{local options}\parg{A,O,B}}%
154 $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.
155
156 \medskip
157
158 \begin{tabular}{lll}%
159 \toprule
160 options & default & definition \\
161 \midrule
162 \TOline{arc}{l}{choice of l, ll and lll (single, double or triple).}
163 \TOline{size}{1 (cm)}{arc radius.}
164 \TOline{mark}{none}{choice of mark.}
165 \TOline{mksize}{4pt}{symbol size (mark).}
166 \TOline{mkcolor}{black}{symbol color (mark).}
167 \TOline{mkpos}{0.5}{position of the symbol on the arc.}
168 \end{tabular}
169 \end{NewMacroBox}
170
171 \DeleteShortVerb{\|}
172 \subsubsection{Example with \tkzname{mark = x} and with \tkzname{mark =||}}
173
174 \begin{tkzexample}[latex=6cm,small]
175 \begin{tikzpicture}[scale=.75]
176 \tkzDefPoints{0/0/O,5/0/A,3/4/B}
177 \tkzMarkAngle[size = 4,mark = x,
178 arc=ll,mkcolor = red,mkpos=.33](A,O,B)
179 \tkzMarkAngle[size = 2,mark = ||,
180 arc=ll,mkcolor = blue,mkpos=.66](A,O,B)
181 \tkzDrawLines(O,A O,B)
182 \tkzDrawPoints(O,A,B)
183 \end{tikzpicture}
184 \end{tkzexample}
185
186 \MakeShortVerb{\|}
187 \begin{NewMacroBox}{tkzMarkAngles}{\oarg{local options}\parg{A,O,B}\parg{A',O',B'}etc.}%
188 With common options, there is a macro for multiple angles.
189 \end{NewMacroBox}
190
191 \subsection{Problem to mark a small angle: {\tkzname{Option veclen}}}\label{opt-veclen}
192 The problem comes from the "decorate" action and from the value used in size in
193 \tkzcname{tkzMarkAngle}. The solution is to enclose the macro \tkzcname{tkzMarkAngle}.
194 In the next example without the "scope" the result is : Latex Error: Dimension too large.
195
196 \begin{tkzexample}[latex=6cm,small]
197 \begin{tikzpicture}[scale=1]
198 \tkzDefPoint(0,0){O}
199 \tkzDefPoint(2.5,0){N}
200 \tkzDefPoint(-4.2,0.5){M}
201 \tkzDefPointBy[rotation=center O angle 30](N)
202 \tkzGetPoint{B}
203 \tkzDefPointBy[rotation=center O angle -50](N)
204 \tkzGetPoint{A}
205 \tkzInterLC[common=B](M,B)(O,B) \tkzGetFirstPoint{C}
206 \tkzInterLC[common=A](M,A)(O,A) \tkzGetFirstPoint{A'}
207 \tkzDrawSegments(A,C M,A M,B A,B)
208 \tkzDrawCircle(O,N)
209 \begin{scope}[veclen]
210 \tkzMarkAngle[mkpos=.2, size=1.2](C,A,M)
211 \end{scope}
212 \tkzDrawPoints(O, A, B, M, B, C, A')
213 \tkzLabelPoints[right](O,A,B)
214 \tkzLabelPoints[above left](M,C)
215 \tkzLabelPoint[below left](A'){$A'$}
216 \end{tikzpicture}
217 \end{tkzexample}
218
219
220 \subsection{Marking a right angle: {\tkzcname{tkzMarkRightAngle}}}
221
222 \begin{NewMacroBox}{tkzMarkRightAngle}{\oarg{local options}\parg{A,O,B}}%
223 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.
224
225 \medskip
226 \begin{tabular}{lll}%
227 \toprule
228 options & default & definition \\
229 \midrule
230 \TOline{german}{normal}{ german arc with inner point.}
231 \TOline{size}{0.2}{ side size.}
232 \end{tabular}
233 \end{NewMacroBox}
234
235 \subsubsection{Example of marking a right angle}
236 \begin{tkzexample}[latex=6cm,small]
237 \begin{tikzpicture}
238 \tkzDefPoints{0/0/A,3/1/B,0.9/-1.2/P}
239 \tkzDefPointBy[projection = onto B--A](P) \tkzGetPoint{H}
240 \tkzDrawLines[add=.5 and .5](P,H)
241 \tkzMarkRightAngle[fill=blue!20,size=.5,draw](A,H,P)
242 \tkzDrawLines[add=.5 and .5](A,B)
243 \tkzMarkRightAngle[fill=red!20,size=.8](B,H,P)
244 \tkzDrawPoints[](A,B,P,H)
245 \end{tikzpicture}
246 \end{tkzexample}
247
248 \subsubsection{Example of marking a right angle, german style}
249 \begin{tkzexample}[latex=6cm,small]
250 \begin{tikzpicture}
251 \tkzDefPoints{0/0/A,3/1/B,0.9/-1.2/P}
252 \tkzDefPointBy[projection = onto B--A](P) \tkzGetPoint{H}
253 \tkzDrawLines[add=.5 and .5](P,H)
254 \tkzMarkRightAngle[german,size=.5,draw](A,H,P)
255 \tkzDrawPoints[](A,B,P,H)
256 \tkzDrawLines[add=.5 and .5](A,B)
257 \tkzMarkRightAngle[german,size=.8](P,H,B)
258 \end{tikzpicture}
259 \end{tkzexample}
260
261 \subsubsection{Mix of styles}
262 \begin{tkzexample}[latex=6cm,small]
263 \begin{tikzpicture}[scale=.75]
264 \tkzDefPoint(0,0){A}
265 \tkzDefPoint(4,1){B}
266 \tkzDefPoint(2,5){C}
267 \tkzDefPointBy[projection=onto B--A](C)
268 \tkzGetPoint{H}
269 \tkzDrawLine(A,B)
270 \tkzDrawLine[add = .5 and .2,color=red](C,H)
271 \tkzMarkRightAngle[,size=1,color=red](C,H,A)
272 \tkzMarkRightAngle[german,size=.8,color=blue](B,H,C)
273 \tkzFillAngle[opacity=.2,fill=blue!20,size=.8](B,H,C)
274 \tkzLabelPoints(A,B,C,H)
275 \tkzDrawPoints(A,B,C,H)
276 \end{tikzpicture}
277 \end{tkzexample}
278
279 \subsubsection{Full example}
280
281 \begin{tkzexample}[latex=6cm,small]
282 \begin{tikzpicture}[rotate=-90]
283 \tkzDefPoint(0,1){A}
284 \tkzDefPoint(2,4){C}
285 \tkzDefPointWith[orthogonal normed,K=7](C,A)
286 \tkzGetPoint{B}
287 \tkzDrawSegment[green!60!black](A,C)
288 \tkzDrawSegment[green!60!black](C,B)
289 \tkzDrawSegment[green!60!black](B,A)
290 \tkzDefSpcTriangle[orthic](A,B,C){N,O,P}
291 \tkzDrawLine[dashed,color=magenta](C,P)
292 \tkzLabelPoint[left](A){$A$}
293 \tkzLabelPoint[right](B){$B$}
294 \tkzLabelPoint[above](C){$C$}
295 \tkzLabelPoint[left](P){$P$}
296 \tkzLabelSegment[auto](B,A){$c$}
297 \tkzLabelSegment[auto,swap](B,C){$a$}
298 \tkzLabelSegment[auto,swap](C,A){$b$}
299 \tkzMarkAngle[size=1,color=cyan,mark=|](C,B,A)
300 \tkzMarkAngle[size=1,color=cyan,mark=|](A,C,P)
301 \tkzMarkAngle[size=0.75,color=orange,
302 mark=||](P,C,B)
303 \tkzMarkAngle[size=0.75,color=orange,
304 mark=||](B,A,C)
305 \tkzMarkRightAngle[german](A,C,B)
306 \tkzMarkRightAngle[german](B,P,C)
307 \end{tikzpicture}
308 \end{tkzexample}
309
310 \subsection{\tkzcname{tkzMarkRightAngles}}
311 \begin{NewMacroBox}{tkzMarkRightAngles}{\oarg{local options}\parg{A,O,B}\parg{A',O',B'}etc.}%
312 With common options, there is a macro for multiple angles.
313 \end{NewMacroBox}
314
315 \subsection{Angles Library} % (fold)
316 \label{sub:angles_library}
317
318 If you prefer to use \TIKZ\ library \tkzname{angles}, you can mark angles with the macro \tkzcname{tkzPicAngle} and \tkzcname{tkzPicRightAngle}.
319
320 \begin{NewMacroBox}{tkzPicAngle}{\oarg{tikz options}\parg{A,O,B}}%
321
322 \medskip
323 \begin{tabular}{lll}%
324 \toprule
325 options & example & definition \\
326 \midrule
327 \TOline{tikz option}{see below}{drawing of the angle $\widehat{AOB}$.}
328 \end{tabular}
329 \end{NewMacroBox}
330
331 \begin{NewMacroBox}{tkzPicRightAngle}{\oarg{tikz options}\parg{A,O,B}}%
332
333 \medskip
334 \begin{tabular}{lll}%
335 \toprule
336 options & example & definition \\
337 \midrule
338 \TOline{tikz option}{see below}{drawing of the right angle $\widehat{AOB}$.}
339 \end{tabular}
340
341 \medskip
342 \emph{You need to know possible options of the \tkzname{angles} library}
343 \end{NewMacroBox}
344
345 \subsubsection{Angle with \TIKZ} % (fold)
346 \label{ssub:angle_with_tikz}
347
348
349 \begin{tkzexample}[latex=7cm,small]
350 \begin{tikzpicture}
351 \tkzDefPoints{0/0/A,4/0/B}
352 \tkzDefTriangle[right,swap](A,B) \tkzGetPoint{C}
353 \tkzDrawPolygon(A,B,C)
354 \tkzDrawPoints(A,B,C)
355 \tkzLabelPoints[below](B,A)
356 \tkzLabelPoints[above right](C)
357 \tkzPicAngle["$\alpha$",draw=orange,
358 <->,angle eccentricity=1.2,
359 angle radius=1cm](B,A,C)
360 \tkzPicRightAngle[draw,red,thick,
361 angle eccentricity=.5,
362 pic text=.](C,B,A)
363 \end{tikzpicture}
364 \end{tkzexample}
365
366 % subsubsection angle_with_tikz (end)
367 % subsection angles_library (end)
368 \endinput