summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/latex/TKZdoc-euclide-angles.tex
blob: d67ea4cc8d890c15df76068c3f9904c439ae7888 (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
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
\section{The angles} 

\subsection{Colour an angle: fill}

The simplest operation
\begin{NewMacroBox}{tkzFillAngle}{\oarg{local options}\parg{A,O,B}}%
$O$ is the vertex of the angle. $OA$ and $OB$ are the sides. Attention the angle is determined by the order of the points.

\medskip

\begin{tabular}{lll}%
\toprule
options             & default & definition                        \\ 
\midrule
\TOline{size}{1 cm}{this option determines the radius of the coloured angular sector.}

\bottomrule
\end{tabular} 

\medskip
Of course, you have to add all the styles of \TIKZ, like the use of fill and shade... 
\end{NewMacroBox}  

\subsubsection{Example with \tkzname{size}}  
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture} 
   \tkzInit 
   \tkzDefPoints{0/0/O,2.5/0/A,1.5/2/B}
   \tkzFillAngle[size=2cm, fill=gray!10](A,O,B)
   \tkzDrawLines(O,A O,B)
   \tkzDrawPoints(O,A,B)
\end{tikzpicture}
\end{tkzexample}


\subsubsection{Changing the order of items} 
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture} 
   \tkzInit 
   \tkzDefPoints{0/0/O,2.5/0/A,1.5/2/B}
   \tkzFillAngle[size=2cm,fill=gray!10](B,O,A)
   \tkzDrawLines(O,A O,B)
   \tkzDrawPoints(O,A,B)
\end{tikzpicture}
\end{tkzexample}

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture} 
   \tkzInit 
   \tkzDefPoints{0/0/O,5/0/A,3/4/B}
   % Don't forget {} to get, () to use
   \tkzFillAngle[size=4cm,left color=white, 
                 right color=red!50](A,O,B)
   \tkzDrawLines(O,A O,B)
   \tkzDrawPoints(O,A,B)
\end{tikzpicture}
\end{tkzexample}

\begin{NewMacroBox}{tkzFillAngles}{\oarg{local options}\parg{A,O,B}\parg{A',O',B'}etc.}%
With common options, there is a macro for multiple angles.
  \end{NewMacroBox}  
  
\subsubsection{Multiples angles}  
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=0.75]
  \tkzDefPoint(0,0){B}
  \tkzDefPoint(8,0){C}
  \tkzDefPoint(0,8){A}
  \tkzDefPoint(8,8){D}
  \tkzDrawPolygon(B,C,D,A)
  \tkzDefTriangle[equilateral](B,C) 
  \tkzGetPoint{M}
  \tkzInterLL(D,M)(A,B) \tkzGetPoint{N}
  \tkzDefPointBy[rotation=center N angle -60](D) 
  \tkzGetPoint{L}
  \tkzInterLL(N,L)(M,B)     \tkzGetPoint{P}
  \tkzInterLL(M,C)(D,L)     \tkzGetPoint{Q}
  \tkzDrawSegments(D,N N,L L,D B,M M,C)
  \tkzDrawPoints(L,N,P,Q,M,A,D) 
  \tkzLabelPoints[left](N,P,Q)
  \tkzLabelPoints[above](M,A,D)
  \tkzLabelPoints(L,B,C)
  \tkzMarkAngles(C,B,M B,M,C M,C,B%
                 D,L,N L,N,D N,D,L)
  \tkzFillAngles[fill=red!20,opacity=.2](C,B,M%
      B,M,C M,C,B D,L,N L,N,D N,D,L)
\end{tikzpicture}
\end{tkzexample} 
 
\subsection{Mark an angle mark}
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}

Their definitions are as follows

\begin{tkzltxexample}[]
\pgfdeclareplotmark{||}
  %double bar
{%
  \pgfpathmoveto{\pgfqpoint{2\pgflinewidth}{\pgfplotmarksize}}
  \pgfpathlineto{\pgfqpoint{2\pgflinewidth}{-\pgfplotmarksize}}
  \pgfpathmoveto{\pgfqpoint{-2\pgflinewidth}{\pgfplotmarksize}}
  \pgfpathlineto{\pgfqpoint{-2\pgflinewidth}{-\pgfplotmarksize}}
  \pgfusepathqstroke
}
\end{tkzltxexample}

