summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
blob: 03a6721bd210e62e4493e2be7443355f30299762 (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
\section{The points}

I made a distinction between the point used in Euclidean geometry and the point used to represent an element of a statistical cloud. In the first case, I use as object a \tkzname{node}, which means that the representation of the point cannot be modified by a \tkzname{scale}; in the second case, I use as object a \tkzname{plot mark}. The latter can be scaled and have more varied forms than the node.

The new macro is \tkzNameMacro{tkzDefPoint}, it allows to use \TIKZ-specific options as a shift and the values are processed with tkz-base. Moreover, if calculations are needed then the \tkzNamePack{xfp} package takes care of them. You can use Cartesian or polar coordinates.

\subsection{Defining a point in Cartesian coordinates: \tkzcname{tkzDefPoint}} \hypertarget{tdp}{}

\begin{NewMacroBox}{tkzDefPoint}{\oarg{local options}\parg{x,y}\var{name} ou \parg{a:r}\var{name}}%
\begin{tabular}{lll}%
arguments &  default & definition  \\ 
\midrule
\TAline{x,y}{no default}{$x$ and $y$ are two dimensions, by default in cm.}
\TAline{a:r}{no default}{$a$ is an angle in degrees, $r$ is a dimension}
\bottomrule
\end{tabular}

\medskip
\noindent{The mandatory arguments of this macro are two dimensions expressed with decimals, in the first case they are two measures of length, in the second case they are a measure of length and the measure of an angle in degrees}.

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition   \\ 
\midrule
\TOline{shift} {(0,0)} {value spacing}
 \bottomrule
\end{tabular}

\medskip
\noindent{All the options of \TIKZ\ that we can apply to \tkzname{coordinate}, are applicable (well I hope!) as for example the option \tkzname{label} defined with the library \tkzname{quotes}.}
\end{NewMacroBox}

\subsubsection{Use of \tkzname{shift}}
\tkzname{shift} allows the points to be placed in relation to each other. 

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

\subsection{Placing a label with the library \tkzname{quotes}}
I prefer not to mix operations and use \tkzcname{tkzLabelPoint} to place labels. See section The Syntax Quotes.

\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 with \tkzname{shift} and \tkzname{scope}}  
Preferable to rotate is to use an environment \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{Forms and coordinates}
Here we must follow the syntax of \tkzNamePack{xfp}. It is always possible to go through \tkzNamePack{pgfmath} but in this case, the coordinates must be calculated before using the 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} }
First, we can use the \tkzNameEnv{scope} de \TIKZ\
In the following example, we have a way to define an isosceles triangle.

\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{Definition of points in Cartesian coordinates: \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$ are the coordinates of a referenced point $n_1$ 

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

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

%<--------------------------------------------------------------------------->
\subsection{Point relative to another: \tkzcname{tkzDefShiftPoint}} 
\hypertarget{tdsp}{} 
\begin{NewMacroBox}{tkzDefShiftPoint}{\oarg{Point}\parg{x,y}\var{name} ou \parg{a:r}\var{name}}%
\begin{tabular}{lll}%
arguments &  default & definition \\ 
\midrule
\TAline{(x,y)}{no default}{$x$ and $y$ are two dimensions, by default in cm.}
\TAline{(a:r)}{no default}{$a$ is an angle in degrees, $r$ is a dimension}
\TAline{point} {no default} {\tkzcname{tkzDefShiftPoint}[A](0:4)\{B\}} 
\bottomrule
\end{tabular}

No options. The name of the point is mandatory.
\end{NewMacroBox}

\subsubsection{Example with  \tkzcname{tkzDefShiftPoint}}
This macro allows you to place one point relative to another. This is equivalent to a translation. Here is how to construct an isosceles triangle with main vertex $A$ and angle at vertex of $30^\circ$. 

\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 relative to another: \tkzcname{tkzDefShiftPointCoord}}
\begin{NewMacroBox}{tkzDefShiftPointCoord}{\oarg{a,b}\parg{x,y}\var{name} ou \parg{a:r}\var{name}}%
{This involves performing a $(a,b)$ vector translation at the defined point relative to the origin.}

\medskip
\begin{tabular}{lll}%
\toprule
arguments &  default & definition \\ 
\midrule
\TAline{(x,y)}{no default}{$x$ and $y$ are two dimensions, by default in cm.}
\TAline{(a:r)}{no default}{$a$ is an angle in degrees, $r$ is a dimension}
\bottomrule
\end{tabular}

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

