Debian Codegraph @

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

raw
1 \section{Defining points using a vector}
2
3 \subsection{\tkzcname{tkzDefPointWith}}
4 There are several possibilities to create points that meet certain vector conditions.
5 This can be done with
6
7 \tkzcname{tkzDefPointWith}. The general principle is as follows, two points are passed as arguments, i.e. a vector. The different options allow to obtain a new point forming with the first point (with some exceptions) a collinear vector or a vector orthogonal to the first vector. Then the length is either proportional to that of the first one, or proportional to the unit. Since this point is only used temporarily, it does not have to be named immediately. The result is in \tkzname{tkzPointResult}. The macro \tkzNameMacro{tkzGetPoint} allows you to retrieve the point and name it differently.
8
9 There are options to define the distance between the given point and the obtained point.
10 In the general case this distance is the distance between the 2 points given as arguments if the option is of the "normed" type then the distance between the given point and the obtained point is 1 cm. Then the $K$ option allows to obtain multiples.
11
12 \begin{NewMacroBox}{tkzDefPointWith}{\parg{pt1,pt2}}%
13 It is in fact the definition of a point meeting vectorial conditions.
14
15 \medskip
16
17 \begin{tabular}{lll}%
18 \toprule
19 arguments & definition & explanation \\
20 \midrule
21 \TAline{(pt1,pt2)} {point couple}{the result is a point in \tkzname{tkzPointResult} } \\
22
23 \bottomrule
24 \end{tabular}
25
26 \medskip
27 In what follows, it is assumed that the point is recovered by \tkzNameMacro{tkzGetPoint\{C\}}
28
29 \begin{tabular}{lll}%
30 \toprule
31 options & example & explanation \\
32 \midrule
33 \TOline{orthogonal}{[orthogonal](A,B)}{$AC=AB$ and $\overrightarrow{AC} \perp \overrightarrow{AB}$}
34 \TOline{orthogonal normed}{[orthogonal normed](A,B)}{$AC=1$ and $\overrightarrow{AC} \perp \overrightarrow{AB}$}
35 \TOline{linear}{[linear](A,B)}{$\overrightarrow{AC}=K \times \overrightarrow{AB}$}
36 \TOline{linear normed}{[linear normed](A,B)}{$AC=K$ and $\overrightarrow{AC}=k\times \overrightarrow{AB}$ }
37 \TOline{colinear= at \#1}{[colinear= at C](A,B)}{$\overrightarrow{CD}= \overrightarrow{AB}$ }
38 \TOline{colinear normed= at \#1}{[colinear normed= at C](A,B)}{$\overrightarrow{CD}= \overrightarrow{AB}$ }
39 \TOline{K}{[linear](A,B),K=2}{$\overrightarrow{AC}=2\times \overrightarrow{AB}$}
40 \end{tabular}
41 \end{NewMacroBox}
42
43 \subsubsection{Option \tkzname{colinear at}, simple example}
44 $(\overrightarrow{AB}=\overrightarrow{CD})$
45 \begin{tkzexample}[latex=6cm,small]
46 \begin{tikzpicture}[scale=1.2,
47 vect/.style={->,shorten >=1pt,>=latex'}]
48 \tkzDefPoint(2,3){A} \tkzDefPoint(4,2){B}
49 \tkzDefPoint(0,1){C}
50 \tkzDefPointWith[colinear=at C](A,B)
51 \tkzGetPoint{D}
52 \tkzDrawPoints[new](A,B,C,D)
53 \tkzLabelPoints[above right=3pt](A,B,C,D)
54 \tkzDrawSegments[vect](A,B C,D)
55 \end{tikzpicture}
56 \end{tkzexample}
57
58 \subsubsection{Option \tkzname{colinear at}, complex example}
59 \begin{tkzexample}[vbox,small]
60 \begin{tikzpicture}[scale=.75]
61 \tkzDefPoints{0/0/B,3.6/0/C,1.5/4/A}
62 \tkzDefSpcTriangle[ortho](A,B,C){Ha,Hb,Hc}
63 \tkzDefTriangleCenter[ortho](A,B,C) \tkzGetPoint{H}
64 \tkzDefSquare(A,C) \tkzGetPoints{R}{S}
65 \tkzDefSquare(B,A) \tkzGetPoints{M}{N}
66 \tkzDefSquare(C,B) \tkzGetPoints{P}{Q}
67 \tkzDefPointWith[colinear= at M](A,S) \tkzGetPoint{A'}
68 \tkzDefPointWith[colinear= at P](B,N) \tkzGetPoint{B'}
69 \tkzDefPointWith[colinear= at Q](C,R) \tkzGetPoint{C'}
70 \tkzDefPointBy[projection=onto P--Q](Ha) \tkzGetPoint{Pa}
71 \tkzDrawPolygon[teal,thick](A,C,R,S)\tkzDrawPolygon[teal,thick](A,B,N,M)
72 \tkzDrawPolygon[teal,thick](C,B,P,Q)
73 \tkzDrawPoints[teal,size=2](A,B,C,Ha,Hb,Hc,A',B',C')
74 \tkzDrawSegments[ultra thin,red](M,A' A',S P,B' B',N Q,C' C',R B,S C,M C,N B,R A,P A,Q)
75 \tkzDrawSegments[ultra thin,teal, dashed](A,Ha B,Hb C,Hc)
76 \tkzDefPointBy[rotation=center A angle 90](S) \tkzGetPoint{S'}
77 \tkzDrawSegments[ultra thin,teal,dashed](B,S' A,S' A,A' M,S' B',Q P,C' M,S Ha,Pa)
78 \tkzDrawArc(A,S)(S')
79 \end{tikzpicture}
80 \end{tkzexample}
81
82 \subsubsection{Option \tkzname{colinear at}}
83 How to use $K$
84 \begin{tkzexample}[latex=7cm,small]
85 \begin{tikzpicture}[vect/.style={->,
86 shorten >=1pt,>=latex'}]
87 \tkzDefPoints{0/0/A,5/0/B,1/2/C}
88 \tkzDefPointWith[colinear=at C](A,B)
89 \tkzGetPoint{G}
90 \tkzDefPointWith[colinear=at C, K=0.5](A,B)
91 \tkzGetPoint{H}
92 \tkzLabelPoints(A,B,C,G,H)
93 \tkzDrawPoints(A,B,C,G,H)
94 \tkzDrawSegments[vect](A,B C,H)
95 \end{tikzpicture}
96 \end{tkzexample}
97
98 \subsubsection{Option \tkzname{colinear at} }
99 With $K=\frac{\sqrt{2}}{2}$
100
101 \begin{tkzexample}[latex=6cm,small]
102 \begin{tikzpicture}[vect/.style={->,
103 shorten >=1pt,>=latex'}]
104 \tkzDefPoints{1/1/A,4/2/B,2/2/C}
105 \tkzDefPointWith[colinear=at C,K=sqrt(2)/2](A,B)
106 \tkzGetPoint{D}
107 \tkzDrawPoints[color=red](A,B,C,D)
108 \tkzDrawSegments[vect](A,B C,D)
109 \end{tikzpicture}
110 \end{tkzexample}
111
112 \subsubsection{Option \tkzname{orthogonal}}
113 AB=AC since $K=1$.
114 \begin{tkzexample}[latex=6cm,small]
115 \begin{tikzpicture}[scale=1.2,
116 vect/.style={->,shorten >=1pt,>=latex'}]
117 \tkzDefPoints{2/3/A,4/2/B}
118 \tkzDefPointWith[orthogonal,K=1](A,B)
119 \tkzGetPoint{C}
120 \tkzDrawPoints[color=red](A,B,C)
121 \tkzLabelPoints[right=3pt](B,C)
122 \tkzLabelPoints[below=3pt](A)
123 \tkzDrawSegments[vect](A,B A,C)
124 \tkzMarkRightAngle(B,A,C)
125 \end{tikzpicture}
126 \end{tkzexample}
127
128
129
130 \subsubsection{Option \tkzname{orthogonal}}
131 With $K=-1$
132 OK=OI since $\lvert K \rvert=1$ then OI=OJ=OK.
133
134 \begin{tkzexample}[latex=7cm,small]
135 \begin{tikzpicture}[scale=.75]
136 \tkzDefPoints{1/2/O,2/5/I}
137 \tkzDefPointWith[orthogonal](O,I)
138 \tkzGetPoint{J}
139 \tkzDefPointWith[orthogonal,K=-1](O,I)
140 \tkzGetPoint{K}
141 \tkzDrawSegment(O,I)
142 \tkzDrawSegments[->](O,J O,K)
143 \tkzMarkRightAngles(I,O,J I,O,K)
144 \tkzDrawPoints(O,I,J,K)
145 \tkzLabelPoints(O,I,J,K)
146 \end{tikzpicture}
147 \end{tkzexample}
148
149 \subsubsection{Option \tkzname{orthogonal} more complicated example}
150 \begin{tkzexample}[latex=7cm,small]
151 \begin{tikzpicture}[scale=.75]
152 \tkzDefPoints{0/0/A,6/0/B}
153 \tkzDefMidPoint(A,B)
154 \tkzGetPoint{I}
155 \tkzDefPointWith[orthogonal,K=-.75](B,A)
156 \tkzGetPoint{C}
157 \tkzInterLC(B,C)(B,I)
158 \tkzGetPoints{D}{F}
159 \tkzDuplicateSegment(B,F)(A,F)
160 \tkzGetPoint{E}
161 \tkzDrawArc[delta=10](F,E)(B)
162 \tkzInterLC(A,B)(A,E)
163 \tkzGetPoints{N}{M}
164 \tkzDrawArc[delta=10](A,M)(E)
165 \tkzDrawLines(A,B B,C A,F)
166 \tkzCompass(B,F)
167 \tkzDrawPoints(A,B,C,F,M,E)
168 \tkzLabelPoints(A,B,C,F,M)
169 \tkzLabelPoints[above](E)
170 \end{tikzpicture}
171 \end{tkzexample}
172
173 \subsubsection{Options \tkzname{colinear} and \tkzname{orthogonal}}
174 \begin{tkzexample}[latex=7cm,small]
175 \begin{tikzpicture}[scale=1.2,
176 vect/.style={->,shorten >=1pt,>=latex'}]
177 \tkzDefPoints{2/1/A,6/2/B}
178 \tkzDefPointWith[orthogonal,K=.5](A,B)
179 \tkzGetPoint{C}
180 \tkzDefPointWith[colinear=at C,K=.5](A,B)
181 \tkzGetPoint{D}
182 \tkzMarkRightAngle[fill=gray!20](B,A,C)
183 \tkzDrawSegments[vect](A,B A,C C,D)
184 \tkzDrawPoints(A,...,D)
185 \end{tikzpicture}
186 \end{tkzexample}
187
188 \subsubsection{Option \tkzname{orthogonal normed}}
189 $K=1$ $AC=1$.
190
191 \begin{tkzexample}[latex=7cm,small]
192 \begin{tikzpicture}[scale=1.2,
193 vect/.style={->,shorten >=1pt,>=latex'}]
194 \tkzDefPoints{2/3/A,4/2/B}
195 \tkzDefPointWith[orthogonal normed](A,B)
196 \tkzGetPoint{C}
197 \tkzDrawPoints[color=red](A,B,C)
198 \tkzDrawSegments[vect](A,B A,C)
199 \tkzMarkRightAngle[fill=gray!20](B,A,C)
200 \end{tikzpicture}
201 \end{tkzexample}
202
203 \subsubsection{Option \tkzname{orthogonal normed} and K=2}
204 $K=2$ therefore $AC=2$.
205
206 \begin{tkzexample}[latex=7cm,small]
207 \begin{tikzpicture}[scale=1.2,
208 vect/.style={->,shorten >=1pt,>=latex'}]
209 \tkzDefPoints{2/3/A,5/1/B}
210 \tkzDefPointWith[orthogonal normed,K=2](A,B)
211 \tkzGetPoint{C}
212 \tkzDrawPoints[color=red](A,B,C)
213 \tkzDefCircle[R](A,2) \tkzGetPoint{a}
214 \tkzDrawCircle(A,a)
215 \tkzDrawSegments[vect](A,B A,C)
216 \tkzMarkRightAngle[fill=gray!20](B,A,C)
217 \tkzLabelPoints[above=3pt](A,B,C)
218 \end{tikzpicture}
219 \end{tkzexample}
220
221 \subsubsection{Option \tkzname{linear}}
222 Here $K=0.5$.
223
224 This amounts to applying a homothety or a multiplication of a vector by a real. Here is the middle of $[AB]$.
225
226 \begin{tkzexample}[latex=7cm,small]
227 \begin{tikzpicture}[scale=1.2]
228 \tkzDefPoints{1/3/A,4/2/B}
229 \tkzDefPointWith[linear,K=0.5](A,B)
230 \tkzGetPoint{C}
231 \tkzDrawPoints[color=red](A,B,C)
232 \tkzDrawSegment(A,B)
233 \tkzLabelPoints[above right=3pt](A,B,C)
234 \end{tikzpicture}
235 \end{tkzexample}
236
237 \subsubsection{Option \tkzname{linear normed}}
238 In the following example $AC=1$ and $C$ belongs to $(AB)$.
239
240 \begin{tkzexample}[latex=7cm,small]
241 \begin{tikzpicture}[scale=1.2]
242 \tkzDefPoints{1/3/A,4/2/B}
243 \tkzDefPointWith[linear normed](A,B)
244 \tkzGetPoint{C}
245 \tkzDrawPoints[color=red](A,B,C)
246 \tkzDrawSegment(A,B)
247 \tkzLabelSegment(A,C){$1$}
248 \tkzLabelPoints[above right=3pt](A,B,C)
249 \end{tikzpicture}
250 \end{tkzexample}
251 %<--------------------------------------------------------------------------–>
252 % tkzGetVectxy
253 %<--------------------------------------------------------------------------–>
254 \subsection{\tkzcname{tkzGetVectxy} }
255 Retrieving the coordinates of a vector.
256
257 \begin{NewMacroBox}{tkzGetVectxy}{\parg{$A,B$}\var{text}}%
258 Allows to obtain the coordinates of a vector.
259
260 \medskip
261 \begin{tabular}{lll}%
262 \toprule
263 arguments & example & explanation \\
264
265 \midrule
266
267 \TAline{(point)\{name of macro\}} {\tkzcname{tkzGetVectxy}(A,B)\{V\}}{\tkzcname{Vx},\tkzcname{Vy}: coordinates of $\overrightarrow{AB}$}
268 \end{tabular}
269 \end{NewMacroBox}
270
271 \subsubsection{Coordinate transfer with \tkzcname{tkzGetVectxy}}
272
273 \begin{tkzexample}[latex=7cm,small]
274 \begin{tikzpicture}
275 \tkzDefPoints{0/0/O,1/1/A,4/2/B}
276 \tkzGetVectxy(A,B){v}
277 \tkzDefPoint(\vx,\vy){V}
278 \tkzDrawSegment[->,color=red](O,V)
279 \tkzDrawSegment[->,color=blue](A,B)
280 \tkzDrawPoints(A,B,O)
281 \tkzLabelPoints(A,B,O,V)
282 \end{tikzpicture}
283 \end{tkzexample}
284 \endinput