\begin{tkzltxexample}[]
  %triple bar
  \pgfdeclareplotmark{|||}
  {%
    \pgfpathmoveto{\pgfqpoint{0 pt}{\pgfplotmarksize}}
    \pgfpathlineto{\pgfqpoint{0 pt}{-\pgfplotmarksize}}
    \pgfpathmoveto{\pgfqpoint{-3\pgflinewidth}{\pgfplotmarksize}}
    \pgfpathlineto{\pgfqpoint{-3\pgflinewidth}{-\pgfplotmarksize}}
    \pgfpathmoveto{\pgfqpoint{3\pgflinewidth}{\pgfplotmarksize}}
    \pgfpathlineto{\pgfqpoint{3\pgflinewidth}{-\pgfplotmarksize}}
    \pgfusepathqstroke
  } 
\end{tkzltxexample}

\begin{tkzltxexample}[]
  % An bar slant
  \pgfdeclareplotmark{s|}
  {%
    \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}%
                             {-.70710678\pgfplotmarksize}}
    \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}%
                             {.70710678\pgfplotmarksize}}
    \pgfusepathqstroke
  } 
\end{tkzltxexample}


\begin{tkzltxexample}[]
  % An double bar slant
  \pgfdeclareplotmark{s||}
  {%
   \pgfpathmoveto{\pgfqpoint{-0.75\pgfplotmarksize}{-\pgfplotmarksize}}
   \pgfpathlineto{\pgfqpoint{0.25\pgfplotmarksize}{\pgfplotmarksize}} 
   \pgfpathmoveto{\pgfqpoint{0\pgfplotmarksize}{-\pgfplotmarksize}}
   \pgfpathlineto{\pgfqpoint{1\pgfplotmarksize}{\pgfplotmarksize}} 
   \pgfusepathqstroke
  }   
\end{tkzltxexample}


\begin{tkzltxexample}[]
  % z
  \pgfdeclareplotmark{z}
  {%
    \pgfpathmoveto{\pgfqpoint{0.75\pgfplotmarksize}{-\pgfplotmarksize}} 
    \pgfpathlineto{\pgfqpoint{-0.75\pgfplotmarksize}{-\pgfplotmarksize}}
    \pgfpathlineto{\pgfqpoint{0.75\pgfplotmarksize}{\pgfplotmarksize}}
    \pgfpathlineto{\pgfqpoint{-0.75\pgfplotmarksize}{\pgfplotmarksize}}
    \pgfusepathqstroke
  }
\end{tkzltxexample}

\begin{tkzltxexample}[]
  % s
  \pgfdeclareplotmark{s}
  {%
     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 
     \pgfpathcurveto
         {\pgfpoint{0pt}{0pt}}
         {\pgfpoint{-\pgfplotmarksize}{\pgfplotmarksize}}
         {\pgfpoint{\pgfplotmarksize}{\pgfplotmarksize}}
     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 
      \pgfpathcurveto
         {\pgfpoint{0pt}{0pt}}
         {\pgfpoint{\pgfplotmarksize}{-\pgfplotmarksize}}
         {\pgfpoint{-\pgfplotmarksize}{-\pgfplotmarksize}} 
      \pgfusepathqstroke
  }  
\end{tkzltxexample}

