summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-base/latex/TKZdoc-base-point.tex
blob: 13d1dfdba8d30824972c60f09450e6d2c4672725 (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
673
674
675
676
677
678
679
680
681
682
683
684
\section{Les points}

J'ai fait une distinction entre le point utilisé en géométrie euclidienne et le point pour représenter un élément d'un nuage statistique. Dans le premier cas, j'utilise comme objet un \tkzname{node}, ce qui se traduit par le fait que la représentation du point ne peut être modifiée par un \tkzname{scale}; dans le second cas, j'utilise comme objet un \tkzname{plot mark}. Ce dernier peut être mis à l'échelle et posséder des formes plus variées que le node.

La nouvelle macro est \tkzNameMacro{tkzDefPoint}, celle-ci permet d'utiliser des options propres à \TIKZ\ comme shift et les valeurs sont traitées avec tkz-base. De plus, si des calculs sont nécessaires alors c'est le package \tkzNamePack{xfp} qui s'en charge. On peut utiliser les coordonnées cartésiennes ou polaires.

\subsection{Définition d'un point en coordonnées cartésiennes : \tkzcname{tkzDefPoint}} \hypertarget{tdp}{}

\begin{NewMacroBox}{tkzDefPoint}{\oarg{local options}\parg{x,y}\var{name} ou \parg{a:r}\var{name}}

\begin{tabular}{lll}
\toprule
arguments &  défaut  & définition  \\ 
\midrule
\TAline{x,y}{no default}{x et y sont deux dimensions, par défaut en cm.}
\TAline{a:r}{no default}{a est un angle en degré, r une dimension}
\bottomrule
\end{tabular}

\medskip
\noindent{Les arguments obligatoires de cette macro sont  deux dimensions exprimées avec des décimaux, dans le premier cas ce sont deux mesures de longueur, dans le second ce sont une mesure de longueur et la mesure d'un angle en degré}

\medskip
\begin{tabular}{lll}
\toprule
options             & défaut & définition   \\ 
\midrule
\TOline{shift} {(0,0)} {espacement entre deux valeurs}
 \bottomrule
\end{tabular}

\medskip
\noindent{Toutes les options de \TIKZ\ que l'on peut appliquer à \tkzname{coordinate}, sont applicables (enfin je l'espère!) comme par exemple  l'option \tkzname{label} définit avec la librairie \tkzname{quotes}.}
\end{NewMacroBox}

\subsubsection{Utilisation de \tkzname{shift}}
\tkzname{shift} permet de placer les points par rapport à un autre. 

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[trim left=-1cm]
 \tkzDefPoint(2,3){A}
 \tkzDefPoint[shift={(2,3)}](31:3){B}  
 \tkzDefPoint[shift={(2,3)}](158:3){C}
 \tkzDrawSegments[color=red,line width=1pt](A,B A,C) 
 \tkzDrawPoints[color=red](A,B,C)
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Placer un label avec la librairie \tkzname{quotes} }
Je préfère ne pas mélanger les opérations et utiliser \tkzcname{tkzLabelPoint} pour placer les labels. voir la section 17.10.4 The Quotes Syntax.

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[trim left=-1cm]
 \tkzDefPoint["-60:$A_n$" ](2,3){A}
 \tkzDefPoint[shift={(2,3)},%
    "$B_n$" above left](31:3){B}  
 \tkzDefPoint[shift={(2,3)},%
     "$C_n$" above right](158:3){C}
 \tkzDrawSegments[color=red,%
          line width=1pt](A,B A,C) 
 \tkzDrawPoints[color=red](A,B,C)
\end{tikzpicture}
\end{tkzexample}


\subsubsection{Rotation avec  \tkzname{shift} et \tkzname{scope} }  
Préférable  pour effectuer une rotation, est d'utiliser un environnement \tkzNameEnv{scope}. 
                    
\begin{tkzexample}[latex=7cm,small] 
\begin{tikzpicture}[scale=.75,rotate=90] 
 \tkzDefPoint[label=right:$A_n$](2,3){A} 
 \begin{scope}[shift={(A)}]
   \tkzDefPoint[label= right:$B_n$](31:3){B} 
   \tkzDefPoint[label= right:$C_n$](158:3){C} 
 \end{scope}
  \tkzDrawSegments[color=red,%
           line width=1pt](A,B A,C) 
  \tkzDrawPoints[color=red](A,B,C)
 \end{tikzpicture}
\end{tkzexample}

\subsubsection{Formules et coordonnées}
Il faut ici respecter la syntaxe de \tkzNamePack{xfp}. Il est toujours possible de passer par \tkzNamePack{pgfmath} mais dans ce cas, il faut calculer les coordonnées avant d'utiliser la macro \tkzcname{tkzDefPoint}.

\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=.75]
  \tkzInit[xmax=6,ymax=6]
  \tkzGrid
  \tkzSetUpPoint[shape = circle,color = red,%
                 size = 4,fill = red!30]
  \tkzDefPoint(-1+1,-1+4){O}
  \tkzDefPoint({3*ln(exp(1))},{exp(1)}){A}
  \tkzDefPoint({4*sin(pi/6)},{4*cos(pi/6)}){B}
  \tkzDefPoint({4*sin(pi/3)},{4*cos(pi/3)}){B'}
  \tkzDefPoint[shift={(1,3)}](30:3){A'} 
  \tkzDrawPoints(O,A,B) 
  \tkzDrawPoints[color=red,shape=cross out](B',A') 
  \tkzLabelPoints(A,O,B,B',A') 
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Scope et \tkzcname{tkzDefPoint} }
On peut tout d'abord utiliser l'environnement \tkzNameEnv{scope} de \TIKZ\
Dans l'exemple suivant, nous avons un moyen de définir un triangle isocèle.

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1]
 \begin{scope}[rotate=30]
  \tkzDefPoint(2,3){A}
  \begin{scope}[shift=(A)]
     \tkzDefPoint(90:5){B}
     \tkzDefPoint(30:5){C}
  \end{scope}
 \end{scope}
\tkzDrawSegments[color=blue](A,B B,C C,A) 
\tkzDrawPoints(A,B,C)
\tkzLabelPoints[above](B,C)
\tkzLabelPoints[below](A) 
\end{tikzpicture}
\end{tkzexample}
%<--------------------------------------------------------------------------->
\subsection{Définition de points  en coordonnées cartésiennes : \tkzcname{tkzDefPoints}} \hypertarget{tdps}{} 
 
\begin{NewMacroBox}{tkzDefPoints}{\oarg{local options}\var{$x_1/y_1/n_1,x_2/y_2/n_2$, ...}}
$x_1$ et $y_1$ sont les coordonnées d'un point référencé $n_1$ 

\begin{tabular}{lll}
\toprule
arguments &  exemple  &   \\ 
\midrule
\TAline{$x_i/y_i/n_i$}{\tkzcname{tkzDefPoints\{0/0/O,2/2/A\}}}{}
\end{tabular}
\end{NewMacroBox}

\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}[scale=1]
 \tkzDefPoints{%  x   y   name
                  0  /0 /A,
                     2  /0 /B,
                     2  /2 /C,
                     0  /2 /D}
 \tkzDrawSegments(D,A A,B B,C C,D)
 % or with tkz-euclide
 % \tkzDrawPolygon(A,...,D)
 \tkzDrawPoints(A,B,C,D) 