The option is mandatory
\end{NewMacroBox}

  
\subsubsection{Equilateral triangle with \tkzcname{tkzDefShiftPointCoord}}
Let's see how to get an equilateral triangle (there is much simpler)

\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{Isosceles triangle with \tkzcname{tkzDefShiftPointCoord}}
Let's see how to obtain an isosceles triangle with a principal angle of 30 degrees. Rotation is possible. $AB=AC=5$ and $\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{Drawing a point \tkzcname{tkzDrawPoint}} \hypertarget{tdrp}{}
\begin{NewMacroBox}{tkzDrawPoint}{\oarg{local options}\parg{point}}%
\begin{tabular}{lll}%
arguments &  default & definition                 \\ 
\midrule
\TAline{point} {no default}  {a name or reference is requested}
\bottomrule
\end{tabular}

\medskip
\noindent{The argument is mandatory, but it is not necessary (although recommended) to use a reference; a pair of coordinates placed between braces is accepted. The disk takes the color of the circle, but 50\% lighter. It is possible to modify everything. The point is a node and is therefore invariant if the drawing is modified by scaling..}

\medskip
\begin{tabular}{lll}%
\toprule
options             & default & definition  \\ 
\midrule
\TOline{shape}  {circle}{Possible \tkzname{cross} ou \tkzname{cross out}} 
\TOline{size}   {2 pt} {disk size}
\TOline{color}  {black}{the default color can be changed}
\bottomrule
\end{tabular}

\medskip
\noindent{We can create other forms such as \tkzname{cross}}
\end{NewMacroBox}

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

\subsubsection{Changing the style} 
The default definition in the file \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{Example of point plots}
Note that \tkzname{scale} does not affect the shape of the dots. Which is normal.  Most of the time, we are satisfied with a single point shape that we can define from the beginning, either with a macro or by modifying a configuration file. 

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

It is possible to draw several points at once, but this macro is a little slower than the previous one. Moreover, we have to make do with the same options for all the points.                               

\subsection{Drawing points \tkzcname{tkzDrawPoints}}
\hypertarget{tdrps}{}
\begin{NewMacroBox}{tkzDrawPoints}{\oarg{local options}\parg{liste}}%
\begin{tabular}{lll}%
arguments &  default & definition \\ 
\midrule
\TAline{points list}{no default}{example \tkzcname{tkzDrawPoints(A,B,C)}}
\bottomrule
\end{tabular}

\medskip
Warning at the final "s", an oversight leads to cascading errors if you attempt to plot multiple points. The options are the same as for the previous macro. 
\end{NewMacroBox}

\subsubsection{Example with \tkzcname{tkzDefPoint} and \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{More complex example } 
\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}  

%<--------------------------------------------------------------------------->
\subsection{Add a label to a point \tkzcname{tkzLabelPoint}} 
\hypertarget{tlp}{}
It is possible to add several labels at the same point by using this macro several times.  

\begin{NewMacroBox}{tkzLabelPoint}{\oarg{local options}\parg{point}\var{label}}%
\begin{tabular}{lll}%
arguments &  example  &                  \\ 
\midrule
\TAline{point}{\tkzcname{tkzLabelPoint(A)\{\$A\_1\$\}}}{}
options  & default & definition\\
\midrule
\TOline{TikZ options}{}{colour, position etc.}
\bottomrule
\end{tabular}

\medskip
Optionally, we can use any style of Tikz, especially placement with above, right, dots...
\end{NewMacroBox}

\subsubsection{Example with \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 and reference}
 The reference of a point is the object that allows to use the point, the label is the name of the point that will be displayed.
 
\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{Add labels to points \tkzcname{tkzLabelPoints}}
It is possible to place several labels quickly when the point references are identical to the labels and when the labels are placed in the same way in relation to the points. By default, \tkzname{below right} is chosen.
\hypertarget{tlps}{}  

\begin{NewMacroBox}{tkzLabelPoints}{\oarg{local options}\parg{$A_1,A_2,...$}}%
\begin{tabular}{lll}
arguments &  example & result                 \\ 
\midrule
\TAline{list of points}{\tkzcname{tkzLabelPoint(A,B,C)}}{Display of $A$, $B$ and $C$}
\bottomrule
\end{tabular}

\medskip
This macro reduces the number of lines of code, but it is not obvious that all points need the same label positioning.
\end{NewMacroBox}

