Debian Codegraph @

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

raw
1 \section{Straight lines}
2
3 It is of course essential to draw straight lines, but before this can be done, it is necessary to be able to define certain particular lines such as mediators, bisectors, parallels or even perpendiculars. The principle is to determine two points on the straight line.
4
5 \subsection{Definition of straight lines}
6
7 \begin{NewMacroBox}{tkzDefLine}{\oarg{local options}\parg{pt1,pt2} or \parg{pt1,pt2,pt3}}%
8 The argument is a list of two or three points. Depending on the case, the macro defines one or two points necessary to obtain the line sought. Either the macro \tkzcname{tkzGetPoint} or the macro \tkzcname{tkzGetPoints} must be used.
9 I used the term "mediator" to designate the perpendicular bisector line at the middle of a line segment.
10
11 \medskip
12 \begin{tabular}{lll}%
13 \toprule
14 arguments & example & explanation \\
15 \midrule
16 \TAline{\parg{pt1,pt2}}{[mediator]\parg{A,B}}{mediator of the segment $[A,B]$}
17 \TAline{\parg{pt1,pt2,pt3}}{[bisector]\parg{A,B,C}} {bisector of $\widehat{ABC}$}
18 \TAline{\parg{pt1,pt2,pt3}}{[altitude]\parg{A,B,C}} {altitude from $B$}
19 \TAline{\parg{pt1}}{[tangent at=A]\parg{O}} {tangent at $A$ on the circle center $O$}
20 \TAline{\parg{pt1,pt2}}{[tangent from=A]\parg{O,B}} {circle center $O$ through $B$}
21 \end{tabular}
22
23 \medskip
24 \begin{tabular}{lll}%
25 \toprule
26 options & default & definition \\
27 \TOline{mediator}{}{perpendicular bisector of a line segment}
28 \TOline{perpendicular=through\dots}{mediator}{perpendicular to a line passing through a point}
29 \TOline{orthogonal=through\dots}{mediator}{see above }
30 \TOline{parallel=through\dots}{mediator}{parallel to a line passing through a point}
31 \TOline{bisector}{mediator}{bisector of an angle defined by three points}
32 \TOline{bisector out}{mediator}{exterior angle bisector}
33 \TOline{symmedian}{mediator}{symmedian from a vertex }
34 \TOline{altitude}{mediator}{altitude from avertex}
35 \TOline{euler}{mediator}{euler line of a triangle }
36 \TOline{tangent at}{mediator}{tangent at a point of a circle }
37 \TOline{tangent from}{mediator}{tangent from an exterior point }
38 \TOline{K}{1}{coefficient for the perpendicular line}
39 \TOline{normed}{false}{normalizes the created segment}
40 \end{tabular}
41 \end{NewMacroBox}
42
43 \subsubsection{With \tkzname{mediator}}
44 \begin{tkzexample}[latex=5 cm,small]
45 \begin{tikzpicture}[rotate=25]
46 \tkzDefPoints{-2/0/A,1/2/B}
47 \tkzDefLine[mediator](A,B) \tkzGetPoints{C}{D}
48 \tkzDefPointWith[linear,K=.75](C,D) \tkzGetPoint{D}
49 \tkzDefMidPoint(A,B) \tkzGetPoint{I}
50 \tkzFillPolygon[color=teal!20](A,C,B,D)
51 \tkzDrawSegments(A,B C,D)
52 \tkzMarkRightAngle(B,I,C)
53 \tkzDrawSegments(D,B D,A)
54 \tkzDrawSegments(C,B C,A)
55 \end{tikzpicture}
56 \end{tkzexample}
57
58 \subsubsection{An envelope with option \tkzname{mediator}}
59 Based on a figure from O. Reboux with pst-eucl by D Rodriguez.
60
61 \begin{tkzexample}[latex=7cm,small]
62 \begin{tikzpicture}[scale=.75]
63 % necessary
64 \tkzInit[xmin=-6,ymin=-4,xmax=6,ymax=6]
65 \tkzClip
66 \tkzSetUpLine[thin,color=magenta]
67 \tkzDefPoint(0,0){O}
68 \tkzDefPoint(132:4){A}
69 \tkzDefPoint(5,0){B}
70 \foreach \ang in {5,10,...,360}{%
71 \tkzDefPoint(\ang:5){M}
72 \tkzDefLine[mediator](A,M)
73 \tkzGetPoints{x}{y}
74 \tkzDrawLine[add= 3 and 3](x,y)}
75 \end{tikzpicture}
76 \end{tkzexample}
77
78
79 \subsubsection{A parabola with option \tkzname{mediator}}
80 Based on a figure from O. Reboux with pst-eucl by D Rodriguez.
81 It is not necessary to name the two points that define the mediator.
82
83 \begin{tkzexample}[latex=8cm,small]
84 \begin{tikzpicture}[scale=.6]
85 \tkzInit[xmin=-6,ymin=-4,xmax=6,ymax=6]
86 \tkzClip
87 \tkzSetUpLine[thin,color=teal]
88 \tkzDefPoint(0,0){O}
89 \tkzDefPoint(132:5){A}
90 \tkzDefPoint(4,0){B}
91 \foreach \ang in {5,10,...,360}{%
92 \tkzDefPoint(\ang:4){M}
93 \tkzDefLine[mediator](A,M)
94 \tkzGetPoints{x}{y}
95 \tkzDrawLine[add= 3 and 3](x,y)}
96 \end{tikzpicture}
97 \end{tkzexample}
98
99 \subsubsection{With options \tkzname{bisector} and \tkzname{normed}}
100 \begin{tkzexample}[latex=7 cm,small]
101 \begin{tikzpicture}[rotate=25,scale=.75]
102 \tkzDefPoints{0/0/C, 2/-3/A, 4/0/B}
103 \tkzDefLine[bisector,normed](B,A,C) \tkzGetPoint{a}
104 \tkzDrawLines[add= 0 and .5](A,B A,C)
105 \tkzShowLine[bisector,gap=4,size=2,color=red](B,A,C)
106 \tkzDrawLines[new,dashed,add= 0 and 3](A,a)
107 \end{tikzpicture}
108 \end{tkzexample}
109
110 \subsubsection{With option \tkzname{parallel=through}} % (fold)
111 \label{ssub:parallel}
112 Archimedes' Book of Lemmas proposition 1
113
114 \begin{tkzexample}[latex=7cm,small]
115 \begin{tikzpicture}
116 \tkzDefPoints{0/0/O_1,0/1/O_2,0/3/A}
117 \tkzDefPoint(15:3){F}
118 \tkzDefPointBy[symmetry=center O_1](F)
119 \tkzGetPoint{E}
120 \tkzDefLine[parallel=through O_2](E,F)
121 \tkzGetPoint{x}
122 \tkzInterLC(x,O_2)(O_2,A) \tkzGetPoints{D}{C}
123 \tkzDrawCircles(O_1,A O_2,A)
124 \tkzDrawSegments[new](O_1,A E,F C,D)
125 \tkzDrawSegments[purple](A,E A,F)
126 \tkzDrawPoints(A,O_1,O_2,E,F,C,D)
127 \tkzLabelPoints(A,O_1,O_2,E,F,C,D)
128 \end{tikzpicture}
129 \end{tkzexample}
130 % subsubsection parallel (end)
131
132 \subsubsection{With option \tkzname{orthogonal} and \tkzname{parallel}}
133 \begin{tkzexample}[latex=5 cm,small]
134 \begin{tikzpicture}
135 \tkzDefPoints{-1.5/-0.25/A,1/-0.75/B,-0.7/1/C}
136 \tkzDrawLine(A,B)
137 \tkzLabelLine[pos=1.25,below left](A,B){$(d_1)$}
138 \tkzDrawPoints(A,B,C)
139 \tkzDefLine[orthogonal=through C](B,A) \tkzGetPoint{c}
140 \tkzDrawLine(C,c)
141 \tkzLabelLine[pos=1.25,left](C,c){$(\delta)$}
142 \tkzInterLL(A,B)(C,c) \tkzGetPoint{I}
143 \tkzMarkRightAngle(C,I,B)
144 \tkzDefLine[parallel=through C](A,B) \tkzGetPoint{c'}
145 \tkzDrawLine(C,c')
146 \tkzLabelLine[pos=1.25,below left](C,c'){$(d_2)$}
147 \tkzMarkRightAngle(I,C,c')
148 \end{tikzpicture}
149 \end{tkzexample}
150
151 \subsubsection{With option \tkzname{altitude}} % (fold)
152 \label{sub:altitude}
153 \begin{tkzexample}[latex=7 cm,small]
154 \begin{tikzpicture}
155 \tkzDefPoints{0/0/A,6/0/B,0.8/4/C}
156 \tkzDefLine[altitude](A,B,C) \tkzGetPoint{b}
157 \tkzDefLine[altitude](B,C,A) \tkzGetPoint{c}
158 \tkzDefLine[altitude](B,A,C) \tkzGetPoint{a}
159 \tkzDrawPolygon(A,B,C)
160 \tkzDrawPoints[blue](a,b,c)
161 \tkzDrawSegments[blue](A,a B,b C,c)
162 \tkzLabelPoints(A,B,c)
163 \tkzLabelPoints[above](C,a)
164 \tkzLabelPoints[above left](b)
165 \end{tikzpicture}
166 \end{tkzexample}
167
168 % subsection altitude (end)
169
170
171 \subsubsection{ With option \tkzname{euler}} % (fold)
172 \label{sub:eulerline}
173 \begin{tkzexample}[latex=7 cm,small]
174 \begin{tikzpicture}[scale=.75]
175 \tkzDefPoints{0/0/A,6/0/B,0.8/4/C}
176 \tkzDefLine[euler](A,B,C)
177 \tkzGetPoints{h}{e}
178 \tkzDefTriangleCenter[circum](A,B,C)
179 \tkzGetPoint{o}
180 \tkzDrawPolygon[teal](A,B,C)
181 \tkzDrawPoints[red](A,B,C,h,e,o)
182 \tkzDrawLine[add= 2 and 2](h,e)
183 \tkzLabelPoints(A,B,C,h,e,o)
184 \tkzLabelPoints[above](C)
185 \end{tikzpicture}
186 \end{tkzexample}
187 % subsection eulerline (end)
188
189 \subsubsection{Tangent passing through a point on the circle \tkzname{tangent at}}
190 \begin{tkzexample}[latex=7cm,small]
191 \begin{tikzpicture}[scale=.75]
192 \tkzDefPoint(0,0){O}
193 \tkzDefPoint(6,6){E}
194 \tkzDefRandPointOn[circle=center O radius 3]
195 \tkzGetPoint{A}
196 \tkzDrawSegment(O,A)
197 \tkzDrawCircle(O,A)
198 \tkzDefLine[tangent at=A](O)
199 \tkzGetPoint{h}
200 \tkzDrawLine[add = 4 and 3](A,h)
201 \tkzMarkRightAngle[fill=teal!30](O,A,h)
202 \end{tikzpicture}
203 \end{tkzexample}
204
205 \subsubsection{Choice of contact point with tangents passing through an external point option \tkzname{tangent from}}
206
207 The tangent is not drawn. With option \tkzname{at}, a point of the tangent is given by \tkzname{tkzPointResult}. With option \tkzname{from} you get two points of the circle with \tkzname{tkzFirstPointResult} and \tkzname{tkzSecondPointResult}. You can choose between these two points by comparing the angles formed with the outer point, the contact point and the center. The two possible angles have different directions. Angle counterclockwise refers to \tkzname{tkzFirstPointResult}.
208
209 \begin{tkzexample}[latex=7cm,small]
210 \begin{tikzpicture}[scale=1,rotate=-30]
211 \tkzDefPoints{0/0/Q,0/2/A,6/-1/O}
212 \tkzDefLine[tangent from = O](Q,A)
213 \tkzGetPoints{R}{S}
214 \tkzInterLC[near](O,Q)(Q,A)
215 \tkzGetPoints{M}{N}
216 \tkzDrawCircle(Q,M)
217 \tkzDrawSegments[new,add = 0 and .2](O,R O,S)
218 \tkzDrawSegments[gray](N,O R,Q S,Q)
219 \tkzDrawPoints(O,Q,R,S,M,N)
220 \tkzMarkAngle[gray,-stealth,size=1](O,R,Q)
221 \tkzFindAngle(O,R,Q) \tkzGetAngle{an}
222 \tkzLabelAngle(O,R,Q){%
223 $\pgfmathprintnumber{\an}^\circ$}
224 \tkzMarkAngle[gray,-stealth,size=1](O,S,Q)
225 \tkzFindAngle(O,S,Q) \tkzGetAngle{an}
226 \tkzLabelAngle(O,S,Q){%
227 $\pgfmathprintnumber{\an}^\circ$}
228 \tkzLabelPoints(Q,O,M,N,R)
229 \tkzLabelPoints[above,text=red](S)
230 \end{tikzpicture}
231 \end{tkzexample}
232
233 \subsubsection{Example of tangents passing through an external point }
234 \begin{tkzexample}[latex=7cm,small]
235 \begin{tikzpicture}[scale=.8]
236 \tkzDefPoints{0/0/c,1/0/d,3/0/a0}
237 \def\tkzRadius{1}
238 \tkzDrawCircle(c,d)
239 \foreach \an in {0,10,...,350}{
240 \tkzDefPointBy[rotation=center c angle \an](a0)
241 \tkzGetPoint{a}
242 \tkzDefLine[tangent from = a](c,d)
243 \tkzGetPoints{e}{f}
244 \tkzDrawLines(a,f a,e)
245 \tkzDrawSegments(c,e c,f)}
246 \end{tikzpicture}
247 \end{tkzexample}
248
249 \subsubsection{Example of Andrew Mertz}
250
251 \begin{tkzexample}[latex=6cm,small]
252 \begin{tikzpicture}[scale=.6]
253 \tkzDefPoint(100:8){A}\tkzDefPoint(50:8){B}
254 \tkzDefPoint(0,0){C} \tkzDefPoint(0,-4){R}
255 \tkzDrawCircle(C,R)
256 \tkzDefLine[tangent from = A](C,R) \tkzGetPoints{D}{E}
257 \tkzDefLine[tangent from = B](C,R) \tkzGetPoints{F}{G}
258 \tkzDrawSector[fill=teal!20,opacity=0.5](A,E)(D)
259 \tkzFillSector[color=teal,opacity=0.5](B,G)(F)
260 \end{tikzpicture}
261 \end{tkzexample}
262 \url{http://www.texample.net/tikz/examples/}
263
264 \subsubsection{Drawing a tangent option \tkzname{tangent from}}
265 \begin{tkzexample}[latex=6cm,small]
266 \begin{tikzpicture}[scale=.6]
267 \tkzDefPoint(0,0){B}
268 \tkzDefPoint(0,8){A}
269 \tkzDefSquare(A,B)
270 \tkzGetPoints{C}{D}
271 \tkzDrawPolygon(A,B,C,D)
272 \tkzClipPolygon(A,B,C,D)
273 \tkzDefPoint(4,8){F}
274 \tkzDefPoint(4,0){E}
275 \tkzDefPoint(4,4){Q}
276 \tkzFillPolygon[color = green](A,B,C,D)
277 \tkzDrawCircle[fill = orange](B,A)
278 \tkzDrawCircle[fill = purple](E,B)
279 \tkzDefLine[tangent from = B](F,A)
280 \tkzInterLL(F,tkzSecondPointResult)(C,D)
281 \tkzInterLL(A,tkzPointResult)(F,E)
282 \tkzDrawCircle[fill = yellow](tkzPointResult,Q)
283 \tkzDefPointBy[projection= onto B--A](tkzPointResult)
284 \tkzDrawCircle[fill = blue!50!black](tkzPointResult,A)
285 \end{tikzpicture}
286 \end{tkzexample}
287
288 \endinput