\begin{tkzltxexample}[]
  % infinity
  \pgfdeclareplotmark{oo}
  {%
     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 
     \pgfpathcurveto
         {\pgfpoint{0pt}{0pt}}
         {\pgfpoint{.5\pgfplotmarksize}{1\pgfplotmarksize}}
         {\pgfpoint{\pgfplotmarksize}{0pt}}
     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 
      \pgfpathcurveto
         {\pgfpoint{0pt}{0pt}}
         {\pgfpoint{-.5\pgfplotmarksize}{1\pgfplotmarksize}}
         {\pgfpoint{-\pgfplotmarksize}{0pt}}  
     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}  
        \pgfpathcurveto
         {\pgfpoint{0pt}{0pt}}
         {\pgfpoint{.5\pgfplotmarksize}{-1\pgfplotmarksize}}
         {\pgfpoint{\pgfplotmarksize}{0pt}}
     \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 
      \pgfpathcurveto
         {\pgfpoint{0pt}{0pt}}
         {\pgfpoint{-.5\pgfplotmarksize}{-1\pgfplotmarksize}}
         {\pgfpoint{-\pgfplotmarksize}{0pt}}      
      \pgfusepathqstroke
  } 
\end{tkzltxexample}



%                \tkzMarkAngle(B, A, C)
%
% Marque d'angle
% arc de cercle (simple/double/triple) et marque d'églité.
%
% Par défaut: 
%                 arc       = simple
%                 mksize  = 1cm (rayon de l'arc)
%                 style traits pleins
%                 mkpos ?  position: 0.5 (position de la marque)
%                 mark rien du tout (ignoré si type est utilisé)
%
% Paramètres (optionnels)
%             arc     : l, ll, lll
%             mksize  : 1cm
%             gap     : 3pt
%             dist    : 1?
%             style   : type de traits
%             mkpos   : 0.5
%             mark    : none  , |, ||,|||, z, s, x, o, oo mais tous les 
%  % symboles de tikz sont permis

\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}  

\subsubsection{Example with \tkzname{mark = x}}
\begin{tkzexample}[latex=6cm,small]
    \begin{tikzpicture}[scale=.75]
        \tkzDefPoints{0/0/O,5/0/A,3/4/B}
        \tkzMarkAngle[size = 4cm,mark = x,
                      arc=ll,mkcolor = red](A,O,B)
        \tkzDrawLines(O,A O,B)
        \tkzDrawPoints(O,A,B)
    \end{tikzpicture}
\end{tkzexample}
\DeleteShortVerb{\|}
\subsubsection{Example with \tkzname{mark =||}}
\MakeShortVerb{\|}
\begin{tkzexample}[latex=6cm,small]
    \begin{tikzpicture}[scale=.75]
        \tkzDefPoints{0/0/O,5/0/A,3/4/B}
        \tkzMarkAngle[size = 4cm,mark = ||,
                    arc=ll,mkcolor = red](A,O,B)
        \tkzDrawLines(O,A O,B)
        \tkzDrawPoints(O,A,B)
    \end{tikzpicture}
\end{tkzexample}

\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{Label at an angle}

\begin{NewMacroBox}{tkzLabelAngle}{\oarg{local options}\parg{A,O,B}}%
There is only one option, dist (with or without unit), which can be replaced by the TikZ's pos option (without unit for the latter). By default, the value is in centimeters.

\begin{tabular}{lll}%
	\toprule
options             & default & definition                        \\ 
\midrule
\TOline{pos}{1}{ or dist, controls the distance from the top to the label.}
\bottomrule
\end{tabular} 

\medskip 
It is possible to move the label with all TikZ options : rotate, shift, below, etc.
\end{NewMacroBox}  

\subsubsection{Example with \tkzname{pos}} 
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoints{0/0/O,5/0/A,3/4/B}
  \tkzMarkAngle[size = 4cm,mark = ||,
      arc=ll,color = red](A,O,B)%     
  \tkzDrawLines(O,A O,B)
  \tkzDrawPoints(O,A,B)
  \tkzLabelAngle[pos=2,draw,circle,
      fill=blue!10](A,O,B){$\alpha$} 