\subsubsection{Example with \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{Automatic position of labels \tkzcname{tkzAutoLabelPoints}}
The label of a point is placed in a direction defined by a center and a point \tkzname{center}. The distance to the point is determined by a percentage of the distance between the center and the point. This percentage is given by \tkzname{dist}.
\begin{NewMacroBox}{tkzLabelPoints}{\oarg{local options}\parg{$A_1,A_2,...$}}%
\begin{tabular}{lll}
arguments &  example & result                 \\ 
\midrule
\TAline{list of points}{\tkzcname{tkzLabelPoint(A,B,C)}}{Display of $A$, $B$ and $C$}
\end{tabular}
\end{NewMacroBox}

\subsubsection{Example with \tkzcname{tkzAutoLabelPoints}} 
Here the points are positioned relative to the center of gravity of $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{Example with \tkzcname{tkzAutoLabelPoints}} 
This time the reference is $O$ and the distance is by default $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{Point style with \tkzcname{tkzSetUpPoint}}
 It is important to understand that the size of a dot depends on the size of a line.
\begin{NewMacroBox}{tkzSetUpPoint}{\oarg{local options}}%
\begin{tabular}{lll}
options &  default & definition                 \\ 
\midrule
\TOline{shape}{circle}{possible: circle, cross, cross out}
\TOline{size}{current }{the size of the point is size * line width   } 
\TOline{color}{current}{example \tkzcname{tkzLabelPoint(A,B,C)}} 
\TOline{fill}{current!50}{example \tkzcname{tkzLabelPoint(A,B,C)}} 
\end{tabular}
\end{NewMacroBox}

This is a macro for choosing a \hypertarget{setupoint}{style} for points.
\subsubsection{Simple example with \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{Example with \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{Using \tkzcname{tkzSetUpPoint} in a group}
Only the points in the group are affected by the changes.
 
\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{Show point coordinates} 
This macro allows you to display the coordinates of a point and to draw arrows to specify the abscissa and ordinate. The point is given by its reference (its name). It is possible to give a couple of coordinates.
 \hypertarget{tpsc}{} 
\begin{NewMacroBox}{tkzPointShowCoord}{\oarg{local options}\parg{point}}%
\begin{tabular}{lll}%
argument     & example & explanation                         \\ 
\midrule
\TAline{\parg{ref}}{\tkzcname{tkzPointShowCoord}(A)}{shows the coordinates of point $A$}
\bottomrule
\end{tabular}
 
\medskip 
\begin{tabular}{lll}%
option             & default    & explication                         \\ 
\midrule
\TOline{xlabel}{empty}{label abscissa}
\TOline{xstyle}{empty}{style for the abscissa label node}
\TOline{noxdraw}{false}{boolean so as not to draw an arrow to $(x'x)$}
\end{tabular} 
\end{NewMacroBox}   

\subsubsection{Default styles}
Here are some of the main styles:
\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{Example with \tkzcname{tkzPointShowCoord}} 
Without the options, you only get the arrows.


\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{Example with \tkzcname{tkzPointShowCoord} and \tkzname{xstep}} 
Without the options, you only get the arrows.


\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)
It was already possible to create a scatter plot with the macro \tkzcname{tkzDefPoints}, but this requires making a reference (a name) to each point, which is sometimes tedious. The macro \tkzcname{tkzSetOfPoints} allows to define points \tkzname{tkzPt1}, \tkzname{tkzPt2}, etc.

This is frequently referred to as \hypertarget{label_tkzDefSetOfPoints}{« scatter plot"}. The difference from the macro \tkzcname{tkzDefPoints} is that the reference to the points is given by a prefix (default tkzPt) and the point number. 
The points are not drawn. 

\begin{NewMacroBox}{tkzDefSetOfPoints}{\oarg{local options}\var{$x_1/y_1,x_2/y_2,\ldots,x_n/y_n$}}%
\begin{tabular}{lll}%
arguments &  default & definition  \\ 
\midrule
\TAline{$x_n/y_n$}{no default}{List of couples $x_n/y_n$ separated by commas}
\bottomrule
\end{tabular}

\medskip
\begin{tabular}{lll}%
options             & default & definition   \\ 
\midrule
\TOline{prefix} {tkzPt} {prefix for point names}
\end{tabular}
\end{NewMacroBox} 
 
\subsubsection{Creating a scatter plot with \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