\end{tikzpicture}
\end{tkzexample}   

\newpage 
%<--------------------------------------------------------------------------->
\subsection{Point relativement à un autre : \tkzcname{tkzDefShiftPoint}} 
\hypertarget{tdsp}{} 
\begin{NewMacroBox}{tkzDefShiftPoint}{\oarg{Point}\parg{x,y}\var{name} ou \parg{a:r}\var{name}}
\begin{tabular}{lll}
arguments &  défaut  & définition \\ 
\midrule
\TAline{(x,y)}{no default}{x et y sont deux dimensions, par défaut en cm.}
\TAline{(a:r)}{no default}{a est un angle en degré, r une dimension}
\TAline{point} {no default} {\tkzcname{tkzDefShiftPoint}[A](0:4)\{B\}} 
\bottomrule
\end{tabular}

\emph{Pas d'option. Le nom du point est obligatoire.}
\end{NewMacroBox}

\subsubsection{Exemple avec  \tkzcname{tkzDefShiftPoint}}
Cette macro permet de placer un point relativement à un autre. Cela revient à une translation. Voici comment construire un triangle isocèle de sommet principal A et d'angle au sommet de $30$ degrés. 

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[rotate=-30]
 \tkzDefPoint(2,3){A}
 \tkzDefShiftPoint[A](0:4){B}
 \tkzDefShiftPoint[A](30:4){C} 
 \tkzDrawSegments(A,B B,C C,A)
 \tkzMarkSegments[mark=|,color=red](A,B A,C)
 \tkzDrawPoints(A,B,C) 
 \tkzLabelPoints[above](A,C)   
 \tkzLabelPoints(B) 
\end{tikzpicture}
\end{tkzexample}

\subsection{Point relativement à un autre : \tkzcname{tkzDefShiftPointCoord}}

\begin{NewMacroBox}{tkzDefShiftPointCoord}{\oarg{a,b}\parg{x,y}\var{name} ou \parg{a:r}\var{name}}
{Il s'agit d'effectuer une translation de vecteur $(a,b)$ au point défini par rapport à l'oigine.}

\medskip
\begin{tabular}{lll}
\toprule
arguments &  défaut  & définition \\ 
\midrule
\TAline{(x,y)}{no default}{x et y sont deux dimensions, par défaut en cm.}
\TAline{(a:r)}{no default}{a est un angle en degré, r une dimension}
\bottomrule
\end{tabular}

\medskip
\begin{tabular}{lll}
\toprule
options             & défaut & exemple   \\ 
\midrule
\TOline{a,b} {no default} {\tkzcname{tkzDefShiftPointCoord}[2,3](0:4)\{B\}}
 \bottomrule
\end{tabular}

L'option est obligatoire
\end{NewMacroBox}

  
\subsubsection{Triangle équilatéral avec \tkzcname{tkzDefShiftPointCoord}}
Voyons comment obtenir un triangle équilatéral (il y a beaucoup plus simple)

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1]
 \tkzDefPoint(2,3){A}
 \tkzDefShiftPointCoord[2,3](30:4){B}
 \tkzDefShiftPointCoord[2,3](-30:4){C} 
 \tkzDrawSegments(A,B B,C C,A) 
 % or \tkzDrawPolygon
  \tkzDrawPoints(A,B,C)
  \tkzLabelPoints(B,C)  
  \tkzLabelPoint[left](A){$A$} 
\end{tikzpicture}
\end{tkzexample} 

\subsubsection{Triangle isocèle avec \tkzcname{tkzDefShiftPointCoord}}
Voyons comment obtenir un triangle isocèle dont l'angle principal est de 30 degrés. La rotation est possible. $AB=AC=5$ et $\widehat{BAC}$

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[rotate=15]
 \tkzDefPoint(2,3){A}
 \tkzDefShiftPointCoord[2,3](15:5){B}
 \tkzDefShiftPointCoord[2,3](-15:5){C} 
 \tkzDrawSegments(A,B B,C C,A) 
 \tkzDrawPoints(A,B,C)
 \tkzLabelPoints(B,C)
 \tkzLabelPoint[left](A){$A$}
\end{tikzpicture}
\end{tkzexample}


%<--------------------------------------------------------------------------->
\subsection{Tracer des points \tkzcname{tkzDrawPoint}} \hypertarget{tdrp}{}

\begin{NewMacroBox}{tkzDrawPoint}{\oarg{local options}\parg{point}}
\begin{tabular}{lll}
arguments &  défaut  & définition                 \\ 
\midrule
\TAline{point} {no default}  {un nom ou une référence est demandé}
\bottomrule
\end{tabular}

\medskip
\noindent{L'argument est  obligatoire, mais il n'est pas nécessaire (bien que recommandé) d'utiliser une référence;  un couple de coordonnées place entre accolades est acceptée. Le disque prend la couleur du cercle, mais 50\% plus claire. Il est possible de tout modifier. Le point est un node et donc il est invariant si le dessin est modifié par une mise à l'échelle.}

\medskip
\begin{tabular}{lll}
\toprule
options             & défaut & définition  \\ 
\midrule
\TOline{shape}  {circle}{Possible \tkzname{cross} ou \tkzname{cross out}} 
\TOline{size}   {2 pt} {taille du disque}
\TOline{color}  {black}{la couleur par défaut peut être changée}
\bottomrule
\end{tabular}

\medskip
\noindent{On peut créer d'autres formes comme \tkzname{cross}}
\end{NewMacroBox}

\subsubsection{Style des points par défaut} 

\begin{tkzexample}[latex=5cm,small]
  \begin{tikzpicture}
   \tkzDefPoint(1,3){A}
   \tkzDrawPoint(A)
  \end{tikzpicture}
\end{tkzexample}  

\subsubsection{Modification du style} 
La définition par défaut dans le fichier \tkzname{tkz-base.cfg}

\begin{tkzltxexample}[small]
\tikzset{point style/.style={draw         = \tkz@euc@pointcolor,
                             inner sep    = 0pt,
                             shape        = \tkz@euc@pointshape,
                             minimum size = \tkz@euc@pointsize,
                             fill         = \tkz@euc@pointcolor!50}}
\end{tkzltxexample}

\begin{tkzexample}[latex=5cm,small]
  \begin{tikzpicture}
   \tikzset{point style/.style={%
     draw         = blue,
     inner sep    = 0pt,
     shape        = circle,
     minimum size = 6pt,
     fill         = red!20}}
   \tkzDefPoint(1,3){A}
   \tkzDefPoint(4,1){B}
   \tkzDefPoint(0,0){O}
   \tkzDrawPoint(A)
   \tkzDrawPoint(B)
   \tkzDrawPoint(O)
  \end{tikzpicture} 
\end{tkzexample} 

\subsubsection{Exemple de tracés de points}
Il faut remarquer que \tkzname{scale} ne touche pas à la forme des points. Ce qui est normal.  La plupart du temps, on se contente d'une seule forme de points que l'on pourra définir dès le début, soit avec une macro, soit en modifiant un fichier de configuration. 

\begin{tkzexample}[latex=5cm,small]
  \begin{tikzpicture}[scale=.5]
   \tkzDefPoint(1,3){A}
   \tkzDefPoint(4,1){B}
   \tkzDefPoint(0,0){O}
   \tkzDrawPoint[shape=cross out,size=12,color=red](A)
   \tkzDrawPoint[shape=cross,size=12,color=blue](B)
   \tkzDrawPoint[size=12,color=green](O)
   \tkzDrawPoint[size=12,color=blue,fill=yellow]({2,2})
  \end{tikzpicture}
\end{tkzexample}

Il est possible de tracer plusieurs points en une seule fois, mais cette macro est un peu plus lente que la précédente. De plus on doit se contenter des mêmes options pour tous les points.                               

\newpage
\subsection{Tracer des points \tkzcname{tkzDrawPoints}}
\hypertarget{tdrps}{}
\begin{NewMacroBox}{tkzDrawPoints}{\oarg{local options}\parg{liste}}
\begin{tabular}{lll}
arguments &  défaut  & définition \\ 
\midrule
\TAline{liste de  points}{no default}{exemple \tkzcname{tkzDrawPoints(A,B,C)}}
\bottomrule
\end{tabular}

\medskip
\emph{Attention au « s » final, un oubli entraîne des erreurs en cascade si vous tentez de tracer des points multiples. Les options sont les mêmes que pour la macro précédente. }
\end{NewMacroBox}

\subsubsection{Exemple avec \tkzcname{tkzDefPoint} et \tkzcname{tkzDrawPoints} } 

\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}[scale=.5]
   \tkzDefPoint(1,3){A}
   \tkzDefPoint(4,1){B}
   \tkzDefPoint(0,0){O}
   \tkzDrawPoints[size=8,color=red](A,B,O)
  \end{tikzpicture}
\end{tkzexample} 
  
\subsubsection{Exemple plus complexe }
 
\begin{tkzexample}[latex=7cm]
\begin{tikzpicture}[scale=.5]
 \tkzDefPoint(2,3){A}  \tkzDefPoint(5,-1){B}  
 \tkzDefPoint[label=below:$\mathcal{C}$,
               shift={(2,3)}](-30:5.5){E}
 \begin{scope}[shift=(A)]
    \tkzDefPoint(30:5){C}
 \end{scope}   
 \tkzCalcLength[cm](A,B)\tkzGetLength{rAB}
 \tkzDrawCircle[R](A,\rAB cm)
 \tkzDrawSegment(A,B)
 \tkzDrawPoints(A,B,C) 
 \tkzLabelPoints(B,C)
 \tkzLabelPoints[above](A)
\end{tikzpicture}
\end{tkzexample}  

\newpage
%<--------------------------------------------------------------------------->
\subsection{Ajouter un label à un  point \tkzcname{tkzLabelPoint}} 
\hypertarget{tlp}{}
\emph{Il est possible d'ajouter plusieurs labels à un même point en utilisant plusieurs fois cette macro.}   

\begin{NewMacroBox}{tkzLabelPoint}{\oarg{local options}\parg{point}\var{label}}
\begin{tabular}{lll}
arguments &  exemple  &                  \\ 
\midrule
\TAline{point}{\tkzcname{tkzLabelPoint(A)\{\$A\_1\$\}}}{}
options  & défaut & définition\\
\midrule
\TOline{TikZ options}{}{couleur,position etc.}
\bottomrule
\end{tabular}

\medskip
{En option, on peut utiliser tous les styles de \TIKZ\ , en particulier le placement avec \tkzname{above}, \tkzname{right}, \dots}
\end{NewMacroBox}

\subsubsection{Exemple avec \tkzcname{tkzLabelPoint}} 

\begin{tkzexample}[latex=7cm,small]  
\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(4,0){B}
  \tkzDefPoint(0,3){C}
  \tkzDrawSegments(A,B B,C C,A)
  \tkzDrawPoints(A,B,C)
  \tkzLabelPoint[left,red](A){$A$}
  \tkzLabelPoint[right,blue](B){$B$}
  \tkzLabelPoint[above,purple](C){$C$}  
\end{tikzpicture} 
\end{tkzexample} 

\subsubsection{label et référence}
 La référence d'un point est l'objet qui permet d'utiliser le point, le label est le nom du point qui sera affiché.
 
\begin{tkzexample}[latex=8cm,small]
 \begin{tikzpicture}
    \tkzInit[xmax=1,xstep=0.15,ymax=.5]
    \tkzAxeX \tkzDrawY[noticks]
    \tkzDefPoint(0.22,0.25){A} 
    \tkzDrawPoint(A)
    \tkzLabelPoint[above](A){$A_1$}  
  \end{tikzpicture}
 \end{tkzexample}
%<--------------------------------------------------------------------------->
\subsection{Ajouter des labels aux  points \tkzcname{tkzLabelPoints}}
Il est possible de placer plusieurs labels rapidement quand les références des points sont identiques aux labels et quand les labels sont placés de la même manière par rapport aux points. Par défaut, c'est \tkzname{below right} qui a été choisi.
\hypertarget{tlps}{}  

\begin{NewMacroBox}{tkzLabelPoints}{\oarg{local options}\parg{$A_1,A_2,...$}}
\begin{tabular}{lll}
arguments &  exemple  & résultat                 \\ 
\midrule
\TAline{list of points}{\tkzcname{tkzLabelPoint(A,B,C)}}{Affichage de A, B et C}
\bottomrule
\end{tabular}

\medskip
 \emph{Cette macro diminue le nombre de lignes de codes, mais il n'est pas évident que tous les points aient besoin du même positionnement des labels.}
\end{NewMacroBox}

\subsubsection{Exemple avec \tkzcname{tkzLabelPoints}}   
\begin{tkzexample}[latex = 7cm,small]  
\begin{tikzpicture}
  \tkzDefPoint(2,3){A}
  \tkzDefShiftPoint[A](30:2){B}
  \tkzDefShiftPoint[A](30:5){C}
  \tkzDrawPoints(A,B,C)
  \tkzLabelPoints(A,B,C) 
\end{tikzpicture} 
\end{tkzexample}
%<--------------------------------------------------------------------------->
%                       tkzAutoLabelPoints
%<--------------------------------------------------------------------------->
\subsection{Position automatique des labels \tkzcname{tkzAutoLabelPoints}}
Le label d'un point est placé suivant une direction définie par un centre et un point \tkzname{center}. La distance au point est déterminé par un pourcentage de la distance entre le centre et le point. Ce pourcentage est donné par \tkzname{dist}.
\begin{NewMacroBox}{tkzLabelPoints}{\oarg{local options}\parg{$A_1,A_2,...$}}
\begin{tabular}{lll}
arguments &  exemple  & résultat                 \\ 
\midrule
\TAline{list of points}{\tkzcname{tkzLabelPoint(A,B,C)}}{Affichage de A, B et C}
\bottomrule
\end{tabular}
\end{NewMacroBox}

\subsubsection{Exemple  avec \tkzcname{tkzAutoLabelPoints}} 
Ici les points sont positionnés par rapport au centre de gravité de $A,B,C \text{et} O$
\begin{tkzexample}[latex=5cm,small]
\begin{tikzpicture}[scale=1.25]
  \tkzDefPoint(2,1){O}
  \tkzDefRandPointOn[circle=center O radius 1.5cm]
  \tkzGetPoint{A}
  \tkzDrawCircle(O,A) 
  \tkzDefPointBy[rotation=center O angle 100](A)
  \tkzGetPoint{C}
  \tkzDefPointBy[rotation=center O angle 78](A)
  \tkzGetPoint{B}
  \tkzDrawPoints(O,A,B,C) 
  \tkzDrawSegments(C,B B,A A,O O,C)
  \tkzDefCentroid(A,B,C,O)
  \tkzDrawPoint(tkzPointResult)
  \tkzAutoLabelPoints[center=tkzPointResult,
                     dist=.3,red](O,A,B,C)
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Exemple  avec \tkzcname{tkzAutoLabelPoints}} 
Cette fois la référence est $O$ et la distance est par défaut de $0.15$
\begin{tkzexample}[latex=5cm,small]
\begin{tikzpicture}[scale=1.25]
    \tkzDefPoint(2,1){O}
    \tkzDefRandPointOn[circle=center O radius 1.5cm]
    \tkzGetPoint{A}
    \tkzDrawCircle(O,A) 
    \tkzDefPointBy[rotation=center O angle 100](A)
    \tkzGetPoint{C}
    \tkzDefPointBy[rotation=center O angle 78](A)
    \tkzGetPoint{B}
    \tkzDrawPoints(O,A,B,C) 
    \tkzDrawSegments(C,B B,A A,O O,C)
    \tkzAutoLabelPoints[center=O,red](A,B,C)
\end{tikzpicture}
\end{tkzexample}
%<--------------------------------------------------------------------------->

\subsection{Style des points  avec \tkzcname{tkzSetUpPoint}}
 Il est important de comprendre que la taille d'un point dépend de la taille d'une ligne.
\begin{NewMacroBox}{tkzSetUpPoint}{\oarg{local options}}
\begin{tabular}{lll}
options &  défaut  & définition                 \\ 
\midrule
\TOline{shape}{circle}{possible : circle, cross, cross out}
\TOline{size}{current }{ la taille du point est size * line width   } 
\TOline{color}{current}{exemple \tkzcname{tkzLabelPoint(A,B,C)}} 
\TOline{fill}{current!50}{exemple \tkzcname{tkzLabelPoint(A,B,C)}} \bottomrule
\end{tabular}

\end{NewMacroBox}

Il s'agit d'une macro permettant de choisir un \hypertarget{setupoint}{style} pour les points. La macro \tkzcname{tkzDrawSegments}  est décrite \hyperlink{segs}{ici}.

\subsubsection{Exemple simple avec \tkzcname{tkzSetUpPoint}} 
\begin{tkzexample}[latex=6cm,small]
 \begin{tikzpicture} 
   \tkzSetUpPoint[shape = cross out,
                     color=blue] 
   \tkzInit[xmax=100,xstep=20,ymax=.5] 
   \tkzDefPoint(20,1){A} 
   \tkzDefPoint(80,0){B} 
   \tkzDrawLine(A,B)
   \tkzDrawPoints(A,B)
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Exemple avec \tkzcname{tkzSetUpPoint}} 
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}
  \tkzInit[ymin=-0.5,ymax=3,xmin=-0.5,xmax=7]
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(02.25,04.25){B}
  \tkzDefPoint(4,0){C}
  \tkzDefPoint(3,2){D}
  \tkzDrawSegments(A,B A,C A,D)  
  \tkzSetUpPoint[shape=cross out,size=4,]
  \tkzDrawPoints(A,B,C,D)
  \tkzLabelPoints(A,B,C,D) 
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Utilisation de\tkzcname{tkzSetUpPoint} dans un groupe}
Seuls les points du groupe sont affectés par les modifications.
 