\end{tikzpicture}
\end{tkzexample}

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[rotate=30]
  \tkzDefPoint(2,1){S} 
  \tkzDefPoint(7,3){T}
  \tkzDefPointBy[rotation=center S angle 60](T)
  \tkzGetPoint{P} 
  \tkzDefLine[bisector,normed](T,S,P)
  \tkzGetPoint{s}
  \tkzDrawPoints(S,T,P)   
  \tkzDrawPolygon[color=blue](S,T,P) 
  \tkzDrawLine[dashed,color=blue,add=0 and 3](S,s)  
  \tkzLabelPoint[above right](P){$P$}
  \tkzLabelPoints(S,T)
  \tkzMarkAngle[size = 1.8cm,mark = |,arc=ll,
                    color = blue](T,S,P)
  \tkzMarkAngle[size = 2.1cm,mark = |,arc=l,
                    color = blue](T,S,s)
  \tkzMarkAngle[size = 2.3cm,mark = |,arc=l,
                    color = blue](s,S,P)  
 \tkzLabelAngle[pos = 1.5](T,S,P){$60^{\circ}$}%    
 \tkzLabelAngles[pos = 2.7](T,S,s s,S,P){$30^{\circ}$}%   
\end{tikzpicture}
\end{tkzexample}

\begin{NewMacroBox}{tkzLabelAngles}{\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{Marking a right angle}

\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,fill=blue!20](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)
\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)
\tkzDrawLine[altitude,dashed,color=magenta](B,C,A)
\tkzGetPoint{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=1cm,color=cyan,mark=|](C,B,A)
\tkzMarkAngle[size=1cm,color=cyan,mark=|](A,C,P)
\tkzMarkAngle[size=0.75cm,color=orange,mark=||](P,C,B)
\tkzMarkAngle[size=0.75cm,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}

\section{Angles tools}

\subsection{Recovering an angle \tkzcname{tkzGetAngle}}
\begin{NewMacroBox}{tkzGetAngle}{\parg{name of macro}}%
Assigns the value in degree of an angle to a macro. This macro retrieves \tkzcname{tkzAngleResult} and stores the result in a new macro.

\medskip

\begin{tabular}{lll}%
\toprule
arguments             & example & explication             \\
\midrule
\TAline{name of macro} {\tkzcname{tkzGetAngle}\{ang\}}{\tkzcname{ang} contains the value of the angle.}
\end{tabular}
\end{NewMacroBox}

\subsection{Example of the use of \tkzcname{tkzGetAngle}}

 The point here is that $(AB)$ is the bisector of $\widehat{CAD}$, such that the $AD$ slope is zero. We recover the slope of $(AB)$ and then rotate twice.


\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
  \tkzInit
  \tkzDefPoint(1,5){A} \tkzDefPoint(5,2){B}  
  \tkzDrawSegment(A,B)
  \tkzFindSlopeAngle(A,B)\tkzGetAngle{tkzang}
  \tkzDefPointBy[rotation= center A angle \tkzang ](B)
   \tkzGetPoint{C}
  \tkzDefPointBy[rotation= center A angle -\tkzang ](B) 
  \tkzGetPoint{D}
  \tkzCompass[length=1,dashed,color=red](A,C)
  \tkzCompass[delta=10,brown](B,C)  
   \tkzDrawPoints(A,B,C,D)
  \tkzLabelPoints(B,C,D)  
  \tkzLabelPoints[above left](A)
  \tkzDrawSegments[style=dashed,color=orange!30](A,C A,D)
\end{tikzpicture}
\end{tkzexample}



\subsection{Angle formed by three points}

\begin{NewMacroBox}{tkzFindAngle}{\parg{pt1,pt2,pt3}}%
The result is stored in a macro \tkzcname{tkzAngleResult}.

\medskip

\begin{tabular}{lll}%
\toprule
arguments     & example & explication     \\
\midrule
\TAline{(pt1,pt2,pt3)} {\tkzcname{tkzFindAngle}(A,B,C)}{\tkzcname{tkzAngleResult} gives the angle ($\overrightarrow{BA},\overrightarrow{BC}$)}
\bottomrule
\end{tabular}

\medskip
The result is between -180 degrees and +180 degrees. pt2 is the vertex and \tkzcname{tkzGetAngle} can retrieve the angle.
\end{NewMacroBox}
 
