summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/latex/TKZdoc-euclide-pointby.tex
blob: fdc4f91fb99f7ee2b1a2f219c1bf01ffd020c6c2 (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
\section{Definition of points by transformation; \tkzcname{tkzDefPointBy} }
These transformations are:

\begin{itemize}
   \item translation;
   \item homothety;
   \item orthogonal reflection or symmetry;
   \item central symmetry;
   \item orthogonal projection;
   \item rotation (degrees or radians);
   \item inversion with respect to a circle.
\end{itemize}

The choice of transformations is made through the options. There are two macros, one for the transformation of a single point \tkzcname{tkzDefPointBy} and the other for the transformation of a list of points \tkzcname{tkzDefPointsBy}. By default the image of $A$ is $A'$. For example, we'll write:
\begin{tkzltxexample}[]
\tkzDefPointBy[translation= from A to A'](B) 
\end{tkzltxexample}
The result is in \tkzname{tkzPointResult}
\medskip
\begin{NewMacroBox}{tkzDefPointBy}{\oarg{local options}\parg{pt}}%
The argument is a simple existing point and its image is stored in \tkzname{tkzPointResult}. If you want to keep this point then the macro \tkzcname{tkzGetPoint\{M\}} allows you to assign the name \tkzname{M} to the point.

\begin{tabular}{lll}%
\toprule
arguments &  definition & examples               \\ 
\midrule
\TAline{pt}   {existing point name}   {$(A)$}
\bottomrule
\end{tabular}

\begin{tabular}{lll}%
options     &     & examples                         \\ 
\midrule
\TOline{translation}{= from \#1 to \#2}{[translation=from A to B](E)}
\TOline{homothety}  {= center \#1 ratio \#2}{[homothety=center A ratio .5](E)}
\TOline{reflection} {= over \#1--\#2}{[reflection=over A--B](E)}
\TOline{symmetry }  {= center \#1}{[symmetry=center A](E)}
\TOline{projection }{= onto \#1--\#2}{[projection=onto A--B](E)}
\TOline{rotation }  {= center \#1 angle \#2}{[rotation=center O angle 30](E)}
\TOline{rotation in rad}{= center \#1 angle \#2}{[rotation in rad=center O angle pi/3](E)} 
\TOline{inversion}{= center \#1 through \#2}{[inversion =center O through A](E)} 
\bottomrule
\end{tabular}

The image is only defined and not drawn.
\end{NewMacroBox} 

\subsection{Examples of transformations}
\subsubsection{Example of translation} 

\subsection{Example of translation}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[>=latex] 
 \tkzDefPoint(0,0){A}  \tkzDefPoint(3,1){B}
 \tkzDefPoint(3,0){C}  
 \tkzDefPointBy[translation= from B to A](C) 
 \tkzGetPoint{D} 
 \tkzDrawPoints[teal](A,B,C,D)
 \tkzLabelPoints[color=teal](A,B,C,D) 
 \tkzDrawSegments[orange,->](A,B D,C) 
\end{tikzpicture} 
\end{tkzexample}

\subsubsection{Example of reflection (orthogonal symmetry)} 

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}[scale=1]
 \tkzDefPoints{1.5/-1.5/C,-4.5/2/D}    
 \tkzDefPoint(-4,-2){O} 
 \tkzDefPoint(-2,-2){A}
 \foreach \i in {0,1,...,4}{%
 \pgfmathparse{0+\i * 72}
 \tkzDefPointBy[rotation=%
 center O angle \pgfmathresult](A)
  \tkzGetPoint{A\i} 
 \tkzDefPointBy[reflection = over C--D](A\i)
  \tkzGetPoint{A\i'}}
 \tkzDrawPolygon(A0, A2, A4, A1, A3)    
 \tkzDrawPolygon(A0', A2', A4', A1', A3')
 \tkzDrawLine[add= .5 and .5](C,D)
\end{tikzpicture}
\end{tkzexample}


\subsubsection{Example of \tkzname{homothety} and \tkzname{projection}}

\begin{tkzexample}[vbox,small] 
\begin{tikzpicture}[scale=1.2] 
  \tkzDefPoint(0,1){A}   \tkzDefPoint(5,3){B}   \tkzDefPoint(3,4){C} 
  \tkzDefLine[bisector](B,A,C)                     \tkzGetPoint{a} 
  \tkzDrawLine[add=0 and 0,color=magenta!50 ](A,a) 
  \tkzDefPointBy[homothety=center A ratio .5](a)   \tkzGetPoint{a'} 
  \tkzDefPointBy[projection = onto A--B](a')       \tkzGetPoint{k'}  
  \tkzDefPointBy[projection = onto A--B](a)       \tkzGetPoint{k} 
  \tkzDrawLines[add= 0 and .3](A,k A,C)   
  \tkzDrawSegments[blue](a',k' a,k) 
  \tkzDrawPoints(a,a',k,k',A)
  \tkzDrawCircles(a',k' a,k)   
  \tkzLabelPoints(a,a',k,A)
\end{tikzpicture}
\end{tkzexample}  


\subsubsection{Example of projection}
\begin{tkzexample}[vbox,small] 
\begin{tikzpicture}[scale=1.5]  
 \tkzDefPoint(0,0){A}
 \tkzDefPoint(0,4){B}
 \tkzDefTriangle[pythagore](B,A) \tkzGetPoint{C}
 \tkzDefLine[bisector](B,C,A) \tkzGetPoint{c}
 \tkzInterLL(C,c)(A,B)        \tkzGetPoint{D}
 \tkzDefPointBy[projection=onto B--C](D) \tkzGetPoint{G}
 \tkzInterLC(C,D)(D,A) \tkzGetPoints{E}{F}
 \tkzDrawPolygon[teal](A,B,C)
 \tkzDrawSegment(C,D)
 \tkzDrawCircle(D,A)
 \tkzDrawSegment[orange](D,G)
 \tkzMarkRightAngle[fill=orange!20](D,G,B)
 \tkzDrawPoints(A,C,F) \tkzLabelPoints(A,C,F)
 \tkzDrawPoints(B,D,E,G)   
 \tkzLabelPoints[above right](B,D,E,G)
 \end{tikzpicture}
 \end{tkzexample} 

\subsubsection{Example of symmetry}
\begin{tkzexample}[vbox,small] 
\begin{tikzpicture}[scale=1]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(2,-1){A}
  \tkzDefPoint(2,2){B}
  \tkzDefPointsBy[symmetry=center O](B,A){}
  \tkzDrawLine(A,A')
  \tkzDrawLine(B,B')
  \tkzMarkAngle[mark=s,arc=lll,
      size=2 cm,mkcolor=red](A,O,B) 
  \tkzLabelAngle[pos=1,circle,draw,
     fill=blue!10](A,O,B){$60^{\circ}$} 
  \tkzDrawPoints(A,B,O,A',B') 
  \tkzLabelPoints(A,B,O,A',B') 
\end{tikzpicture}  
\end{tkzexample}

\subsubsection{Example of rotation} 
\begin{tkzexample}[latex=7cm,small] 
\begin{tikzpicture}[scale=0.5] 
 \tkzDefPoint(0,0){A} 
 \tkzDefPoint(5,0){B}
 \tkzDrawSegment(A,B)
 \tkzDefPointBy[rotation=center A angle 60](B) 
 \tkzGetPoint{C} 
 \tkzDefPointBy[symmetry=center C](A) 
 \tkzGetPoint{D} 
 \tkzDrawSegment(A,tkzPointResult) 
 \tkzDrawLine(B,D)
 \tkzDrawArc[orange,delta=10](A,B)(C) 
 \tkzDrawArc[orange,delta=10](B,C)(A)
 \tkzDrawArc[orange,delta=10](C,D)(D)  
 \tkzMarkRightAngle(D,B,A)  
\end{tikzpicture}  
\end{tkzexample}  

\subsubsection{Example of rotation in radian} 
\begin{tkzexample}[latex=6cm,small]
\begin{tikzpicture}
  \tkzDefPoint["$A$" left](1,5){A}
  \tkzDefPoint["$B$" right](5,2){B}
  \tkzDefPointBy[rotation in rad= center A angle pi/3](B)
  \tkzGetPoint{C}  
  \tkzDrawSegment(A,B)
  \tkzDrawPoints(A,B,C) 
  \tkzCompass[color=red](A,C)
  \tkzCompass[color=red](B,C) 
  \tkzLabelPoints(C)
\end{tikzpicture}
\end{tkzexample} 

\subsubsection{Inversion of points}
\begin{tkzexample}[latex=8cm,small]  
\begin{tikzpicture}[scale=1.5]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(1,0){A}
  \tkzDefPoint(-1.5,-1.5){z1}
  \tkzDefPoint(0.35,0){z2} 
  \tkzDefPointBy[inversion =%
      center O through A](z1)
  \tkzGetPoint{Z1} 
  \tkzDefPointBy[inversion =%
      center O through A](z2)
  \tkzGetPoint{Z2}
  \tkzDrawCircle(O,A)  
  \tkzDrawPoints[color=black,
      fill=red,size=4](Z1,Z2)    
  \tkzDrawSegments(z1,Z1 z2,Z2)
  \tkzDrawPoints[color=black,
      fill=red,size=4](O,z1,z2)
  \tkzLabelPoints(O,A,z1,z2,Z1,Z2)  
\end{tikzpicture}
\end{tkzexample} 


\subsubsection{Point Inversion: Orthogonal Circles} 
\begin{tkzexample}[latex=8cm,small]
\begin{tikzpicture}[scale=1.5]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(1,0){A}
  \tkzDrawCircle(O,A) 
  \tkzDefPoint(0.5,-0.25){z1}
  \tkzDefPoint(-0.5,-0.5){z2}
  \tkzDefPointBy[inversion = %
     center O through A](z1)
  \tkzGetPoint{Z1} 
  \tkzCircumCenter(z1,z2,Z1)
  \tkzGetPoint{c}
  \tkzDrawCircle(c,Z1)
  \tkzDrawPoints[color=black,
     fill=red,size=4](O,z1,z2,Z1,O,A) 
\end{tikzpicture}
\end{tkzexample}

\subsection{Transformation of multiple points; \tkzcname{tkzDefPointsBy} }
Variant of the previous macro for defining multiple images.
You must give the names of the images as arguments, or indicate that the names of the images are formed from the names of the antecedents, leaving the argument empty. 

\begin{tkzltxexample}[]
\tkzDefPointsBy[translation= from A to A'](B,C){}
\end{tkzltxexample}
The images are $B'$ and $C'$.

\begin{tkzltxexample}[]
\tkzDefPointsBy[translation= from A to A'](B,C){D,E} 
\end{tkzltxexample}
The images are $D$ and $E$.

\begin{tkzltxexample}[]
\tkzDefPointsBy[translation= from A to A'](B)
\end{tkzltxexample}
The image is $B'$.
\begin{NewMacroBox}{tkzDefPointsBy}{\oarg{local options}\parg{list of points}\marg{list of points}}%
\begin{tabular}{lll}%
arguments &  examples  &                  \\ 
\midrule
\TAline{\parg{list of points}\marg{list of pts}}{(A,B)\{E,F\}}{$E$ is the image of $A$ and $F$ is the image of $B$.}   \\
\bottomrule
\end{tabular}

\medskip
If the list of images is empty then the name of the image is the name of the antecedent to which " ' " is added.

\medskip
\begin{tabular}{lll}%
\toprule
options     &     & examples                         \\ 
\midrule
\TOline{translation = from \#1 to \#2}{}{[translation=from A to B](E)\{\}}
\TOline{homothety = center \#1 ratio \#2}{}{[homothety=center A ratio .5](E)\{F\}}
\TOline{reflection = over \#1--\#2}{}{[reflection=over A--B](E)\{F\}}
\TOline{symmetry = center \#1}{}{[symmetry=center A](E)\{F\}}
\TOline{projection = onto \#1--\#2}{}{[projection=onto A--B](E)\{F\}}
\TOline{rotation = center \#1 angle \#2}{}{[rotation=center  angle 30](E)\{F\}}
\TOline{rotation in rad = center \#1 angle \#2}{}{for instance angle pi/3}
\bottomrule
\end{tabular}

\medskip
The points are only defined and not drawn.
\end{NewMacroBox}

\subsubsection{Example of translation}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[>=latex] 
 \tkzDefPoint(0,0){A}  \tkzDefPoint(3,1){A'}
 \tkzDefPoint(3,0){B}  \tkzDefPoint(1,2){C} 
 \tkzDefPointsBy[translation= from A to A'](B,C){} 
 \tkzDrawPolygon[color=blue](A,B,C)
 \tkzDrawPolygon[color=red](A',B',C')
 \tkzDrawPoints[color=blue](A,B,C)
 \tkzDrawPoints[color=red](A',B',C') 
 \tkzLabelPoints(A,B,A',B')  
 \tkzLabelPoints[above](C,C')
 \tkzDrawSegments[color = gray,->,
              style=dashed](A,A' B,B' C,C') 
\end{tikzpicture}
\end{tkzexample}

\endinput