\begin{tkzexample}[latex=7cm,small]   
\begin{tikzpicture}
  \tkzInit[ymin=-0.5,ymax=3,xmin=-0.5,xmax=7]
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(02.25,04.25){B}
  \tkzDefPoint(4,0){C}
  \tkzDefPoint(3,2){D}
  \tkzDrawSegments(A,B A,C A,D)  
{\tkzSetUpPoint[shape=cross out,
            fill= blue!70!black!!50,
            size=4,color=blue!70!black!30]
  \tkzDrawPoints(A,B)}
  \tkzSetUpPoint[fill= blue!70!black!!50,size=4,
               color=blue!70!black!30]
   \tkzDrawPoints(C,D) 
  \tkzLabelPoints(A,B,C,D) 
\end{tikzpicture} 
\end{tkzexample} 
%<--------------------------------------------------------------------------->
\subsection{Montrer les coordonnées des  points \tkzcname{tkzPointShowCoord}} 
Cette  macro permet d'afficher les coordonnées d'un point et de tracer des flèches pour préciser l'abscisse et l'ordonnée. Le point est donné par sa référence (son nom). Il est possible de donner un couple de coordonnées.

 \begin{NewMacroBox}{tkzPointShowCoord}{\oarg{local options}\parg{point}}
 \hypertarget{tpsc}{} 