\subsubsection{Verification of angle measurement}
    
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoint(-1,1){A}
  \tkzDefPoint(5,2){B}
  \tkzDefEquilateral(A,B)
  \tkzGetPoint{C}
  \tkzDrawPolygon(A,B,C)
  \tkzFindAngle(B,A,C) 
  \tkzGetAngle{angleBAC}
  \edef\angleBAC{\fpeval{round(\angleBAC)}}
  \tkzDrawPoints(A,B,C) 
  \tkzLabelPoints(A,B)
  \tkzLabelPoint[right](C){$C$}
  \tkzLabelAngle(B,A,C){\angleBAC$^\circ$}
  \tkzMarkAngle[size=1.5cm](B,A,C)
\end{tikzpicture}
\end{tkzexample}

\subsection{Example of the use of \tkzcname{tkzFindAngle} }

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
   \tkzInit[xmin=-1,ymin=-1,xmax=7,ymax=7]
   \tkzClip  
   \tkzDefPoint (0,0){O}  \tkzDefPoint (6,0){A}
   \tkzDefPoint (5,5){B}  \tkzDefPoint (3,4){M}
   \tkzFindAngle (A,O,M)  \tkzGetAngle{an}   
   \tkzDefPointBy[rotation=center O angle \an](A) 
   \tkzGetPoint{C}
   \tkzDrawSector[fill = blue!50,opacity=.5](O,A)(C)
   \tkzFindAngle(M,B,A)   \tkzGetAngle{am}
   \tkzDefPointBy[rotation = center O angle \am](A) 
   \tkzGetPoint{D} 
   \tkzDrawSector[fill = red!50,opacity = .5](O,A)(D) 
   \tkzDrawPoints(O,A,B,M,C,D)   
   \tkzLabelPoints(O,A,B,M,C,D) 
	\edef\an{\fpeval{round(\an,2)}}\edef\am{\fpeval{round(\am,2)}}
   \tkzDrawSegments(M,B B,A)
   \tkzText(4,2){$\widehat{AOC}=\widehat{AOM}=\an^{\circ}$} 
   \tkzText(1,4){$\widehat{AOD}=\widehat{MBA}=\am^{\circ}$}  
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Determination of the three angles of a triangle}

\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}[scale=1.25,rotate=30]
  \tkzDefPoints{0.5/1.5/A, 3.5/4/B, 6/2.5/C}
  \tkzDrawPolygon(A,B,C) 
  \tkzDrawPoints(A,B,C) 
  \tkzLabelPoints[below](A,C)
  \tkzLabelPoints[above](B)
  \tkzMarkAngle[size=1cm](B,C,A)
  \tkzFindAngle(B,C,A) 
  \tkzGetAngle{angleBCA}
  \edef\angleBCA{\fpeval{round(\angleBCA,2)}}
  \tkzLabelAngle[pos = 1](B,C,A){$\angleBCA^{\circ}$}
  \tkzMarkAngle[size=1cm](C,A,B)
  \tkzFindAngle(C,A,B) 
  \tkzGetAngle{angleBAC}
  \edef\angleBAC{\fpeval{round(\angleBAC,2)}}
  \tkzLabelAngle[pos = 1.8](C,A,B){%
             $\angleBAC^{\circ}$} 
  \tkzMarkAngle[size=1cm](A,B,C)
  \tkzFindAngle(A,B,C) 
  \tkzGetAngle{angleABC}
  \edef\angleABC{\fpeval{round(\angleABC,2)}}
  \tkzLabelAngle[pos = 1](A,B,C){$\angleABC^{\circ}$}
  \end{tikzpicture}
\end{tkzexample}

 \subsection{Determining a slope}
It is a question of determining whether it exists, the slope of a straight line defined by two points. No verification of the existence is made.

\begin{NewMacroBox}{tkzFindSlope}{\parg{pt1,pt2}\marg{name of macro}}%
The result is stored in a macro.

\medskip

\begin{tabular}{lll}%
\toprule
arguments             & example & explication                         \\
\midrule
\TAline{(pt1,pt2){pt3}} {\tkzcname{tkzFindSlope}(A,B)\{slope\}}{\tkzcname{slope} will give the result of $\frac{y_B-y_A}{x_B-x_A}$} \\
\bottomrule
\end{tabular}

\medskip
\tkzHandBomb\ Careful not to have $x_B=x_A$.
\end{NewMacroBox}