\begin{tabular}{lll}
\toprule
argument             & exemple & explication                         \\ 
\midrule
\TAline{\parg{ref}}{\tkzcname{tkzPointShowCoord}(A)}{ Montre les coordonnées du point A}
\bottomrule
 \end{tabular}
 
 \medskip 
\begin{tabular}{lll}
%\toprule
option             & défaut    & explication                         \\ 
\midrule
\TOline{xlabel}{empty}{label pour l'abscisse}
\TOline{xstyle}{empty}{style pour le node du label de l'abscisse}
\TOline{noxdraw}{false}{booléen pour ne pas tracer de flèche vers $(x'x)$}
\end{tabular} 
 \end{NewMacroBox}   

\subsubsection{styles par défaut}

\begin{tkzltxexample}[small]
\tikzset{arrow coord style/.style={dashed,
                             \tkz@euc@linecolor,
                             >=latex',
                             ->}}
\tikzset{xcoord style/.style={\tkz@euc@labelcolor,
                           font=\normalsize,text height=1ex,
                           inner sep = 0pt,
                           outer sep = 0pt,
                           fill=\tkz@fillcolor,
                           below=3pt}} 
\tikzset{ycoord style/.style={\tkz@euc@labelcolor,
                           font=\normalsize,text height=1ex, 
                           inner sep = 0pt,
                           outer sep = 0pt, 
                           fill=\tkz@fillcolor,
                           left=3pt}}
\end{tkzltxexample}

\subsubsection{Exemple avec \tkzcname{tkzPointShowCoord}} 
Sans les options, on n'obtient que les flèches.


\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}[scale=1.5]
   \tkzInit[xmax=3,ymax=2]
   \tkzAxeXY
   \tkzDefPoint(2,1){a}
   \tkzPointShowCoord(a) 
   \tkzDrawPoint(a)
   \tkzLabelPoint(a){$A_1$}
   \tkzPointShowCoord({1,2}) 
   \tkzDrawPoint({1,2})
   \tkzLabelPoint({1,2}){$A_2$}
  \end{tikzpicture}  
\end{tkzexample}

\subsubsection{Exemple avec \tkzcname{tkzPointShowCoord} et \tkzname{xstep}} 
Sans les options, on n'obtient que les flèches.


\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}[xscale=3,yscale=2]
   \tkzInit[xmax=15,ymax=15,
           xstep=10,ystep=10]
   \tkzAxeXY
   \tkzDefPoint(10,10){a} \tkzDrawPoint(a)
   \tkzPointShowCoord(a)
   \tkzLabelPoint(a){$A_1$}
  \end{tikzpicture}  
\end{tkzexample}  


\subsection{\tkzcname{tkzDefSetOfPoints}} % (fold)
\noindent\space : Il était déjà possible de créer un nuage de points avec la macro \tkzcname{tkzDefPoints}, mais cela impose de donner une référence (un nom) à chaque point, ce qui est parfois fastidieux. La macro \tkzcname{tkzSetOfPoints}   permet de définir des points \tkzname{tkzPt1}, \tkzname{tkzPt2},etc.

C'est ce qu'on appelle fréquemment  \hypertarget{label_tkzDefSetOfPoints}{« nuage de points»}. La différence par rapport à la macro  \tkzcname{tkzDefPoints}, c'est que la référence aux points est donnée par un préfixe (par défaut tkzPt) et le numéro du point. 
Les points ne sont pas tracés. 

\begin{NewMacroBox}{tkzDefSetOfPoints}{\oarg{local options}\var{$x_1/y_1,x_2/y_2,\ldots,x_n/y_n$}}

\begin{tabular}{lll}

arguments &  défaut  & définition  \\ 
\midrule
\TAline{$x_n/y_n$}{no default}{Liste de couples $x_n/y_n$ séparés par des virgules}
\bottomrule
\end{tabular}

\medskip
\begin{tabular}{lll}

options             & défaut & définition   \\ 
\midrule
\TOline{prefix} {tkzPt} {préfixe pour les noms des points}
\end{tabular}
\end{NewMacroBox} 
 
\subsubsection{Création d'un nuage avec \tkzcname{tkzDefSetOfPoints}} 

\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}
  \tkzInit[ymax=4,xmax=5]
  \tkzAxeXY
  \tkzDefSetOfPoints[prefix=P]%
           {1/2,4/3,2/2.5}
  \tkzDrawPoints(P1,P2,P3) 
  \tkzLabelPoints(P1,P2,P3)
\end{tikzpicture}
\end{tkzexample}  
   
\endinput