\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1.5]
  \tkzInit[xmax=4,ymax=5]\tkzGrid[sub]
  \tkzDefPoint(1,2){A}    \tkzDefPoint(3,4){B}
  \tkzDefPoint(3,2){C}    \tkzDefPoint(3,1){D}
  \tkzDrawSegments(A,B A,C A,D)
  \tkzDrawPoints[color=red](A,B,C,D)  
  \tkzLabelPoints(A,B,C,D)
  \tkzFindSlope(A,B){SAB} \tkzFindSlope(A,C){SAC}
  \tkzFindSlope(A,D){SAD}
  \pgfkeys{/pgf/number format/.cd,fixed,precision=2}
  \tkzText[fill=Gold!50,draw=brown](1,4)%
  {The slope of (AB) is : $\pgfmathprintnumber{\SAB}$}     
  \tkzText[fill=Gold!50,draw=brown](1,3.5)%
  {The slope of (AC) is : $\pgfmathprintnumber{\SAC}$}    
  \tkzText[fill=Gold!50,draw=brown](1,3)%
  {The slope of (AD) is : $\pgfmathprintnumber{\SAD}$}
\end{tikzpicture}
\end{tkzexample}

\subsection{Angle formed by a straight line with the horizontal axis \tkzcname{tkzFindSlopeAngle}}
Much more interesting than the last one. The result is between -180 degrees and +180 degrees.

\begin{NewMacroBox}{tkzFindSlopeAngle}{\parg{A,B}}%
Determines the slope of the straight line (AB). The result is stored in a macro \tkzcname{tkzAngleResult}.

\medskip
\begin{tabular}{lll}%
\toprule
arguments  & example & explication     \\
\midrule
\TAline{(pt1,pt2)} {\tkzcname{tkzFindSlopeAngle}(A,B)}{}
\bottomrule
\end{tabular}

\medskip
\tkzcname{tkzGetAngle} can retrieve the result. If retrieval is not necessary, you can use \tkzcname{tkzAngleResult}.
\end{NewMacroBox}
 
 \subsubsection{Folding}
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture} 
  \tkzDefPoint(1,5){A}
  \tkzDefPoint(5,2){B}  
  \tkzDrawSegment(A,B) 
  \tkzFindSlopeAngle(A,B)
  \tkzGetAngle{tkzang}
  \tkzDefPointBy[rotation= center A angle \tkzang ](B) 
  \tkzGetPoint{C} 
  \tkzDefPointBy[rotation= center A angle -\tkzang ](B) 
  \tkzGetPoint{D} 
  \tkzCompass[orange,length=1](A,C) 
  \tkzCompass[orange,delta=10](B,C)   
  \tkzDrawPoints(A,B,C,D) 
  \tkzLabelPoints(B,C,D)  
  \tkzLabelPoints[above left](A) 
  \tkzDrawSegments[style=dashed,color=orange](A,C A,D)
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Example of the use of \tkzcname{tkzFindSlopeAngle}}
Here is another version of the construction of a mediator

\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}
 \tkzInit
 \tkzDefPoint(0,0){A}        
 \tkzDefPoint(3,2){B}
 \tkzDefLine[mediator](A,B)  
 \tkzGetPoints{I}{J}
 \tkzCalcLength[cm](A,B)     
 \tkzGetLength{dAB}
 \tkzFindSlopeAngle(A,B)     
 \tkzGetAngle{tkzangle}
 \begin{scope}[rotate=\tkzangle]
   \tikzset{arc/.style={color=gray,delta=10}}
   \tkzDrawArc[orange,R,arc](B,3/4*\dAB)(120,240)
   \tkzDrawArc[orange,R,arc](A,3/4*\dAB)(-45,60)
   \tkzDrawLine(I,J)         
   \tkzDrawSegment(A,B)
  \end{scope}
  \tkzDrawPoints(A,B,I,J)    
  \tkzLabelPoints(A,B)
   \tkzLabelPoints[right](I,J)
\end{tikzpicture}
\end{tkzexample}
 
\endinput