Debian Codegraph @

texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-triangle.tex

raw
1 \newpage
2 \section{Class \tkzClass{triangle}} %(fold)
3
4
5 The variable \tkzVar{triangle}{T} holds a table used to store triangle objects. Its use is optional: you are free to choose another variable name, but using \tkzVar{triangle}{T} is the recommended convention for clarity and consistency across examples and documentation.
6
7 \medskip
8 If you define your own table, you must initialize it manually. However, if you use the default variable \tkzVar{triangle}{T}, the \code{init\_elements()} function will automatically clear and reset the \tkzVar{triangle}{T} table when called.
9
10 \medskip
11 Each triangle object is created using the \tkzMeth{triangle}{new} method, which takes three points as input and generates all the associated geometric attributes.
12
13 \vspace{1em}
14
15 \subsection{Creating a triangle}
16 \label{sub:creating_a_triangle}
17
18 The \tkzClass{triangle} class is used to define triangles from three points.
19 \textbf{Note.} The triangle must be non-degenerate. The constructor
20 raises an error if two vertices coincide (within tolerance) or if
21 the three vertices are aligned. It automatically computes a wide range of geometric attributes associated with the triangle.
22
23 \begin{mybox}
24 \begin{verbatim}
25 T.ABC = triangle:new(z.A, z.B, z.C)
26 \end{verbatim}
27 \end{mybox}
28
29 \texttt{Short form: }
30
31 The short form \code{triangle(z.A, z.B, z.C)} is equivalent and more commonly used:
32
33 \begin{mybox}
34 \begin{verbatim}
35 T.ABC = triangle(z.A, z.B, z.C)
36 \end{verbatim}
37 \end{mybox}
38
39
40 \subsection{Attributes of a triangle} %(fold)
41
42 The triangle object is created using the method \tkzMeth{triangle}{new}, for example:
43
44 \begin{center}
45 \code{T.ABC = triangle(z.A, z.B, z.C)}
46 \end{center}
47
48 Several attributes are automatically computed and stored:
49
50 \begin{itemize}
51 \item \texttt{Vertices: } The three vertices are accessible via:
52 \begin{center}
53 \code{T.ABC.pa}, \code{T.ABC.pb}, \code{T.ABC.pc}
54 \end{center}
55
56 \item \texttt{Sides: } The side lengths are:
57 \begin{align*}
58 T.ABC.a &= \text{length of } BC \\
59 T.ABC.b &= \text{length of } AC \\
60 T.ABC.c &= \text{length of } AB
61 \end{align*}
62
63 \item \texttt{Area: } The area is computed using Heron’s formula:
64 \[
65 s = \frac{a + b + c}{2}, \quad \text{Area} = \sqrt{s(s - a)(s - b)(s - c)}
66 \]
67 This value is stored in \code{T.ABC.area}.
68
69 \item \texttt{Perimeter: } The perimeter is the sum of side lengths:
70 \[
71 P = a + b + c
72 \]
73 It is stored in \code{T.ABC.perimeter}.
74
75 \item \texttt{Angles: } The internal angles $\alpha$, $\beta$, and $\gamma$ (at $A$, $B$, and $C$ respectively) are computed using the law of cosines:
76 \[
77 \cos(\alpha) = \frac{b^2 + c^2 - a^2}{2bc}, \quad
78 \cos(\beta) = \frac{a^2 + c^2 - b^2}{2ac}, \quad
79 \cos(\gamma) = \frac{a^2 + b^2 - c^2}{2ab}
80 \]
81 They are stored in \code{T.ABC.alpha}, \code{T.ABC.beta}, and \code{T.ABC.gamma}.
82
83 \item \texttt{Feet of medians, altitudes and internal bisectors: }
84 \begin{itemize}
85 \item |ma|, |mb|, |mc|: midpoints of the sides.
86 \item |ha|, |hb|, |hc|: feet of the altitudes.
87 \item |ia|, |ib|, |ic|: feet of the internal angle bisectors.
88 \end{itemize}
89 \end{itemize}
90
91 These attributes define the essential geometric properties of the triangle and are used in numerous derived methods and constructions.
92
93
94 \bgroup
95 \catcode`_=12
96 \small
97 \captionof{table}{Triangle attributes.}\label{triangle:attributes}
98 \begin{tabular}{ll}
99 \toprule
100 \texttt{Attributes} & \texttt{Reference}\\
101 \midrule
102 \tkzAttr{triangle}{pa} &[\ref{ssub:triangle_attributes_points}]\\
103 \tkzAttr{triangle}{pb} & idem \\
104 \tkzAttr{triangle}{pc} & idem \\
105 \tkzAttr{triangle}{type} & 'triangle' \\
106 \tkzAttr{triangle}{circumcenter} & [\ref{ssub:triangle_attributes_characteristic_points}]\\
107 \tkzAttr{triangle}{centroid} & idem \\
108 \tkzAttr{triangle}{incenter} & idem \\
109 \tkzAttr{triangle}{orthocenter} & idem \\
110 \tkzAttr{triangle}{eulercenter} & idem \\
111 \tkzAttr{triangle}{spiekercenter} & idem; [\ref{ssub:triangle_attributes_characteristic_points}; \ref{ssub:example_apollonius_circle}] \\
112 \tkzAttr{triangle}{a}& [\ref{ssub:triangle_attributes_lengths}] \\
113 \tkzAttr{triangle}{b}& \\
114 \tkzAttr{triangle}{c}& \\
115 \tkzAttr{triangle}{alpha}&[ \ref{ssub:triangle_attributes_angles}]\\
116 \tkzAttr{triangle}{beta} & \\
117 \tkzAttr{triangle}{gamma}& \\
118 \tkzAttr{triangle}{alpha\_}&[ \ref{ssub:triangle_attributes_angles_objects}]\\
119 \tkzAttr{triangle}{beta\_} & \\
120 \tkzAttr{triangle}{gamma\_}& \\
121 \tkzAttr{triangle}{ab}& [\ref{ssub:triangle_attributes_straight_lines}]\\
122 \tkzAttr{triangle}{bc}& \\
123 \tkzAttr{triangle}{ca}& \\
124 \tkzAttr{triangle}{semiperimeter}& [\ref{ssub:triangle_attributes_lengths}] \\
125 \tkzAttr{triangle}{area}& \\
126 \tkzAttr{triangle}{orientation}& [\ref{ssub:triangle_attributes_orientation}] \\
127 \tkzAttr{triangle}{cross}& [\ref{ssub:triangle_attributes_cross}] \\
128 \tkzAttr{triangle}{inradius}& [\ref{ssub:triangle_attributes_lengths}]\\
129 \tkzAttr{triangle}{circumradius}& [\ref{ssub:triangle_attributes_lengths}] \\
130 \tkzAttr{triangle}{ma/mb/mc}& [\ref{ssub:triangle_attributes_foot_median}] \\
131 \tkzAttr{triangle}{ha/hb/hc}& [\ref{ssub:triangle_attributes_foot_altitude}]\\
132 \tkzAttr{triangle}{ia/ib/ic}& [\ref{ssub:triangle_attributes_foot_bisector}] \\
133 \bottomrule %
134 \end{tabular}
135 \egroup
136
137
138
139 \subsubsection{Triangle attributes: defining points}
140 \label{ssub:triangle_attributes_points}
141
142 Consider a triangle $ABC$. We want to construct a new triangle whose vertices are the reflections of $A$, $B$, and $C$ with respect to the midpoints of their opposite sides.
143
144 \medskip
145
146 To achieve this, we first need to determine the midpoints of the sides of triangle $ABC$. The most straightforward approach is to use the method \tkzMeth{triangle}{medial}, which returns the \textbf{medial triangle}, i.e., the triangle formed by the midpoints of $[BC]$, $[AC]$, and $[AB]$.
147
148 \medskip
149
150 Once this medial triangle is constructed, its vertices can be accessed through standard attributes:
151 \begin{center}
152 \code{T.medial.A}, \code{T.medial.B}, \code{T.medial.C}
153 \end{center}
154
155
156 Alternatively, from the last, the method \code{get()} retrieves all three vertices at once in a convenient Lua-compatible syntax.
157
158 \medskip
159
160 For a practical illustration of this method, see the associated \code{tikzpicture} example in the documentation.
161
162 \vspace{1em}
163
164 % see help.lua for a dev code
165 \begin{minipage}{.5\textwidth-2cm}
166 \directlua{ init_elements()
167 z.A = point(0, 0)
168 z.B= point(3, 0)
169 z.C = point(1, 2)
170 T.ABC = triangle(z.A, z.B, z.C)
171 T.m = T.ABC:medial()
172 z.ma, z.mb, z.mc = T.m.pa, T.m.pb, T.m.pc
173 z.Ap = z.ma:symmetry(z.A)
174 z.Bp = z.mb:symmetry(z.B)
175 z.Cp = z.mc:symmetry(z.C)}
176 \begin{center}
177 \begin{tikzpicture}[scale=.75]
178 \tkzGetNodes
179 \tkzDrawPolygons(A,B,C)
180 \tkzDrawPoints(ma, mb, mc)
181 \tkzDrawPoints(A, B, C, A', B', C')
182 \tkzDrawSegments[dashed](A,A' B,B' C,C')
183 \tkzDrawPolygons[red](A',B',C')
184 \end{tikzpicture}
185 \end{center}
186 \end{minipage}
187 \begin{minipage}{.5\textwidth}
188 \begin{tkzexample}[code only]
189 \directlua{ init_elements()
190 z.A = point(0, 0)
191 z.B= point(3, 0)
192 z.C = point(1, 2)
193 T.ABC = triangle(z.A, z.B, z.C)
194 T.m = T.ABC:medial()
195 z.ma, z.mb, z.mc = T.m.pa, T.m.pb, T.m.pc
196 z.Ap = z.ma:symmetry(z.A)
197 z.Bp = z.mb:symmetry(z.B)
198 z.Cp = z.mc:symmetry(z.C)}
199 \end{tkzexample}
200 \end{minipage}
201
202 \subsubsection{Triangle attributes: characteristic points}
203 \label{ssub:triangle_attributes_characteristic_points}
204 The \code{tikzpicture} environment can be viewed in the documentation.
205
206 \begin{tkzexample}[latex=.5\textwidth]
207 \directlua{
208 init_elements()
209 z.A = point(0, 0)
210 z.B = point(4, 0)
211 z.C = point(1, 3)
212 T.ABC = triangle(z.A, z.B, z.C)
213 z.O = T.ABC.circumcenter
214 z.I = T.ABC.incenter
215 z.H = T.ABC.orthocenter
216 z.G = T.ABC.centroid
217 z.S = T.ABC.spiekercenter}
218 \begin{center}
219 \begin{tikzpicture}
220 \tkzGetNodes
221 \tkzDrawPolygon(A,B,C)
222 \tkzDrawPoints(A,B,C,O,G,I,H,S)
223 \tkzDrawCircles(O,A)
224 \tkzLabelPoints[below](A,B,O,G,I)
225 \tkzLabelPoints[above](H,S)
226 \tkzLabelPoints[above](C)
227 \end{tikzpicture}
228 \end{center}
229 \end{tkzexample}
230
231
232
233 \subsubsection{Triangle attributes: angles} %(fold)
234 \label{ssub:triangle_attributes_angles}
235 \noindent\textbf{Numeric measures.}
236 The variables \code{alpha}, \code{beta}, and \code{gamma} are \emph{numbers}
237 (measured in radians). They are obtained by evaluating
238 \[
239 \alpha = \lvert \widehat(ZA,ZB,ZC)\rvert,\qquad
240 \beta = \lvert \widehat(ZB,ZC,ZA)\rvert,\qquad
241 \gamma = \lvert \widehat(ZC,ZA,ZB)\rvert,
242 \]
243 where \code{get\_angle\_} returns an oriented angle (possibly negative,
244 depending on the orientation of the three points). The use of
245 \code{math.abs} ensures that \code{alpha}, \code{beta}, and \code{gamma}
246 represent the \emph{unsigned} interior angle measures.
247
248 \begin{tkzexample}[latex=.5\textwidth-2cm]
249 \directlua{init_elements()
250 z.A = point(0,0)
251 z.B = point(5,0)
252 z.C = point(2,3)
253 T.ABC = triangle(z.A, z.B, z.C)
254 S = T.ABC.alpha + T.ABC.beta + T.ABC.gamma}
255 \def\wangle#1{\tkzPN[2]{%
256 \tkzUseLua{math.deg(T.ABC.#1)}}}
257 \begin{center}
258 \begin{tikzpicture}
259 \tkzGetNodes
260 \tkzDrawPolygons(A,B,C)
261 \tkzLabelAngle(B,A,C){$\wangle{alpha}^\circ$}
262 \tkzLabelAngle(C,B,A){$\wangle{beta}^\circ$}
263 \tkzLabelAngle(A,C,B){$\wangle{gamma}^\circ$}
264 \end{tikzpicture}
265 \end{center}
266 The sum of the angles is: \tkzUseLua{math.deg(S)}
267 \end{tkzexample}
268
269
270 \subsubsection{Triangle attributes: angle objects} %(fold)
271 \label{ssub:triangle_attributes_angles_objects}
272 \noindent\texttt{Angle objects: }
273 The variables \code{alpha\_}, \code{beta\_}, and \code{gamma\_} are
274 \emph{objects} of class \tkzClass{angle} created with
275
276 \code{angle:new(...)}.
277 They store the defining triple of points and provide methods to
278 retrieve the measure (in radians or degrees) and to support later
279 geometric operations or drawings based on that angle.
280
281 \medskip
282 \noindent\texttt{Remark: }
283 The function \code{get\_angle\_} returns an \emph{oriented} angle,
284 whose sign depends on the order of the three points.
285 Its value is typically in the interval $(-\pi,\pi]$.
286 Taking the absolute value therefore produces the
287 (non--oriented) interior angle measure.
288
289 By contrast, an object of class \tkzClass{angle}
290 may preserve the orientation information,
291 depending on its internal implementation.
292 This distinction allows one to work either with
293 pure numeric measures (for computations)
294 or with full geometric angle objects
295 (for constructions and drawings).
296
297 \texttt{Example: }
298
299 \parindent =0pt
300 \begin{tkzexample}[latex=.5\textwidth]
301 \directlua{
302 init_elements()
303 z.A = point(0, 0)
304 z.C = point(3, 0)
305 z.B = point(3, 2)
306 T.ABC = triangle(z.A, z.B, z.C)
307 A.A = T.ABC.alpha_
308 A.B = T.ABC.beta_
309 T.C = T.ABC.gamma_
310 tex.print("A(value) = \\", A.A.value)
311 tex.print('\\\\')
312 tex.print("A(raw) = \\", A.A.raw)
313 tex.print('\\\\')
314 tex.print("A(deg) = \\", A.A.deg)}
315 \begin{center}
316 \begin{tikzpicture}
317 \tkzGetNodes
318 \tkzDrawPolygon(A,B,C)
319 \tkzDrawPoints(A,B,C)
320 \tkzLabelPoints(A,C)
321 \tkzLabelPoints[above](B)
322 \end{tikzpicture}
323 \end{center}
324 \end{tkzexample}
325
326 \subsubsection{Triangle attributes: lengths}
327 \label{ssub:triangle_attributes_lengths}
328
329 You can access different lengths, in particular side lengths with:
330 \begin{mybox}
331 \begin{tkzexample}[code only]
332 T.ABC = triangle(z.A, z.B, z.C)
333 p = T.ABC.a + T.ABC.b +T.ABC.c % p perimeter of T
334 T.ABC.a, T.ABC.b and T.ABC.c are the lengths of the opposite sides to A, B and C.
335 % Other accessible lengths
336 s = T.ABC.semiperimeter
337 ri = T.ABC.inradius
338 R = T.ABC.circumradius
339 A = T.ABC.area
340 \end{tkzexample}
341 \end{mybox}
342
343 \subsubsection{Triangle attributes: straight lines}
344 \label{ssub:triangle_attributes_straight_lines}
345
346 Several attributes associated with triangle sides and lines simplify code writing and improve readability.
347
348 \medskip
349
350 Consider a triangle $ABC$. Suppose you want to use the midpoint of the side $[BC]$ (which can also be seen as the base of the median from $A$). There are multiple ways to construct this midpoint in Lua, but the most concise is:
351
352 \begin{center}
353 \code{T.bc.mid}
354 \end{center}
355
356
357 Here:
358 \begin{itemize}
359 \item \code{T.ABC.bc} is the attribute representing the line $(BC)$,
360 \item It is equivalent to writing \code{L.BC = line(z.B, z.C)},
361 \item But with a triangle object already defined as \code{T.ABC}, you can write simply:
362 \begin{center}
363 \code{L.BC = T.ABC.bc}
364 \end{center}
365 \end{itemize}
366
367 \medskip
368
369 This approach saves time and space in scripts involving medians, altitudes, bisectors, or projections based on triangle sides.
370
371 \vspace{1em}
372
373 \begin{tkzexample}[latex=.5\textwidth]
374 \directlua{
375 z.A = point(0, 0)
376 z.B = point(5, 0)
377 z.C = point(2, 3)
378 T.ABC = triangle(z.A, z.B, z.C)
379 z.M = T.ABC.bc.mid
380 L.AM = line(z.A, z.M)
381 z.Q = L.AM.mid }
382 \begin{tikzpicture}
383 \tkzGetNodes
384 \tkzDrawPolygon(A,B,C)
385 \tkzDrawLine[add = 0 and 1](A,Q)
386 \tkzDrawPoints(A,B,C,M,Q)
387 \tkzLabelPoints(A,B)
388 \tkzLabelPoints[above](C,M,Q)
389 \end{tikzpicture}
390 \end{tkzexample}
391
392 \subsubsection{Triangle attributes: orientation}
393 \label{ssub:triangle_attributes_orientation}
394 The \tkzAttr{orientation} attribute of a triangle indicates the orientation
395 of its vertices.
396 It is positive when the vertices are ordered counter--clockwise,
397 negative when they are ordered clockwise,
398 and zero when the three points are collinear.
399 Geometrically, this value corresponds to the sign of the oriented area
400 of the triangle.
401
402 \begin{tkzexample}[latex=.5\textwidth]
403 \directlua{
404 init_elements()
405 z.A = point(0, 0)
406 z.B = point(2, 0)
407 z.C = point(1, 1)
408 T.ABC = triangle(z.A, z.B, z.C)
409 tex.print("orientation =\\ ",
410 T.ABC.orientation)}
411 \begin{center}
412 \begin{tikzpicture}[scale = 3]
413 \tkzGetNodes
414 \tkzDrawPolygon(A,B,C)
415 \tkzDrawPoints(A,B,C)
416 \tkzLabelPoints(A,B)
417 \tkzLabelPoints[above](C)
418 \end{tikzpicture}
419 \end{center}
420 \end{tkzexample}
421
422 \subsubsection{Triangle attributes: cross}
423 \label{ssub:triangle_attributes_cross}
424 In \tkzNamePack{tkz-elements}, the operator \verb|^| denotes the two--dimensional
425 cross product of vectors.
426 For three points $A$, $B$, and $C$, the expression
427
428 $(B - A)$\ \verb|^|\ $(C - A)$
429
430 returns a scalar value.
431 Its sign indicates the relative orientation of the vectors
432 $\overrightarrow{AB}$ and $\overrightarrow{AC}$:
433 a positive value corresponds to a counter--clockwise rotation,
434 a negative value to a clockwise rotation,
435 and a zero value indicates collinearity.
436
437 \begin{tkzexample}[latex=.5\textwidth]
438 \directlua{
439 init_elements()
440 z.A = point(0, 0)
441 z.B = point(1, 1)
442 z.C = point(2, 0)
443 T.ABC = triangle(z.A, z.B, z.C)
444 local cross = (z.B - z.A) ^ (z.C - z.A)
445 tex.print("cross =\\ ", cross)}
446 \begin{center}
447 \begin{tikzpicture}[scale = 3]
448 \tkzGetNodes
449 \tkzDrawPolygon(A,B,C)
450 \tkzDrawPoints(A,B,C)
451 \tkzLabelPoints(A,C)
452 \tkzLabelPoints[above](B)
453 \end{tikzpicture}
454 \end{center}
455 \end{tkzexample}
456
457 \subsubsection{Triangle attributes: median feet}
458 \label{ssub:triangle_attributes_foot_median}
459
460 \begin{tkzexample}[latex=.5\textwidth]
461 \directlua{
462 init_elements()
463 z.A = point(0, 0)
464 z.B = point(4, 0)
465 z.C = point(1, 3)
466 T.ABC = triangle(z.A, z.B, z.C)
467 z.M_a = T.ABC.ma
468 z.M_b = T.ABC.mb
469 z.M_c = T.ABC.mc
470 z.G = T.ABC.centroid}
471 \begin{center}
472 \begin{tikzpicture}
473 \tkzGetNodes
474 \tkzDrawPolygon(A,B,C)
475 \tkzDrawSegments[dashed](A,M_a B,M_b C,M_c)
476 \tkzDrawPoints(A,B,C,M_a,M_b,M_c,G)
477 \tkzLabelPoints[below](A,B,M_c,G)
478 \tkzLabelPoints[left](M_b)
479 \tkzLabelPoints[right](M_a)
480 \tkzLabelPoints[above](C)
481 \end{tikzpicture}
482 \end{center}
483 \end{tkzexample}
484
485 \subsubsection{Triangle attributes: altitude feet}
486 \label{ssub:triangle_attributes_foot_altitude}
487
488 \begin{tkzexample}[latex=.5\textwidth]
489 \directlua{
490 init_elements()
491 z.A = point(0, 0)
492 z.B = point(4, 0)
493 z.C = point(1, 3)
494 T.ABC = triangle(z.A, z.B, z.C)
495 z.H_a = T.ABC.ha
496 z.H_b = T.ABC.hb
497 z.H_c = T.ABC.hc
498 z.H = T.ABC.orthocenter}
499 \begin{center}
500 \begin{tikzpicture}
501 \tkzGetNodes
502 \tkzDrawPolygon(A,B,C)
503 \tkzDrawSegments[dashed](A,H_a B,H_b C,H_c)
504 \tkzDrawPoints(A,B,C,H_a,H_b,H_c,H)
505 \tkzLabelPoints[below](A,B,H_c,H)
506 \tkzLabelPoints[left](H_b)
507 \tkzLabelPoints[right](H_a)
508 \tkzLabelPoints[above](C)
509 \end{tikzpicture}
510 \end{center}
511 \end{tkzexample}
512
513 \subsubsection{Triangle attributes: internal bisector feet}
514 \label{ssub:triangle_attributes_foot_bisector}
515
516 \begin{tkzexample}[latex=.4\textwidth]
517 \directlua{
518 init_elements()
519 z.A = point(0, 0)
520 z.B = point(4, 0)
521 z.C = point(1, 3)
522 T.ABC = triangle(z.A, z.B, z.C)
523 z.I_a = T.ABC.ia
524 z.I_b = T.ABC.ib
525 z.I_c = T.ABC.ic
526 z.I = T.ABC.incenter
527 z.ta,z.tb,z.tc = T.ABC:projections(z.I)}
528 \begin{center}
529 \begin{tikzpicture}
530 \tkzGetNodes
531 \tkzDrawPolygon(A,B,C)
532 \tkzDrawSegments[dashed](A,I_a B,I_b C,I_c)
533 \tkzDrawCircle(I,ta)
534 \tkzDrawPoints(A,B,C,I_a,I_b,I_c,I,ta,tb,tc)
535 \tkzLabelPoints[below](A,B,I_c,I)
536 \tkzLabelPoints[left](I_b)
537 \tkzLabelPoints[right](I_a)
538 \tkzLabelPoints[above](C)
539 \end{tikzpicture}
540 \end{center}
541 \end{tkzexample}
542
543 \subsection{Methods of the class triangle} %(fold)
544
545
546 \begin{minipage}{\textwidth}
547 \bgroup
548 \catcode`_=12
549 \small
550 \captionof{table}{triangle methods.}\label{triangle:methods}
551 \begin{tabular}{ll}
552 \toprule
553 \texttt{Constructor} & \texttt{Reference} \\
554 \midrule
555 \tkzMeth{triangle}{new}(a, b ,c) & [\ref{sub:creating_a_triangle}; \ref{ssub:method_triangle_new_pt_pt_pt}]\\
556 \midrule
557
558 \texttt{Methods Returning a Boolean}&\\
559 \midrule
560 \tkzMeth{triangle}{in\_out(pt)} & [\ref{ssub:_triangle_in__out_pt}]\\
561 \tkzMeth{triangle}{on\_triangle(pt)} & [\ref{ssub:method_triangle_on_triangle}]\\
562 \tkzMeth{triangle}{check\_equilateral()}&[\ref{ssub:_triangle_check__equilateral}] \\
563 \tkzMeth{triangle}{check\_acutangle()} &[\ref{ssub:_triangle_check__acutangle}] \\
564 \midrule
565
566 \texttt{Methods Returning a String} &\\
567 \midrule
568 \tkzMeth{triangle}{position(pt, EPS)} & [\ref{ssub:method_triangle_position}]\\
569 \midrule
570 \texttt{Methods Returning a Real Number} &\\
571 \midrule
572 \tkzMeth{triangle}{barycentric\_coordinates(pt)}& [\ref{ssub:_triangle_barycentric__coordinates_pt}]\\
573 \tkzMeth{triangle}{trilinear\_coordinates(pt)} & [\ref{ssub:triangle_trilinear_coordinates_pt}]\\
574 \tkzMeth{triangle}{get\_angle(arg)} & [\ref{ssub:method_triangle_get_angle}] \\
575 \tkzMeth{triangle}{trilinear\_to\_d} & \ref{ssub:triangle_trilinear_to_d}\\
576 \midrule
577 \texttt{Methods Returning a Point} &\\
578 \midrule
579 \tkzMeth{triangle}{get(arg)} & [\ref{ssub:method_triangle_get}]\\
580 \tkzMeth{triangle}{point(r)} & [\ref{ssub:method_triangle_point_r}]\\
581 \tkzMeth{triangle}{random(<'inside'>)} & [\ref{ssub:method_triangle_random_inside}]\\
582 \tkzMeth{triangle}{barycentric(ka,kb,kc)} &\ref{ssub:_triangle_barycentric_ka_kb_kc}\\
583 \tkzMeth{triangle}{base(u,v)} & [\ref{ssub:method_triangle_base}] \\
584 \tkzMeth{triangle}{trilinear(u,v,w)} & [\ref{ssub:method_triangle_trilinear_x_y_z}] \\
585 \tkzMeth{triangle}{lemoine\_point()} & [\ref{ssub:method_line_isosceles}]\\
586 \tkzMeth{triangle}{symmedian\_point()} & [\ref{ssub:method_triangle_symmedial}] \\
587 \tkzMeth{triangle}{lemoine\_point()} & [\ref{ssub:method_triangle_symmedial}] \\
588 \tkzMeth{triangle}{bevan\_point()} & [\ref{ssub:method_imeth_triangle_bevan_point}; \ref{ssub:methods_triangle_bevan_circle}]\\
589 \tkzMeth{triangle}{mittenpunkt\_point()} & [\ref{ssub:method_triangle_mittenpunkt}]\\
590 \tkzMeth{triangle}{gergonne\_point()} & [\ref{ssub:gergonne_point}]\\
591 \tkzMeth{triangle}{nagel\_point()} & [\ref{ssub:method_triangle_nagel__point}]\\
592 \tkzMeth{triangle}{feuerbach\_point()} & [\ref{ssub:method_point_feuerbach}]\\
593 \tkzMeth{triangle}{spieker\_center()} & [\ref{ssub:method_triangle_spieker_center}]\\
594 \tkzMeth{triangle}{projections(p)} & [\ref{ssub:method_triangle_projections_pt}]\\
595 \tkzMeth{triangle}{reflections(p)} & [\ref{ssub:method_triangle_reflections_pt}]\\
596 \tkzMeth{triangle}{euler\_points()} & [\ref{ssub:method_triangle_euler__points}] \\
597 \tkzMeth{triangle}{nine\_points()} & [\ref{ssub:method_triangle_nine__points}] \\
598 \tkzMeth{triangle}{taylor\_points()} & See [\ref{ssub:method_triangle_taylor__circle}]\\
599 \tkzMeth{triangle}{parallelogram()} & [\ref{ssub:director_circle}]\\
600 \tkzMeth{triangle}{kimberling(n)} & See [\ref{ssub:method_triangle_kimberling_n}]\\
601 \tkzMeth{triangle}{isogonal(p)} & See [\ref{ssub:method_triangle_isogonal}]\\
602 \tkzMeth{triangle}{macbeath\_point()(p)} & See [\ref{ssub:method_triangle_macbeath_point}]\\
603 \tkzMeth{triangle}{poncelet\_point(p)} & See [\ref{ssub:method_triangle_poncelet_point}]\\
604 \tkzMeth{triangle}{orthopole(L)} & See [\ref{ssub:method_triangle_orthopole}]\\
605 \tkzMeth{triangle}{first\_fermat\_point()} &
606 See [\ref{ssub:method_triangle_first_fermat_point}] \\
607 \tkzMeth{triangle}{second\_fermat\_point()} &
608 See [\ref{ssub:method_triangle_second__fermat__point}] \\
609 \tkzMeth{triangle}{lamoen\_points()} &
610 See [\ref{ssub:method_triangle_lamoen_points}]\\
611 \tkzMeth{triangle}{soddy\_center()} &
612 See [\ref{ssub:method_triangle_soddy_center}] \\
613 \tkzMeth{triangle}{conway\_points()} &
614 See [\ref{ssub:method_triangle_conway_points}] \\
615 \tkzMeth{triangle}{kenmotu\_point()} &
616 See [\ref{ssub:_triangle_kenmotu__point}] \\
617 \tkzMeth{triangle}{orthic\_axis\_points()} &
618 See [ \ref{ssub:method_triangle_orthic}; \ref{ssub:method_triangle_orthic_axis_points}]\\
619 \tkzMeth{triangle}{isodynamic\_points()} & [\ref{ssub:isodynamic_points}] \\
620 \tkzMeth{triangle}{apollonius\_point()} & [\ref{ssub:apollonius_point}] \\
621 \tkzMeth{triangle}{cevian\_point()} & [\ref{ssub:cevian_point}] \\
622 \bottomrule
623 \end{tabular}
624 \egroup
625 \end{minipage}
626
627
628
629 \begin{minipage}{\textwidth}
630 \bgroup
631 \catcode`_=12
632 \small
633 \captionof{table}{triangle methods.}
634 \begin{tabular}{ll}
635 \toprule
636 \texttt{Methods} & \texttt{Reference} \\
637 \midrule
638
639 \texttt{Methods Returning a Line} &\\
640 \midrule
641 \tkzMeth{triangle}{altitude(arg) } & [\ref{ssub:method_triangle_altitude}]\\
642 \tkzMeth{triangle}{bisector(arg) } & [\ref{ssub:method_triangle_bisector}]\\
643 \tkzMeth{triangle}{bisector\_ext(arg) } & [\ref{ssub:method_triangle_bisector_ext}]\\
644 \tkzMeth{triangle}{mediator(arg)} & [\ref{ssub:triangle_mediator}]\\
645 \tkzMeth{triangle}{symmedian\_line(arg)} & [\ref{ssub:method_imeth_triangle_symmedian__line}
646 ; \ref{ssub:method_triangle_symmedial} ; \ref{ssub:method_line_isosceles}]\\
647 \tkzMeth{triangle}{euler\_line() } &[\ref{ssub:euler_line}]\\
648 \tkzMeth{triangle}{antiparallel(pt,n)} & [\ref{antiparallel};\ref{sub:antiparallel_through_lemoine_point}]\\
649 \tkzMeth{triangle}{steiner\_line(pt)} &[\ref{ssub:method_triangle_steiner__line}] \\
650 \tkzMeth{triangle}{simson\_line(pt)} &[\ref{ssub:method_triangle_simson__line}] \\
651 \tkzMeth{triangle}{lemoine\_axis()} &[\ref{ssub:method_triangle_lemoine__line}] \\
652 \tkzMeth{triangle}{brocard\_axis()} &[\ref{ssub:method_triangle_brocard__axis}] \\
653 \tkzMeth{triangle}{fermat\_axis()} & \\
654 \tkzMeth{triangle}{orthic\_axis()} & See [\ref{ssub:method_triangle_orthic_axis}]\\
655 \bottomrule
656 \end{tabular}
657 \egroup
658 \end{minipage}
659
660
661
662
663 \newpage
664 \bgroup
665 \catcode`_=12
666 \small
667 \begin{minipage}{\textwidth}
668 \begin{tabular}{ll}
669 \toprule
670 \texttt{Methods} & \textbf{Comments} \\
671 \midrule
672 \texttt{Methods Returning a Circle} &\\
673 \midrule
674 \tkzMeth{triangle}{euler\_circle()} & [\ref{ssub:method_triangle_euler_circle}]\\
675 \tkzMeth{triangle}{circum\_circle()} & [\ref{ssub:method_triangle_circum_circle}] \\
676 \tkzMeth{triangle}{in\_circle()} &[\ref{ssub:method_triangle_in_circle}]\\
677 \tkzMeth{triangle}{ex\_circle(n)} & [\ref{ssub:method_triangle_ex__circle}]\\
678 \tkzMeth{triangle}{first\_lemoine\_circle()} & [\ref{ssub:method_triangle_first_lemoine_circle}] \\
679 \tkzMeth{triangle}{second\_lemoine\_circle()}& \ref{sub:antiparallel_through_lemoine_point}]\\
680 \tkzMeth{triangle}{spieker\_circle()} & [\ref{ssub:method_triangle_spieker__circle}]\\
681 \tkzMeth{triangle}{bevan\_circle()} & [\ref{ssub:methods_triangle_bevan_circle}]\\
682 \tkzMeth{triangle}{cevian\_circle()} & [\ref{ssub:_triangle_cevian__circle_pt}
683 ; \ref{ssub:method_triangle_cevian}]\\
684 \tkzMeth{triangle}{symmedial\_circle()} & [\ref{ssub:method_triangle_symmedial_circ}; \ref{ssub:method_triangle_symmedial}]\\
685 \tkzMeth{triangle}{pedal\_circle()} & [\ref{ssub:method_triangle_pedal}]\\
686 \tkzMeth{triangle}{conway\_circle()} & [\ref{ssub:method_triangle_conway}]\\
687 \tkzMeth{triangle}{taylor\_circle()} & [\ref{ssub:method_triangle_taylor__circle}]\\
688 \tkzMeth{triangle}{kenmotu\_circle()} & [\ref{ssub:kenmotu_circle}]\\
689 \tkzMeth{triangle}{c\_c(pt)} & [\ref{ssub:method_triangle_c_c}]\\
690 \tkzMeth{triangle}{thebault(pt)} & [\ref{ssub:method_triangle_c_c}]\\
691 \tkzMeth{triangle}{mixtilinear\_incircle(arg)} & [\ref{ssub:method_triangle_mixti}]\\
692 \tkzMeth{triangle}{three\_tangent\_circles} & [\ref{ssub:method_triangle_three_tgt_c}]\\
693 \tkzMeth{triangle}{adams\_circle()} & [\ref{ssub:method_triangle_adams_circle}]\\
694 \tkzMeth{triangle}{lamoen\_circle()} &
695 See [\ref{ssub:method_triangle_lamoen_points}] \\
696 \tkzMeth{triangle}{soddy\_circle()} &
697 See [\ref{ssub:method_triangle_soddy_circle}] \\
698 \tkzMeth{triangle}{three\_apollonius\_circles()} &
699 See [\ref{ssub:three_apollonius_circles}] \\
700 \tkzMeth{triangle}{apollonius\_circle(side, EPS)} &
701 See [\ref{ssub:apollonius_circle}] \\
702 \tkzMeth{triangle}{feuerbach\_apollonius\_k181(side, EPS)} &
703 See [\ref{ssub:feuerbach_apollonius_k181}] \\
704 \tkzMeth{triangle}{feuerbach\_apollonius(side, EPS)} &
705 See [\ref{ssub:feuerbach_apollonius}] \\
706 \midrule
707
708 \texttt{Methods Returning a Triangle} &\\
709 \midrule
710 \tkzMeth{triangle}{orthic()} & [\ref{ssub:method_triangle_altitude}] \\
711 \tkzMeth{triangle}{medial()} & [\ref{ssub:method_triangle_medial} ; \ref{ssub:method_triangle_symmedial}]\\
712 \tkzMeth{triangle}{incentral()} &[\ref{ssub:method_incentral}] \\
713 \tkzMeth{triangle}{excentral()} &[\ref{ssub:method_triangle_excentral}; \ref{ssub:method_triangle_feuerbach}] \\
714 \tkzMeth{triangle}{extouch()} &[\ref{ssub:method_triangle_extouch}] \\
715 \tkzMeth{triangle}{intouch() } &[\ref{ssub:method_triangle_intouch}; \ref{ssub:gergonne_point}]\\
716 \tkzMeth{triangle}{contact() } & contact = intouch ; [
717 \ref{ssub:gergonne_point}] \\
718 \tkzMeth{triangle}{tangential()} &[\ref{ssub:method_triangle_tangential}]\\
719 \tkzMeth{triangle}{anti() }& Anticomplementary [\ref{ssub:method_triangle_anti}] \\
720 \tkzMeth{triangle}{cevian(pt)} & [\ref{ssub:method_triangle_cevian}] \\
721 \tkzMeth{triangle}{pedal(pt)} &[\ref{ssub:method_triangle_pedal}]\\
722 \tkzMeth{triangle}{symmedial()} &[\ref{ssub:method_triangle_symmedial}] \\
723 \tkzMeth{triangle}{euler()} & [\ref{ssub:method_triangle_euler}; \ref{ssub:method_triangle_euler__points}] \\
724 \tkzMeth{triangle}{lemoine()} &[\ref{ssub:method_triangle_lemoine}] \\
725 \tkzMeth{triangle}{macbeath()} & See [\ref{ssub:method_triangle_macbeath}]\\
726 \tkzMeth{triangle}{circumcevian()} & See [ \ref{ssub:method_triangle_circumcevian}]\\
727
728
729 \midrule
730 \texttt{Methods Returning a Conic} &\\
731 \tkzMeth{triangle}{kiepert\_parabola()} & [\ref{ssub:method_triangle_kiepert_parabola}] \\
732 \tkzMeth{triangle}{kiepert\_hyperbola()} & [\ref{ssub:method_triangle_kiepert__hyperbola}] \\
733
734 \tkzMeth{triangle}{ellipse\_inscribed(...)} & [\ref{ssub:ellipse_inscribed}]\\
735 \tkzMeth{triangle}{steiner\_inellipse()}& [ \ref{ssub:steiner_inellipse_and_circumellipse}] \\
736 \tkzMeth{triangle}{steiner\_circumellipse()} & [ \ref{ssub:steiner_inellipse_and_circumellipse}] \\
737 \tkzMeth{triangle}{euler\_ellipse()} & [\ref{ssub:euler_ellipse}]\\
738 \tkzMeth{triangle}{lemoine\_ellipse()} & [\ref{ssub:method_triangle_lemoine_inellipse}]\\
739 \tkzMeth{triangle}{brocard\_inellipse()} & [\ref{ssub:method_triangle_brocard__inellipse}]\\
740 \tkzMeth{triangle}{macbeath\_inellipse()} & [\ref{ssub:method_triangle_macbeath__inellipse}]\\
741 \tkzMeth{triangle}{mandart\_ellipse()} & [\ref{ssub:method_triangle_mandart__inellipse}]\\
742 \tkzMeth{triangle}{orthic\_inellipse()} & [\ref{ssub:method_triangle_orthic__inellipse}]\\
743 \tkzMeth{triangle}{projection()} & [See \ref{ssub:method_triangle_projection}]\\
744 \tkzMeth{triangle}{reflection()} & [See \ref{ssub:method_triangle_reflection}; \ref{ssub:method_triangle_simson__line}; \ref{ssub:method_yiu_circles}]\\
745 \midrule
746 \texttt{Methods Returning a Square} &\\
747 \tkzMeth{triangle}{square\_inscribed()} & [ex.(\ref{ssub:method_triangle_square__inscribed}]\\
748 \bottomrule
749 \end{tabular}
750 \end{minipage}
751 \egroup
752
753
754
755 \subsubsection{Method \tkzMeth{triangle}{new(pt, pt, pt)}}
756 \label{ssub:method_triangle_new_pt_pt_pt}
757
758 This method creates a triangle object from three given points, which will serve as its vertices.
759
760 \medskip
761
762 It is widely used and appears in most examples. The syntax is:
763
764 \begin{center}
765 \code{T.ABC = triangle(z.A, z.B, z.C)}
766 \end{center}
767
768
769 The resulting object includes many precomputed attributes such as:
770 \begin{itemize}
771 \item \code{T.ABC.A}, \code{T.ABC.B}, \code{T.ABC.C} — the vertices,
772 \item \code{T.a}, \code{T.b}, \code{T.ABC.c} — the side lengths,
773 \item \code{T.alpha}, \code{T.beta}, \code{T.gamma} — the angles,
774 \item \code{T.area}, \code{T.perimeter},
775 \item as well as key points like the centroid, incenter, orthocenter, circumcenter, etc.
776 \end{itemize}
777
778
779 These are available as attributes, not as methods.
780
781 \vspace{1em}
782 \begin{mybox}
783 \begin{tkzexample}[code only]
784 z.A = point(1, 0)
785 z.B = point(6, 2)
786 z.C = point(2, 5)
787 T.ABC = triangle(z.A, z.B, z.c)
788 \end{tkzexample}
789 \end{mybox}
790
791 \subsubsection{Method \tkzMeth{triangle}{get(<i>)}}
792 \label{ssub:method_triangle_get}
793
794 This method performs the inverse of triangle creation: it returns the points that define the triangle object.
795
796 \medskip
797
798 From the last version, the method also accepts an optional argument~\code{i} to retrieve a specific point:
799 \begin{itemize}
800 \item \code{T.ABC:get()} returns all three vertices in order: \code{pa}, \code{pb}, \code{pc};
801 \item \code{T.ABC:get(1)} returns only the first point (\code{pa}),
802 \item \code{T.ABC:get(2)} returns the second point (\code{pb}),
803 \item \code{T.ABC:get(3)} returns the third point (\code{pc}).
804 \end{itemize}
805
806 \medskip
807
808 Each of these points is also accessible directly as an attribute:
809 \begin{center}
810 \code{T.ABC.pa}, \code{T.ABC.pb}, \code{T.ABC.pc}
811 \end{center}
812 For example:
813 \begin{center}
814 \code{T.ABC:get(2)} is equivalent to \code{T.ABC.pb}
815 \end{center}
816
817 \medskip
818
819 This method belongs to a general mechanism shared by all geometric objects. Its goal is to return the minimal data required to reconstruct the object.
820
821 \vspace{1em}
822
823 \begin{minipage}{.5\textwidth}
824 \directlua{
825 z.A = point(1, 0)
826 z.B = point(2, 2)
827 z.C = point(0, 1)
828 T.ABC = triangle(z.A, z.B, z.C)
829 T.med = T.ABC:anticomplementary()
830 z.Ap, z.Bp, z.Cp = T.med:get()
831 xa,ya = z.Ap:get()
832 % possible
833 % z.Ap = T.med.pa etc.
834 }
835 \let\tul\tkzUseLua
836 \begin{center}
837 \begin{tikzpicture}
838 \tkzGetNodes
839 \tkzDrawPolygon(A,B,C)
840 \tkzDrawPolygon[red](A',B',C')
841 \tkzDrawPoints(A,B,C,A',B',C')
842 \tkzLabelPoints(A,C')
843 \tkzLabelPoint[above](A'){%
844 $A':(\tul{xa};\tul{ya})$}
845 \tkzLabelPoints[above left](C,B')
846 \tkzLabelPoints[above right](B)
847 \end{tikzpicture}
848 \end{center}
849 \end{minipage}
850 \begin{minipage}{.5\textwidth}
851 \begin{tkzexample}[code only]
852 \directlua{
853 z.A = point(1, 0)
854 z.B = point(2, 2)
855 z.C = point(0, 1)
856 T.ABC = triangle(z.A, z.B, z.C)
857 T.med = T.ABC:anticomplementary()
858 z.Ap, z.Bp, z.Cp = T.med:get()
859 xa,ya = z.Ap:get()}
860 \end{tkzexample}
861 \end{minipage}
862
863 %%%%%%%%%%%%%%% boolean %%%%%%%%%%%%
864 \subsection{Returns a boolean value}
865
866 %--------------------------------------------------------------------
867 \subsubsection{Method \tkzMeth{triangle}{position(pt[, EPS])}}
868 \label{ssub:method_triangle_position}
869 %--------------------------------------------------------------------
870
871 This method classifies the position of a point \code{pt}
872 with respect to the triangle.
873
874 \medskip
875
876 \texttt{Return values: }
877 \begin{itemize}
878 \item \code{"IN"} — the point lies strictly inside the triangle;
879 \item \code{"ON"} — the point lies on one of its sides;
880 \item \code{"OUT"} — the point lies strictly outside.
881 \end{itemize}
882
883 \medskip
884
885 An optional tolerance parameter \code{EPS} may be provided.
886 If omitted, the global tolerance \code{tkz.epsilon} is used.
887
888 \medskip
889
890 The classification is based on barycentric coordinates
891 and is numerically robust.
892
893 \medskip
894
895 This method provides a unified and explicit classification model,
896 consistent with other geometric objects such as
897 \code{line:position()} and \code{circle:position()}.
898
899
900
901 \subsubsection{Method \tkzMeth{triangle}{in\_out(pt)}; Deprecated}
902 \label{ssub:_triangle_in__out_pt}
903
904
905 This method is kept for backward compatibility.
906
907 It returns a boolean:
908
909 \begin{itemize}
910 \item \code{true} if the point lies inside the triangle
911 or on its boundary;
912 \item \code{false} if the point lies strictly outside.
913 \end{itemize}
914
915 \medskip
916
917 Internally, this method relies on
918 \code{triangle:position(pt)} and returns:
919
920 \[
921 \texttt{position(pt) ~= "OUT"}
922 \]
923
924 \medskip
925
926 For new developments, the use of
927 \code{triangle:position(pt)} is recommended.
928
929
930 \subsubsection{Method \tkzMeth{triangle}{on\_triangle(pt)}; Deprecated}
931 \label{ssub:method_triangle_on_triangle}
932
933 This method is kept for backward compatibility.
934
935
936 \medskip
937
938 \texttt{Returns: }
939 \begin{itemize}
940 \item \code{"inside"} if \code{pt} lies strictly inside the triangle;
941 \item \code{"on\_edge"} if \code{pt} lies on one of the sides of the triangle;
942 \item \code{"outside"} otherwise.
943 \end{itemize}
944
945
946
947
948 \subsubsection{Method \tkzMeth{triangle}{check\_equilateral()}}
949 \label{ssub:_triangle_check__equilateral}
950
951 This method checks whether the triangle is equilateral, i.e., whether its three sides are of equal length within a numerical tolerance.
952
953 \medskip
954
955 It returns a boolean:
956 \begin{itemize}
957 \item \code{true} if the triangle is equilateral,
958 \item \code{false} otherwise.
959 \end{itemize}
960
961
962 This check takes into account floating-point rounding and uses an internal tolerance parameter.
963
964
965 \begin{mybox}
966 \begin{verbatim}
967 if T.ABC:check_equilateral() then
968 -- do something
969 end
970 \end{verbatim}
971 \end{mybox}
972
973 \vspace{1em}
974
975 \subsubsection{Method \tkzMeth{triangle}{check\_acutangle()}}
976 \label{ssub:_triangle_check__acutangle}
977
978 Boolean. This method tests whether the triangle is \textbf{acutangle}, i.e., if all three of its interior angles are strictly less than $90^\circ$.
979
980 \medskip
981
982 An \emph{acutangle triangle} is a triangle where:
983 \[
984 \alpha < 90^\circ, \quad \beta < 90^\circ, \quad \gamma < 90^\circ
985 \]
986
987
988 \begin{mybox}
989 \begin{verbatim}
990 if T.ABC:check_acutangle() then
991 -- do something
992 end
993 \end{verbatim}
994 \end{mybox}
995
996
997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
998
999 %%%%%%%%%%%%%%%% reals %%%%%%%%%%%%
1000
1001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1002
1003 \subsection{Returns a real number}
1004
1005 \subsubsection{Method \tkzMeth{triangle}{barycentric\_coordinates(pt)}}
1006 \label{ssub:_triangle_barycentric__coordinates_pt}
1007
1008 This method returns the \textbf{normalized barycentric coordinates} of a point relative to the reference triangle.
1009
1010 \begin{mybox}
1011 \code{x, y, z = T: barycentric\_coordinates(z.P)}
1012 \end{mybox}
1013
1014 \medskip
1015
1016 The result is a triple \code{x, y, z} such that:
1017 \[
1018 x + y + z = 1
1019 \]
1020
1021 \medskip
1022
1023 If the point lies on a side or at a vertex, one or more coordinates will be zero accordingly. This method is especially useful for checking point location, computing weighted centers, or constructing affine invariants.
1024
1025 \vspace{1em}
1026 \begin{minipage}{.45\textwidth}
1027 \directlua{
1028 init_elements()
1029 z.A = point(0, 0)
1030 z.B = point(3, 0)
1031 z.C = point(1, 2)
1032 T.ABC = triangle(z.A, z.B, z.C)
1033 z.G = T.ABC.centroid
1034 xg, yg, zg = T.ABC: barycentric_coordinates(z.G)}
1035 \let\tul\tkzUseLua
1036 \begin{tikzpicture}
1037 \tkzGetNodes
1038 \tkzDrawPolygon(A,B,C)
1039 \tkzDrawPoints(A,B,C,G)
1040 \tkzLabelPoints(A,B)
1041 \tkzLabelPoints[above](C)
1042 \tkzLabelPoint[right](G){$G: (\pmpn{\tul{xg}}:\pmpn{\tul{yg}}:\pmpn{\tul{zg}})$}
1043 \end{tikzpicture}
1044 \end{minipage}
1045 \begin{minipage}{.55\textwidth}
1046 \begin{tkzexample}[code only]
1047 \directlua{
1048 init_elements()
1049 z.A = point(0, 0)
1050 z.B = point(3, 0)
1051 z.C = point(1, 2)
1052 T.ABC = triangle(z.A, z.B, z.C)
1053 z.G = T.ABC.centroid
1054 xg, yg, zg = T.ABC: barycentric_coordinates(z.G)}
1055 \end{tkzexample}
1056 \end{minipage}
1057
1058 \subsubsection{Method \tkzMeth{triangle}{trilinear\_coordinates(pt)}}
1059 \label{ssub:triangle_trilinear_coordinates_pt}
1060
1061 This method returns the \textbf{trilinear coordinates} of a point relative to the reference triangle.
1062
1063 \medskip
1064
1065 Trilinear coordinates represent a point $P$ by its (signed) distances to the sides of the triangle. The triple \code{x, y, z} corresponds to the directed distances from $P$ to the sides $BC$, $AC$, and $AB$, respectively.
1066
1067 \begin{mybox}
1068 \code{x, y, z = T.ABC:trilinear\_coordinates(z.P)}
1069 \end{mybox}
1070
1071 \medskip
1072
1073 Unlike barycentric coordinates, trilinear coordinates are homogeneous, i.e., they are defined up to a nonzero scalar multiple:
1074 \[
1075 P = x : y : z
1076 \]
1077
1078
1079 \subsubsection{Method \tkzMeth{triangle}{get\_angle(arg)}}
1080 \label{ssub:method_triangle_get_angle}
1081
1082 This method returns one of the three internal angles of the triangle.
1083
1084 \medskip
1085
1086 The argument \code{arg} identifies the vertex at which the angle is measured.
1087 It can be specified in several equivalent ways:
1088 \begin{itemize}
1089 \item by a cyclic index \code{0}, \code{1}, or \code{2},
1090 \item by a symbolic identifier (\code{pa}, \code{pb}, \code{pc}),
1091 \item or directly by passing one of the triangle’s vertices as a point.
1092 \end{itemize}
1093
1094 \medskip
1095
1096 The vertices of the triangle are assumed to be ordered in direct
1097 (counter-clockwise) orientation as $(A, B, C)$.
1098 Accordingly, the returned angle is determined as follows:
1099
1100 \begin{itemize}
1101 \item \code{arg = 0} or \code{arg = pa}: returns the angle at vertex $A$,
1102 \item \code{arg = 1} or \code{arg = pb}: returns the angle at vertex $B$,
1103 \item \code{arg = 2} or \code{arg = pc}: returns the angle at vertex $C$.
1104 \end{itemize}
1105
1106 \medskip
1107
1108 This method should not be confused with the function
1109 \code{get\_angle(pta, ptb, ptc)}, which computes the angle formed by three
1110 arbitrary points, independently of any triangle object.
1111
1112 \vspace{1em}
1113
1114
1115 \begin{tkzexample}[latex=7cm]
1116 \directlua{
1117 z.A = point: new(0, 0)
1118 z.B = point: new(4, 0)
1119 z.C = point: new(2, 2)
1120 T.ABC = triangle(z.A, z.B, z.C)
1121 tkzAngleA = math.deg(T.ABC:get_angle(z.A))
1122 z.O = T.ABC.circumcenter
1123 C.OB = circle(z.O,z.B)
1124 z.T = C.OB:point(.2)}
1125 \begin{center}
1126 \begin{tikzpicture}
1127 \tkzGetNodes
1128 \tkzDrawCircle(O,A)
1129 \tkzDrawArc[red,->,ultra thick](O,B)(T)
1130 \tkzDrawLines[red](A,B A,C)
1131 \tkzDrawPoints(A,B,C)
1132 \tkzLabelPoints(A,B)
1133 \tkzLabelPoints(C)
1134 \tkzLabelPoint[right=6pt,red,thick](T){$\mathbf{+}$}
1135 \tkzMarkAngle[->,red](B,A,C)
1136 \tkzLabelAngle(B,A,C){\tkzUseLua{tkzAngleA}}
1137 \end{tikzpicture}
1138 \end{center}
1139 \end{tkzexample}
1140
1141 \subsubsection{Method \tkzMeth{triangle}{trilinear\_to\_d}}
1142 \label{ssub:triangle_trilinear_to_d}
1143
1144 \texttt{Purpose: }
1145 Convert a trilinear triple \((x:y:z)\) into a proportional triple \((p,q,r)\) related to the perpendicular distances from a point to the triangle sides \(BC,CA,AB\).
1146 The method uses the current triangle side lengths \(a,b,c\) and area \(\Delta\).
1147
1148 \medskip
1149 \texttt{Interest: }
1150 Trilinear coordinates are a natural system for locating points defined by geometric relations involving the sides of a triangle
1151 (e.g., incenters, excenters, Gergonne or Nagel points, centers of conics, etc.).
1152 Many formulas in triangle geometry are expressed in trilinears, but practical geometric constructions often require
1153 distances to the sides or to be converted into Cartesian coordinates.
1154 The method \tkzname{trilinear\_to\_d} provides this essential step:
1155 \[
1156 (x:y:z) \quad \longrightarrow \quad (p,q,r) \propto \left(\frac{x}{a}, \frac{y}{b}, \frac{z}{c}\right)
1157 \]
1158 This allows the use of trilinear relations directly within the computational framework of \texttt{tkz-elements}.
1159
1160 \medskip
1161 \texttt{Syntax: }
1162 \verb|p, q, r = T:trilinear_to_d(x, y, z)|
1163
1164 \medskip
1165 \texttt{Arguments: }
1166 \begin{itemize}
1167 \item \code{x}, \code{y}, \code{z} — real numbers representing the trilinear coordinates.
1168 \end{itemize}
1169
1170 \texttt{Returns: }
1171 \begin{itemize}
1172 \item \code{p}, \code{q}, \code{r} — real numbers proportional to the distances to the triangle sides.
1173 \end{itemize}
1174
1175 \texttt{Definition: }
1176 \[
1177 p = \Delta\,\frac{x}{a}, \qquad
1178 q = \Delta\,\frac{y}{b}, \qquad
1179 r = \Delta\,\frac{z}{c},
1180 \]
1181 where \(\Delta\) is the area of the triangle computed with Heron’s formula.
1182
1183 \medskip
1184 \texttt{Remarks: }
1185 \begin{itemize}
1186 \item The returned values \((p,q,r)\) are proportional to the distances, not normalized.
1187 \item For actual distances \((d_a,d_b,d_c)\) one can use:
1188 \[
1189 \lambda = \frac{2\Delta}{ax + by + cz}, \qquad
1190 d_a = \lambda x,\quad d_b = \lambda y,\quad d_c = \lambda z.
1191 \]
1192 \end{itemize}
1193
1194
1195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1196 %%%%%%%%%%%%%% points %%%%%%%%%%%%%
1197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1198
1199
1200 \subsection{Returns a point}
1201
1202 \subsubsection{Method \tkzMeth{triangle}{point(r)}}
1203 \label{ssub:method_triangle_point_r}
1204
1205 This method is common to most classes. It places a point along the contour of the triangle, proportionally to its perimeter.
1206
1207 \medskip
1208
1209 The parameter \code{r} must be a real number between \code{0} and \code{1}, representing the fraction of the total perimeter to travel starting from the first vertex (\code{pa}) along the oriented boundary.
1210
1211 \begin{itemize}
1212 \item If \code{r = 0} or \code{r = 1}, the method returns the first point (\code{pa}).
1213 \item If \code{r = 0.5}, the resulting point lies halfway along the triangle’s perimeter.
1214 \end{itemize}
1215
1216 \medskip
1217
1218 \texttt{Example: } The point $M$ divides the perimeter into two equal arcs:
1219 \begin{center}
1220 \code{z.M = T.ABC:point(0.5)}
1221 \end{center}
1222
1223 \vspace{1em}
1224 \begin{tkzexample}[latex=.5\textwidth]
1225 \directlua{
1226 z.A = point(1, 0)
1227 z.B = point(6, 2)
1228 z.C = point(2, 5)
1229 T.ABC = triangle(z.A, z.B, z.C)
1230 z.M = T.ABC:point(.5)}
1231 \begin{tikzpicture}
1232 \tkzGetNodes
1233 \tkzDrawPolygon(A,B,C)
1234 \tkzDrawPoints(A,B,C,M)
1235 \tkzLabelPoints(A,B,C,M)
1236 \tkzDrawSegments[red,thick](A,B B,M)
1237 \end{tikzpicture}
1238 \end{tkzexample}
1239
1240 \subsubsection{Method \tkzMeth{triangle}{random(<'inside'>)}}
1241 \label{ssub:method_triangle_random_inside}
1242
1243 This method determines either a random point on one of the sides, or an interior point using the optional \code{inside} argument.
1244
1245 \begin{tkzexample}[latex=.5\textwidth]
1246 \directlua{
1247 init_elements()
1248 z.A = point(0, 0)
1249 z.B = point(5, 0)
1250 z.C = point(1, 4)
1251 T.ABC = triangle(z.A, z.B, z.C)
1252 z.Q = T.ABC:random("inside")
1253 z.P = T.ABC:random() }
1254 \begin{tikzpicture}
1255 \tkzGetNodes
1256 \tkzDrawPolygons[red](A,B,C)
1257 \tkzDrawPoints(A,B,C,P,Q)
1258 \tkzLabelPoints(P,Q)
1259 \end{tikzpicture}
1260 \end{tkzexample}
1261
1262 \subsubsection{Method \tkzMeth{triangle}{barycentric(ka, kb, kc)}}
1263 \label{ssub:_triangle_barycentric_ka_kb_kc}
1264
1265 This method, also available under the alias \code{barycenter}, returns the point with barycentric coordinates $(ka : kb : kc)$ with respect to the triangle.
1266
1267 \medskip
1268
1269 These coordinates are \emph{homogeneous}, meaning only the ratio between the weights matters. The computed point $P$ satisfies:
1270 \[
1271 P = \frac{ka \cdot A + kb \cdot B + kc \cdot C}{ka + kb + kc}
1272 \]
1273 where $A$, $B$, and $C$ are the triangle's vertices.
1274
1275 \medskip
1276
1277 This method is widely used internally, notably by the \code{kimberling()} method to define classical triangle centers such as the centroid, incenter, symmedian point, etc.
1278
1279
1280 \vspace{1em}
1281
1282 \begin{tkzexample}[latex=.5\textwidth]
1283 \directlua{
1284 z.A = point(1, 0)
1285 z.B = point(6, 2)
1286 z.C = point(2, 5)
1287 T.ABC = triangle(z.A, z.B, z.C)
1288 z.P = T.ABC:barycentric(1, 1, 1)}
1289 \begin{tikzpicture}[scale=.75]
1290 \tkzGetNodes
1291 \tkzDrawPolygon(A,B,C)
1292 \tkzDrawPoint(P)
1293 \tkzLabelPoints(A,B,P)
1294 \tkzLabelPoints[above](C)
1295 \end{tikzpicture}
1296 \end{tkzexample}
1297
1298 \subsubsection{Method \tkzMeth{triangle}{trilinear(x, y, z)}}
1299 \label{ssub:method_triangle_trilinear_x_y_z}
1300
1301 This method determines a point $P$ given its trilinear coordinates relative to a reference triangle $ABC$.
1302
1303 \medskip
1304
1305 Trilinear coordinates are defined as an ordered triple $(x, y, z)$ that is proportional to the directed distances from the point $P$ to the sides $BC$, $AC$, and $AB$ respectively.
1306
1307 \medskip
1308
1309 These coordinates are \textbf{homogeneous}, meaning they are only defined up to a nonzero scalar multiple. The point $P$ lies at the intersection of the cevians corresponding to these ratios.
1310
1311 \medskip
1312
1313 Trilinear coordinates were introduced by Plücker in 1835 and remain a fundamental tool in triangle geometry.
1314 \begin{flushright}
1315 \small
1316 \href{https://mathworld.wolfram.com/TrilinearCoordinates.html}{Weisstein, Eric W. "Trilinear Coordinates." MathWorld.}
1317 \end{flushright}
1318
1319 \vspace{1em}
1320 \begin{tkzexample}[latex=.5\textwidth]
1321 \directlua{
1322 init_elements()
1323 z.A = point(0, 0)
1324 z.B = point(4, 0)
1325 z.C = point(4, 3)
1326 T.ABC = triangle(z.A, z.B, z.C)
1327 a = T.ABC.a
1328 b = T.ABC.b
1329 c = T.ABC.c
1330 z.Gp = T.ABC:trilinear(b * c, a * c, a * b)
1331 z.G = T.ABC:barycentric(1, 1, 1)}
1332 \begin{center}
1333 \begin{tikzpicture}
1334 \tkzGetNodes
1335 \tkzDrawPolygon(A,B,C)
1336 \tkzDrawPoints(A,B,C,G',G)
1337 \tkzLabelPoints(A,B,G')
1338 \tkzLabelPoints[above](C,G)
1339 \end{tikzpicture}
1340 \end{center}
1341 \end{tkzexample}
1342
1343 \subsubsection{Method \tkzMeth{triangle}{base}} %(fold)
1344 \label{ssub:method_triangle_base}
1345
1346 This method computes a point defined as a linear combination of two sides of the triangle, based at the first vertex.
1347
1348 \medskip
1349
1350 Given a triangle $ABC$, the method defines a point $D$ by:
1351 \[
1352 \overrightarrow{AD} = \lambda \cdot \overrightarrow{AB} + \mu \cdot \overrightarrow{AC}
1353 \]
1354 where $\lambda$ and $\mu$ are real coefficients passed as arguments.
1355
1356 \medskip
1357
1358 \texttt{Example:} If both coefficients are \code{1}, then:
1359 \[
1360 \overrightarrow{AD} = \overrightarrow{AB} + \overrightarrow{AC}
1361 \]
1362 This yields a point located "beyond" $A$ in the direction formed by adding the two side vectors.
1363
1364 \begin{mybox}
1365 \code{z.D = T.ABC:base(1,1)}
1366 \end{mybox}
1367
1368 \vspace{1em}
1369
1370 \begin{tkzexample}[latex=.5\textwidth]
1371 \directlua{
1372 init_elements()
1373 z.A = point(1, 1)
1374 z.B = point(8, 0)
1375 z.C = point(0, 5)
1376 z.X = point(2, 2)
1377 T.ABC = triangle(z.A, z.B, z.C)
1378 z.D = T.ABC:base(1, 1)
1379 z.E = T.ABC:base(.5, 1)}
1380 \begin{center}
1381 \begin{tikzpicture}[scale=.75]
1382 \tkzGetNodes
1383 \tkzDrawPolygons(A,B,D,C A,B,E,C)
1384 \tkzDrawPoints(A,B,C,D,E)
1385 \tkzLabelPoints(A,B)
1386 \tkzLabelPoints[above](C,D,E)
1387 \end{tikzpicture}
1388 \end{center}
1389 \end{tkzexample}
1390
1391 \subsubsection{Method \tkzMeth{triangle}{kimberling(n)}}
1392 \label{ssub:method_triangle_kimberling_n}
1393
1394 This method returns the triangle center corresponding to the Kimberling number~\code{n}.
1395
1396 \medskip
1397
1398 The enumeration of triangle centers was established by American mathematician Clark Kimberling in his \textit{Encyclopedia of Triangle Centers}, available online from the University of Evansville:
1399 \begin{center}
1400 \href{http://faculty.evansville.edu/ck6/encyclopedia/ETC.html}{faculty.evansville.edu/ck6/encyclopedia/ETC.html}
1401 \end{center}
1402
1403
1404 Each remarkable triangle center is assigned a unique index $X_{(n)}$. For example, the centroid is $X_{(2)}$, and the orthocenter is $X_{(4)}$.
1405
1406 \medskip
1407
1408 Only a selection of centers is currently implemented in this method. The accessible Kimberling numbers are:
1409 \begin{multicols}{2}
1410 \begin{itemize}
1411 \item $X_{(1)}$: incenter
1412 \item $X_{(2)}$: centroid
1413 \item $X_{(3)}$: circumcenter
1414 \item $X_{(4)}$: orthocenter
1415 \item $X_{(5)}$: nine-point center
1416 \item $X_{(6)}$: symmedian (Lemoine) point
1417 \item $X_{(7)}$: Gergonne point
1418 \item $X_{(8)}$: Nagel point
1419 \item $X_{(9)}$: Mittenpunkt
1420 \item $X_{(10)}$: Spieker center
1421 \item $X_{(11)}$: Feuerbach point
1422 \item $X_{(13)}$: First Fermat point
1423 \item $X_{(14)}$: Second Fermat point
1424 \item $X_{(19)}$: Clawson point
1425 \item $X_{(20)}$: de Longchamps point
1426 \item $X_{(55)}$, $X_{(56)}$, $X_{(110)}$, $X_{(111)}$, $X_{(115)}$
1427 \item $X_{(175)}$, $X_{(176)}$, $X_{(213)}$, $X_{(371)}$
1428 \end{itemize}
1429 \end{multicols}
1430
1431
1432 \texttt{Example:}
1433 \begin{mybox}
1434 \code{z.G = T.ABC:kimberling(2)} \quad --> the centroid $X_{(2)}$
1435 \end{mybox}
1436
1437 \vspace{1em}
1438
1439 \begin{tkzexample}[latex=.5\textwidth]
1440 \directlua{
1441 init_elements()
1442 z.B = point(0, 0)
1443 z.C = point(4, 0)
1444 z.A = point(1, 3.2)
1445 T.ABC = triangle(z.A, z.B, z.C)
1446 z.H = T.ABC:kimberling(4)
1447 z.O = T.ABC:kimberling(3)
1448 L.euler = line(z.O, z.H)
1449 z.F = T.ABC:kimberling(110)
1450 kiepert = conic(z.F,L.euler,1)
1451 curve = kiepert:points(-4, 4, 50)
1452 z.ea, z.eb = L.euler:get() }
1453 \begin{center}
1454 \begin{tikzpicture}[scale=.8]
1455 \tkzGetNodes
1456 \tkzDrawLines[cyan,
1457 add= .5 and .5](A,C A,B A,C)
1458 \tkzDrawPolygon[cyan](A,B,C)
1459 \tkzDrawCoordinates[smooth,red](curve)
1460 \tkzDrawLines[red,add= .5 and .5](ea,eb)
1461 \tkzDrawPoints(A,B,C,F,O,H)
1462 \tkzLabelPoints(A,B,C,F,O,H)
1463 \end{tikzpicture}
1464 \end{center}
1465 \end{tkzexample}
1466
1467 \subsubsection{Method \tkzMeth{triangle}{isogonal(pt)}} %(fold)
1468 \label{ssub:method_triangle_isogonal}
1469
1470 This method returns the \textbf{isogonal conjugate} of a point~\code{pt} with respect to a triangle~$ABC$.
1471
1472 \medskip
1473
1474 The isogonal conjugate $Y$ of a point $X$ is defined as the common point of the three lines obtained by reflecting the lines $AX$, $BX$, and $CX$ across the respective internal angle bisectors at $A$, $B$, and $C$.
1475
1476 \medskip
1477
1478 An alternative but equivalent construction — and the one used in this method — consists in:
1479 \begin{itemize}
1480 \item reflecting point $X$ across each side of the triangle,
1481 \item constructing the circle through the three reflected points,
1482 \item returning the center of this circle.
1483 \end{itemize}
1484
1485 \medskip
1486
1487 \textbf{Validation:} Using this method, you can verify that the isogonal conjugate of the orthocenter is indeed the circumcenter of triangle $ABC$.
1488
1489 \medskip
1490
1491 \textbf{Geometric remark:} If a point $M$ lies on the circumcircle, then the isogonal conjugates of the points on the tangent line at $M$ trace a parabola that passes through the three vertices of the triangle. This elegant but subtle configuration highlights the dynamic complexity of isogonal mappings:
1492 \begin{itemize}
1493 \item the vertices of the triangle are the conjugates of the tangent's intersection points with the triangle’s sides;
1494 \item points near $M$ on the tangent map to conjugates that tend toward infinity.
1495 \end{itemize}
1496
1497 \medskip
1498
1499 In the accompanying example, $x$ is the intersection of the tangent with side $AC$, and $x'$ is a nearby point chosen to observe the behavior of its isogonal conjugate $y'$.
1500
1501 \vspace{1em}
1502
1503 \begin{tkzexample}[latex = 6cm]
1504 \directlua{
1505 z.a = point(0, 0)
1506 z.b = point(4, 0)
1507 z.c = point(1, 4)
1508 T.abc = triangle(z.a, z.b, z.c)
1509 z.H = T.abc.orthocenter
1510 z.O = T.abc:isogonal(z.H)
1511 z.I = T.abc.incenter
1512 C.Oa = circle(z.O, z.a)
1513 z.M = C.Oa:point(0.45)
1514 Ta = C.Oa:tangent_at(z.M)
1515 z.u = Ta.pb
1516 z.v = Ta.pa
1517 z.x = intersection(Ta,T.abc.ca)
1518 z.y = T.abc:isogonal(z.x)
1519 L.Mx = line(z.M,z.x)
1520 z.xp = L.Mx:point(0.9)
1521 z.yp = T.abc:isogonal(z.xp)
1522 PA.points = path()
1523 for t = 1.5, 50, 1/10 do
1524 local x = Ta:point(t)
1525 local y = T.abc:isogonal(x)
1526 PA.points:add_point(y)
1527 end
1528 for t = -55, 0.2, 1/10 do
1529 local x = Ta:point(t)
1530 local y = T.abc:isogonal(x)
1531 PA.points:add_point(y) end}
1532 \begin{center}
1533 \begin{tikzpicture}[scale=.75]
1534 \tkzGetNodes
1535 \tkzDrawPolygon(a,b,c)
1536 \tkzDrawCoordinates[smooth,red,thick](PA.points)
1537 \tkzDrawLines[add =.1 and .1](x,v a,b b,c a,x)
1538 \tkzDrawPoints(a,b,c,H,M,x,y,H,O,x',y')
1539 \tkzLabelPoints(a,b,M,H,O)
1540 \tkzLabelPoints[above](c,x,y,x',y')
1541 \tkzDrawCircles(O,a)
1542 \end{tikzpicture}
1543 \end{center}
1544 \end{tkzexample}
1545
1546 \subsubsection{Method \tkzMeth{triangle}{bevan\_point()}}
1547 \label{ssub:method_imeth_triangle_bevan_point}
1548 The Bevan point of a triangle is the circumcenter of the excentral triangle.
1549
1550 \begin{tkzexample}[latex=.5\textwidth]
1551 \directlua{
1552 init_elements()
1553 z.A = point(1, 1)
1554 z.B = point(6, 0)
1555 z.C = point(2, 4)
1556 T.ABC = triangle(z.A, z.B, z.C)
1557 T.exc = T.ABC:excentral()
1558 z.J_a, z.J_b, z.J_c = T.exc:get()
1559 z.c = T.ABC:bevan_point()}
1560 \begin{tikzpicture}[scale=.45]
1561 \tkzGetNodes
1562 \tkzDrawPolygons(A,B,C)
1563 \tkzDrawCircle(c,J_a)
1564 \tkzDrawPoints(A,B,C,c,J_a,J_b,J_c)
1565 \tkzLabelPoints(A,B,c,J_c)
1566 \tkzLabelPoints[above](C,J_a)
1567 \tkzLabelPoints[left](J_b)
1568 \end{tikzpicture}
1569 \end{tkzexample}
1570
1571 \subsubsection{Method \tkzMeth{triangle}{excenter}(pt)}
1572 \label{ssub:method_triangle_excenter_pt}
1573 Since the argument is one of the triangle's vertices, this method returns the center of the corresponding exinscribed circle.
1574
1575 \subsubsection{Method \tkzMeth{triangle}{projections}(pt)}
1576 \label{ssub:method_triangle_projections_pt}
1577
1578 This method returns the three orthogonal projections of a point onto the sides of the triangle.
1579
1580 \medskip
1581
1582 Given a triangle $ABC$ and a point $P$, the method computes the feet of the perpendiculars dropped from $P$ to each of the sides $[BC]$, $[AC]$, and $[AB]$.
1583
1584 \medskip
1585
1586 The result consists of three points, which can be retrieved as follows:
1587 \begin{mybox}
1588 \code{z.D, z.E, z.F = T.ABC:projections(z.P)}
1589 \end{mybox}
1590 where:
1591 \begin{itemize}
1592 \item \code{z.D} is the projection onto $BC$,
1593 \item \code{z.E} onto $AC$,
1594 \item \code{z.F} onto $AB$.
1595 \end{itemize}
1596
1597 \medskip
1598
1599 This method is useful, for example, in constructing the pedal triangle of a point with respect to a triangle.
1600
1601 \vspace{1em}
1602
1603
1604 \begin{tkzexample}[latex = 7cm]
1605 \directlua{
1606 z.A = point(0, 0)
1607 z.B = point(5, 0)
1608 z.C = point(-.4 , 4)
1609 T.ABC = triangle(z.A, z.B, z.C)
1610 z.I = T.ABC.incenter
1611 z.a,
1612 z.b,
1613 z.c = T.ABC:projections(z.I)
1614 z.J = T.ABC:excenter(z.C)
1615 z.X,
1616 z.Y,
1617 z.Z = T.ABC:projections(z.J)}
1618 \begin{center}
1619 \begin{tikzpicture}[scale=.75]
1620 \tkzGetNodes
1621 \tkzDrawPolygon(A,B,C)
1622 \tkzDrawArc[blue](J,X)(Y)
1623 \tkzDrawCircle[red](I,a)
1624 \tkzDrawSegments[blue](J,X J,Y J,Z C,Y C,X)
1625 \tkzDrawSegments[red](I,a I,b I,c)
1626 \tkzDrawSegments[cyan,dashed](C,J)
1627 \tkzDrawPoints(A,B,C,I,a,b,c,J,X,Y,Z)
1628 \tkzLabelPoints(J,c)
1629 \tkzLabelPoints[right](I,X)
1630 \tkzLabelPoints[above](B,Z,a)
1631 \tkzLabelPoints[left](A,Y,b,C)
1632 \tkzMarkRightAngles[fill=blue!20,
1633 opacity=.4](A,Z,J A,Y,J J,X,B)
1634 \tkzMarkRightAngles[fill=red!20,
1635 opacity=.4](A,b,I A,c,I I,a,B)
1636 \end{tikzpicture}
1637 \end{center}
1638 \end{tkzexample}
1639
1640
1641 \subsubsection{Method \tkzMeth{triangle}{reflections}(pt)}
1642 \label{ssub:method_triangle_reflections_pt}
1643
1644 This method returns the three reflections of a point across the sides of the triangle.
1645
1646 \begin{tkzexample}[latex = .5\textwidth]
1647 \directlua{
1648 init_elements()
1649 z.A = point(2, 4)
1650 z.B = point(0, 0)
1651 z.C = point(6, 0)
1652 T.ABC = triangle(z.A, z.B, z.C)
1653 z.P = T.ABC:barycentric(2, 1, 4)
1654 z.P1,
1655 z.P2, z.P3 = T.ABC:reflections(z.P)
1656 }
1657 \begin{center}
1658 \begin{tikzpicture}
1659 \tkzGetNodes
1660 \tkzDrawPolygon(A,B,C)
1661 \tkzDrawSegments[dashed](P,P1 P,P2 P,P3)
1662 \tkzDrawPoints(A,B,C,P1,P2,P3,P)
1663 \tkzLabelPoints(B,C,P1,P)
1664 \tkzLabelPoints[above](P2,A,P3)
1665 \end{tikzpicture}
1666 \end{center}
1667 \end{tkzexample}
1668
1669
1670
1671 \subsubsection{Method \tkzMeth{triangle}{parallelogram()}}
1672 \label{ssub:method_triangle_parallelogram}
1673 Complete a triangle as a parallelogram. If \code{z.D = T.ABC:parallelogram()} then $ABCD$ is a parallelogram.
1674
1675 \subsubsection{Method \tkzMeth{triangle}{mittenpunkt}} %(fold)
1676 \label{ssub:method_triangle_mittenpunkt}
1677
1678 This method returns the \textbf{Mittenpunkt} of the triangle, also known as the \emph{middlespoint}.
1679
1680 \medskip
1681
1682 The Mittenpunkt is defined as the \emph{symmedian point of the excentral triangle}, i.e., the point of intersection of the lines joining each excenter to the midpoint of the corresponding side of the original triangle.
1683
1684 \medskip
1685
1686 It is a notable triangle center, designated as $X_{(9)}$ in Kimberling’s classification.
1687 \begin{flushright}
1688 \small
1689 \href{https://mathworld.wolfram.com/Mittenpunkt.html}{Weisstein, Eric W. "Mittenpunkt." MathWorld.}
1690 \end{flushright}
1691
1692 \vspace{1em}
1693
1694 \begin{minipage}{.5\textwidth}
1695 \directlua{
1696 init_elements()
1697 z.A = point(0, 0)
1698 z.B = point(6, 0)
1699 z.C = point(4, 6)
1700 T.ABC = triangle(z.A, z.B, z.C)
1701 z.Ma,
1702 z.Mb,
1703 z.Mc = T.ABC:medial():get()
1704 z.Ia, z.Ib, z.Ic = T.ABC:excentral():get()
1705 z.Mi = T.ABC:mittenpunkt_point()
1706 T.int = T.ABC:extouch()
1707 z.Ta, z.Tb,
1708 z.Tc = T.int:get()}
1709 \begin{center}
1710 \begin{tikzpicture}[scale=.5]
1711 \tkzGetNodes
1712 \tkzDrawPolygons[](A,B,C Ma,Mb,Mc)
1713 \tkzDrawPoints(Ma,Mb,Mc,Ia,Ib,Ic)
1714 \tkzDrawPoints[red](Ta,Tb,Tc)
1715 \tkzLabelPoints[below](Ib)
1716 \tkzLabelPoints[above left](Ia,Ic)
1717 \tkzClipBB
1718 \tkzDrawLines[add=0 and 1](Ia,Ma Ib,Mb Ic,Mc)
1719 \tkzDrawLines[add=1 and 1](A,B A,C B,C)
1720 \tkzDrawCircles[red](Ia,Ta Ib,Tb Ic,Tc)
1721 \tkzDrawPoints(B,C,A,Mi) %
1722 \tkzLabelPoints(B,A)
1723 \tkzLabelPoints[above](C,Mi)
1724 \end{tikzpicture}
1725 \end{center}
1726 \end{minipage}
1727 \begin{minipage}{.5\textwidth}
1728 \begin{tkzexample}[code only]
1729 \directlua{
1730 init_elements()
1731 z.A = point(0, 0)
1732 z.B = point(6, 0)
1733 z.C = point(4, 6)
1734 T.ABC = triangle(z.A, z.B, z.C)
1735 z.Ma,
1736 z.Mb,
1737 z.Mc = T.ABC:medial():get()
1738 z.Ia, z.Ib, z.Ic = T.ABC:excentral():get()
1739 z.Mi = T.ABC:mittenpunkt_point()
1740 T.int = T.ABC:extouch()
1741 z.Ta, z.Tb,
1742 z.Tc = T.int:get()}
1743 \end{tkzexample}
1744 \end{minipage}
1745
1746 \subsubsection{Method \tkzMeth{triangle}{gergonne\_point()}} %(fold)
1747 \label{ssub:gergonne_point}
1748
1749 This method returns the \textbf{Gergonne point} of the triangle, denoted $X_{(7)}$ in Kimberling’s classification.
1750
1751 \medskip
1752
1753 The Gergonne point is the common point of the lines connecting each vertex of the triangle to the point of contact of the incircle with the opposite side.
1754
1755 \medskip
1756
1757 In this example, the method is often combined with:
1758 \begin{itemize}
1759 \item \tkzMeth{triangle}{intouch} – to get the contact triangle (also called the intouch triangle),
1760 \item \tkzMeth{triangle}{contact} – to retrieve the three contact points individually.
1761 \end{itemize}
1762
1763 \medskip
1764
1765 These contact points are the feet of the perpendiculars from the incenter to each side, i.e., the tangency points of the incircle with the triangle’s sides.
1766 \begin{flushright}
1767 \small
1768 \href{https://mathworld.wolfram.com/GergonnePoint.html}{Weisstein, Eric W. "Gergonne Point." MathWorld.}
1769 \end{flushright}
1770
1771 \vspace{1em}
1772
1773 \begin{minipage}{.5\textwidth}
1774 \directlua{
1775 init_elements()
1776 z.a = point(1,0)
1777 z.b = point(6,2)
1778 z.c = point(2,5)
1779 T.abc = triangle(z.a, z.b, z.c)
1780 z.g = T.abc:gergonne_point()
1781 z.i = T.abc.incenter
1782 z.ta, z.tb, z.tc = T.abc:intouch():get()}
1783 \begin{center}
1784 \begin{tikzpicture}[scale=.8]
1785 \tkzGetNodes
1786 \tkzDrawPolygons(a,b,c)
1787 \tkzDrawSegments(a,ta b,tb c,tc)
1788 \tkzDrawCircle(i,ta)
1789 \tkzDrawPoints(a,b,c,g,ta,tb,tc)
1790 \tkzLabelPoints(a,b,tc)
1791 \tkzLabelPoints[above](c,ta)
1792 \tkzLabelPoints[above left](tb)
1793 \end{tikzpicture}
1794 \end{center}
1795 \end{minipage}
1796 \begin{minipage}{.5\textwidth}
1797 \begin{tkzexample}[code only]
1798 \directlua{
1799 init_elements()
1800 z.a = point(1,0)
1801 z.b = point(6,2)
1802 z.c = point(2,5)
1803 T.abc = triangle(z.a, z.b, z.c)
1804 z.g = T.abc:gergonne_point()
1805 z.i = T.abc.incenter
1806 z.ta, z.tb, z.tc = T.abc:intouch():get()}
1807 \end{tkzexample}
1808 \end{minipage}
1809
1810 \subsubsection{Method \tkzMeth{triangle}{Nagel\_point}} %(fold)
1811 \label{ssub:method_triangle_nagel__point}
1812
1813 Let $E_a$ be the point at which the $J_a$-excircle meets the side $(BC)$ of a triangle $ABC$, and define $E_b$ and $E_c$ similarly. Then the lines $A,E_a$, $B,E_b$ and $C,E_c$ concur in the Nagel point $Na$.
1814
1815 \begin{minipage}{.5\textwidth}
1816 \directlua{
1817 init_elements()
1818 z.A = point(0, 0)
1819 z.B = point(3.6, 0)
1820 z.C = point(2.8, 4)
1821 T.ABC = triangle(z.A, z.B, z.C)
1822 z.Na = T.ABC:nagel_point()
1823 z.J_a, z.J_b,
1824 z.J_c = T.ABC:excentral():get()
1825 z.E_a, z.E_b,
1826 z.E_c = T.ABC:extouch():get()}
1827
1828 \begin{center}
1829 \begin{tikzpicture}[scale = .7]
1830 \tkzGetNodes
1831 \tkzInit[xmin=-1,xmax=7,ymin=-1,ymax=5]
1832 \tkzClip
1833 \tkzDrawPoints(A,B,C)
1834 \tkzDrawPoints[red,size=2](J_a,J_b,J_c)
1835 \tkzClipBB
1836 \tkzDrawLines[add=1.75 and 1.75,teal](A,B A,C B,C)
1837 \tkzDrawCircles(J_a,E_a J_b,E_b J_c,E_c)
1838 \tkzDrawSegments[dashed,gray](J_a,E_a J_b,E_b J_c,E_c)
1839 \tkzDrawSegments[orange](A,E_a B,E_b C,E_c)
1840 \tkzDrawPoints[red,size=2](Na,E_a,E_b,E_c)
1841 \tkzLabelPoints(A,B,Na)
1842 \tkzLabelPoints(E_c,J_a,J_b,J_c)
1843 \tkzLabelPoints[above](E_a,E_b,C)
1844 \end{tikzpicture}
1845 \end{center}
1846 \end{minipage}
1847 \begin{minipage}{.5\textwidth}
1848 \begin{tkzexample}[code only]
1849 \directlua{
1850 init_elements()
1851 z.A = point(0, 0)
1852 z.B = point(3.6, 0)
1853 z.C = point(2.8, 4)
1854 T.ABC = triangle(z.A, z.B, z.C)
1855 z.Na = T.ABC:nagel_point()
1856 z.J_a, z.J_b,
1857 z.J_c = T.ABC:excentral():get()
1858 z.E_a, z.E_b,
1859 z.E_c = T.ABC:extouch():get()}
1860 \end{tkzexample}
1861 \end{minipage}
1862
1863 \subsubsection{Method \tkzMeth{triangle}{feuerbach\_point()}} %(fold)
1864 \label{ssub:method_point_feuerbach}
1865
1866 This method returns the \textbf{Feuerbach point} of the triangle, designated as $X_{(11)}$ in Kimberling’s classification.
1867
1868 \medskip
1869
1870 The Feuerbach point $F$ is the unique point where the triangle’s \emph{incircle} and \emph{nine-point circle} are tangent to each other.
1871
1872 \medskip
1873
1874 In addition, the three \emph{excircles} of the triangle are each tangent to the nine-point circle. These three points of tangency define what is called the \textbf{Feuerbach triangle}, whose vertices are often denoted $F_a$, $F_b$, and $F_c$.
1875
1876 \medskip
1877
1878 This construction reveals a remarkable configuration of internal and external circle tangency with the nine-point circle.
1879 \begin{flushright}
1880 \small
1881 \href{https://mathworld.wolfram.com/FeuerbachPoint.html}{Weisstein, Eric W. "Feuerbach Point." MathWorld.}
1882 \end{flushright}
1883
1884 \vspace{1em}
1885
1886
1887 \vspace{1em}
1888 \begin{minipage}{.5\textwidth}
1889 \directlua{
1890 z.A = point(0, 0)
1891 z.B = point(6, 0)
1892 z.C = point(0.8, 4)
1893 T.ABC = triangle(z.A, z.B, z.C)
1894 z.N = T.ABC.eulercenter
1895 z.Fa, z.Fb,
1896 z.Fc = T.ABC:feuerbach():get()
1897 z.F = T.ABC:feuerbach_point()
1898 z.Ja, z.Jb,
1899 z.Jc = T.ABC:excentral():get()
1900 z.I = T.ABC.incenter}
1901 \begin{tikzpicture}
1902 \tkzGetNodes
1903 \tkzInit[xmin=-1,xmax=7,ymin=-1,ymax=5]
1904 \tkzClip
1905 \tkzDrawPoints(Ja,Jb,Jc)
1906 \tkzFillCircles[green!30,,opacity=.5](N,Fa)
1907 \tkzFillCircles[lightgray,,opacity=.5](I,F)
1908 \tkzDrawLines[add=3 and 3](A,B A,C B,C)
1909 \tkzDrawCircles(Ja,Fa Jb,Fb Jc,Fc N,Fa N,F I,F)
1910 \tkzDrawPoints(A,B,C,F,Fa,Fb,Fc,N)
1911 \tkzLabelPoints(I,N,A,B)
1912 \tkzLabelPoints[above](Fa,Fc,F,I)
1913 \tkzLabelPoints[left](Fb,C)
1914 \end{tikzpicture}
1915 \end{minipage}
1916 \begin{minipage}{.5\textwidth}
1917 \begin{tkzexample}[code only]
1918 \directlua{
1919 z.A = point(0, 0)
1920 z.B = point(6, 0)
1921 z.C = point(0.8, 4)
1922 T.ABC = triangle(z.A, z.B, z.C)
1923 z.N = T.ABC.eulercenter
1924 z.Fa, z.Fb,
1925 z.Fc = T.ABC:feuerbach():get()
1926 z.F = T.ABC:feuerbach_point()
1927 z.Ja, z.Jb,
1928 z.Jc = T.ABC:excentral():get()
1929 z.I = T.ABC.incenter}
1930 \end{tkzexample}
1931 \end{minipage}
1932
1933 \subsubsection{Method \tkzMeth{triangle}{symmedian\_point()}}
1934 \label{ssub:method_triangle_lemoine_point}
1935
1936 This method returns the \textbf{symmedian point} $K$ of the triangle, also known as the \emph{Lemoine point} (in English and French literature) or the \emph{Grebe point} (in German).
1937
1938 \medskip
1939
1940 The symmedian point is the point of concurrence of the triangle’s three \textbf{symmedians}, which are the isogonal conjugates of the medians. In other words, $K$ is the \textbf{isogonal conjugate} of the centroid $G$.
1941
1942 \medskip
1943
1944 You can also use the aliases \code{lemoine\_point} or \code{grebe\_point} to call this method.
1945
1946 \medskip
1947
1948 A beautiful geometric property of the Lemoine point is the following:
1949 \textit{The antiparallels to the triangle’s sides passing through the symmedian point intersect the sides in six points that all lie on a same circle} — this is known as the \textbf{first Lemoine circle}.
1950 \begin{flushright}
1951 \small
1952 \href{https://mathworld.wolfram.com/SymmedianPoint.html}{Weisstein, Eric W. "Symmedian Point." MathWorld.}
1953 \end{flushright}
1954 \label{sub:antiparallel_through_lemoine_point}
1955
1956 \vspace{1em}
1957 \begin{minipage}{.5\textwidth}
1958 \directlua{
1959 init_elements()
1960 z.a = point(0, 0)
1961 z.b = point(5, 0)
1962 z.c = point(1, 4)
1963 T.abc = triangle(z.a, z.b, z.c)
1964 z.L = T.abc:lemoine_point()
1965 L.anti = T.abc:antiparallel(z.L, 0)
1966 z.x_0, z.x_1 =L.anti:get()
1967 L.anti = T.abc:antiparallel(z.L, 1)
1968 z.y_0, z.y_1 = L.anti:get()
1969 L.anti = T.abc:antiparallel(z.L, 2)
1970 z.z_0, z.z_1 = L.anti:get()}
1971 \begin{center}
1972 \begin{tikzpicture}
1973 \tkzGetNodes
1974 \tkzDrawPolygons(a,b,c)
1975 \tkzDrawPoints(a,b,c,L,x_0,x_1,y_0,y_1,z_0,z_1)
1976 \tkzLabelPoints(a,b)
1977 \tkzLabelPoints[above](L,c)
1978 \tkzDrawSegments(x_0,x_1 y_0,y_1 z_0,z_1)
1979 \tkzDrawCircle(L,x_0)
1980 \end{tikzpicture}
1981 \end{center}
1982 \end{minipage}
1983 \begin{minipage}{.5\textwidth}
1984 \begin{tkzexample}[code only]
1985 \directlua{
1986 init_elements()
1987 z.a = point(0, 0)
1988 z.b = point(5, 0)
1989 z.c = point(1, 4)
1990 T.abc = triangle(z.a, z.b, z.c)
1991 z.L = T.abc:lemoine_point()
1992 L.anti = T.abc:antiparallel(z.L, 0)
1993 z.x_0, z.x_1 =L.anti:get()
1994 L.anti = T.abc:antiparallel(z.L, 1)
1995 z.y_0, z.y_1 = L.anti:get()
1996 L.anti = T.abc:antiparallel(z.L, 2)
1997 z.z_0, z.z_1 = L.anti:get()}
1998 \end{tkzexample}
1999 \end{minipage}
2000
2001 \subsubsection{Method \tkzMeth{triangle}{spieker\_center}}
2002 \label{ssub:method_triangle_spieker_center}
2003
2004 This method returns the \textbf{Spieker center} of the triangle, denoted $X_{(10)}$ in Kimberling’s classification.
2005
2006 \medskip
2007
2008 The Spieker center $S_p$ is the \textbf{incenter of the medial triangle} of the reference triangle $ABC$. It is also the center of the \emph{Spieker circle}, which is the incircle of that medial triangle.
2009
2010 \medskip
2011
2012 An important property is that the Spieker center is also the \textbf{center of the radical circle} of the triangle’s three \emph{excircles}. This makes it a key point in both classical triangle geometry and circle configurations.
2013 \begin{flushright}
2014 \small
2015 \href{https://mathworld.wolfram.com/SpiekerCircle.html}{Weisstein, Eric W. "Spieker Circle." MathWorld.}
2016 \end{flushright}
2017
2018 \vspace{1em}
2019
2020 \begin{tkzexample}[latex=.5\textwidth]
2021 \directlua{
2022 z.A = point (0, 0)
2023 z.B = point (5, -0.5)
2024 z.C = point (2.2, 5)
2025 T.ABC = triangle(z.A, z.B, z.C)
2026 z.S = T.ABC:spieker_center()
2027 T.m = T.ABC:medial()
2028 z.ma, z.mb, z.mc = T.m:get()
2029 z.w = T.m.ab:projection(z.S)}
2030 \begin{tikzpicture}
2031 \tkzGetNodes
2032 \tkzDrawPolygons(A,B,C ma,mb,mc)
2033 \tkzDrawCircles[red](S,w)
2034 \tkzDrawPoints(A,B,C,S,ma,mb,mc)
2035 \tkzLabelPoints(A,B,S,mc)
2036 \tkzLabelPoints[above](C,w)
2037 \tkzLabelPoints[right](ma)
2038 \tkzLabelPoints[left](mb)
2039 \end{tikzpicture}
2040 \end{tkzexample}
2041
2042 \subsubsection{Method \tkzMeth{triangle}{euler\_points}} %(fold)
2043 \label{ssub:method_triangle_euler__points}
2044
2045 The points $a$, $b$ and $c$ are the Euler points. They are the midpoints of the segments $AH$, $BH$ and $CH$.
2046
2047 \begin{minipage}{.5\textwidth}
2048 \directlua{
2049 init_elements()
2050 z.A = point(0, 0)
2051 z.B = point(5, 0)
2052 z.C = point(1, 4)
2053 T.ABC = triangle(z.A, z.B, z.C)
2054 z.N = T.ABC.eulercenter
2055 z.a,
2056 z.b,
2057 z.c = T.ABC:euler():get()
2058 z.H = T.ABC.orthocenter
2059 T.orthic = T.ABC:orthic()
2060 z.Ha,
2061 z.Hb,
2062 z.Hc = T.orthic:get()}
2063 \begin{center}
2064 \begin{tikzpicture}[scale = 1.25]
2065 \tkzGetNodes
2066 \tkzDrawPolygons[red](A,B,C)
2067 \tkzDrawPolygons[cyan](a,b,c)
2068 \tkzDrawCircle[purple](N,a)
2069 \tkzDrawPoints(a,b,B,C,A,c,H)
2070 \tkzDrawSegments[red](C,Hc B,Hb A,Ha)
2071 \tkzLabelPoints(A,B,a,b,H)
2072 \tkzLabelPoints[above](c,C)
2073 \end{tikzpicture}
2074 \end{center}
2075 \end{minipage}
2076 \begin{minipage}{.5\textwidth}
2077 \begin{tkzexample}[code only]
2078 \directlua{
2079 init_elements()
2080 z.A = point(0, 0)
2081 z.B = point(5, 0)
2082 z.C = point(1, 4)
2083 T.ABC = triangle(z.A, z.B, z.C)
2084 z.N = T.ABC.eulercenter
2085 z.a,
2086 z.b,
2087 z.c = T.ABC:euler():get()
2088 z.H = T.ABC.orthocenter
2089 T.orthic = T.ABC:orthic()
2090 z.Ha,
2091 z.Hb,
2092 z.Hc = T.orthic:get()}
2093 \end{tkzexample}
2094 \end{minipage}
2095
2096 \subsubsection{Method \tkzMeth{triangle}{nine\_points}} %(fold)
2097 \label{ssub:method_triangle_nine__points}
2098
2099 This method returns the \textbf{nine classical points} that lie on the Euler circle (also called the nine-point circle) of a triangle.
2100
2101 \medskip
2102
2103 The returned points, in order, are:
2104 \begin{itemize}
2105 \item the three midpoints of the sides of the triangle,
2106 \item the three feet of the altitudes,
2107 \item the three Euler points (i.e., the midpoints between each vertex and the orthocenter).
2108 \end{itemize}
2109
2110 \medskip
2111
2112 These nine points lie on the same circle, whose center is the midpoint of the segment joining the orthocenter to the circumcenter.
2113
2114 \medskip
2115
2116 In the next example, we also compute the centroid (center of gravity) in two different ways:
2117 \begin{itemize}
2118 \item using the \code{trilinear} method with coordinates $(1:1:1)$,
2119 \item using the \code{barycentric} method with weights $(1,1,1)$.
2120 \end{itemize}
2121
2122 \vspace{1em}
2123
2124 \begin{minipage}{.5\textwidth}
2125 \directlua{
2126 init_elements()
2127 z.A = point(0 ,0)
2128 z.B = point(5, 0)
2129 z.C = point(1, 4)
2130 T.ABC = triangle(z.A, z.B, z.C)
2131 z.N = T.ABC.eulercenter
2132 z.e1,
2133 z.e2,
2134 z.e3,
2135 z.e4,
2136 z.e5,
2137 z.e6,
2138 z.e7,
2139 z.e8,
2140 z.e9 = T.ABC:nine_points()
2141 }
2142 \begin{center}
2143 \begin{tikzpicture}[ scale = 1]
2144 \tkzGetNodes
2145 \tkzDrawPolygons[red](A,B,C)
2146 \tkzDrawCircle[purple](N,e1)
2147 \tkzDrawPoints(e1,e2,e3,e4,e5,e6,e7,e8,e9)
2148 \tkzLabelPoints(e1,e2,e3,e4,e5,e6,e7,e8,e9)
2149 \end{tikzpicture}
2150 \end{center}
2151 \end{minipage}
2152 \begin{minipage}{.5\textwidth}
2153 \begin{tkzexample}[code only]
2154 \directlua{
2155 init_elements()
2156 z.A = point(0 ,0)
2157 z.B = point(5, 0)
2158 z.C = point(1, 4)
2159 T.ABC = triangle(z.A, z.B, z.C)
2160 z.N = T.ABC.eulercenter
2161 z.e1,
2162 z.e2,
2163 z.e3,
2164 z.e4,
2165 z.e5,
2166 z.e6,
2167 z.e7,
2168 z.e8,
2169 z.e9 = T.ABC:nine_points()}
2170 \end{tkzexample}
2171 \end{minipage}
2172
2173 \subsubsection{Method \tkzMeth{triangle}{soddy\_center}}
2174 \label{ssub:method_triangle_soddy_center}
2175
2176 This method returns the \textbf{Soddy center} of the triangle.
2177
2178 \medskip
2179
2180 Given three mutually tangent circles (typically the triangle’s three \emph{inner Apollonius circles} centered at each vertex), there exist exactly two non-intersecting circles that are tangent to all three. These are called the \emph{inner} and \emph{outer Soddy circles}, and their respective centers are called the \textbf{inner} and \textbf{outer Soddy centers}.
2181
2182 \medskip
2183
2184 By default, the method returns the \emph{inner} Soddy center. A keyword option such as \code{"outer"} may be used to retrieve the second one, if implemented.
2185
2186 \medskip
2187
2188 See section~\ref{ssub:method_triangle_euler_circle} for details about the associated Soddy circles.
2189
2190 \vspace{1em}
2191
2192 \vspace{1em}
2193 \begin{minipage}{.5\textwidth}
2194 \directlua{
2195 init_elements()
2196 z.A = point(0, 0)
2197 z.B = point(4, 0.5)
2198 z.C = point(1, 3)
2199 T.ABC = triangle(z.A, z.B, z.C)
2200 z.S = T.ABC:soddy_center()
2201 }
2202 \begin{tikzpicture}
2203 \tkzGetNodes
2204 \tkzDrawPolygon(A,B,C)
2205 \tkzDrawPoints(A,B,C,S)
2206 \tkzLabelPoints(A,B,S)
2207 \tkzLabelPoints[above](C)
2208 \end{tikzpicture}
2209 \end{minipage}
2210 \begin{minipage}{.5\textwidth}
2211 \begin{tkzexample}[code only]
2212 \directlua{
2213 init_elements()
2214 z.A = point(0, 0)
2215 z.B = point(4, 0.5)
2216 z.C = point(1, 3)
2217 T.ABC = triangle(z.A, z.B, z.C)
2218 z.S = T.ABC:soddy_center()}
2219 \end{tkzexample}
2220 \end{minipage}
2221
2222 \subsubsection{Method \tkzMeth{triangle}{conway\_points()}}
2223 \label{ssub:method_triangle_conway_points}
2224
2225 This method returns the six points defined in \textbf{Conway’s circle theorem}.
2226
2227 \medskip
2228
2229 The Conway circle theorem states the following:
2230
2231 \begin{quote}
2232 If the sides meeting at each vertex of a triangle are extended by the length of the opposite side, the six endpoints of the resulting three segments all lie on a common circle. This circle is called the \textbf{Conway circle} of the triangle, and its center is the \textbf{incenter} of the triangle.
2233 \end{quote}
2234
2235 \medskip
2236
2237 The six returned points can then be used to draw this Conway circle and to verify its geometric properties.
2238
2239 \medskip
2240
2241 See the corresponding figure in section~\ref{ssub:method_triangle_conway} for a complete illustration.
2242 \begin{flushright}
2243 \small
2244 \href{https://en.wikipedia.org/wiki/Conway_circle_theorem}{Wikipedia – Conway circle theorem}
2245 \end{flushright}
2246
2247 \vspace{1em}
2248
2249 \begin{mybox}
2250 \begin{tkzexample}[code only]
2251 C.conway = T.ABC:conway_circle()
2252 z.w,z.t = C.conway:get() % % z.w = T.ABC : conway_center ()
2253 z.t1, z.t2, z.t3, z.t4, z.t5, z.t6 = T.ABC: onway_points()
2254 \end{tkzexample}
2255 \end{mybox}
2256
2257 \subsubsection{Method \tkzMeth{triangle}{first\_fermat\_point()}}
2258 \label{ssub:method_triangle_first_fermat_point}
2259 In a given triangle $ABC$ with all angles less than 120 degrees (2pi/3), the first Fermat point is the point which minimizes the sum of distances from A, B, and C.
2260
2261
2262 \begin{tkzexample}[latex=.5\textwidth]
2263 \directlua{
2264 z.A = point(1, 2)
2265 z.B = point(5, 1)
2266 z.C = point(2.5, 4)
2267 T.ABC = triangle(z.A, z.B, z.C)
2268 z.F1 = T.ABC:first_fermat_point()
2269 _,_,z.E = T.ABC.bc:equilateral("swap"):get()
2270 _,_,z.F = T.ABC.ca:equilateral("swap"):get()
2271 _,_,z.G = T.ABC.ab:equilateral("swap"):get()}
2272 \begin{tikzpicture}
2273 \tkzGetNodes
2274 \tkzDrawPolygon(A,B,C)
2275 \tkzDrawSegments[dashed](B,E E,C C,F F,A)
2276 \tkzDrawSegments[dashed](A,G G,B)
2277 \tkzDrawSegments[dashed,red](A,E B,F C,G)
2278 \tkzDrawPoints(A,B,C,F1,E,F,G)
2279 \tkzLabelPoints[right](B,F1)
2280 \tkzLabelPoints[above](C,E,G)
2281 \tkzLabelPoints(A,F)
2282 \end{tikzpicture}
2283 \end{tkzexample}
2284
2285 \subsubsection{Method \tkzMeth{triangle}{second\_fermat\_point()}}
2286 \label{ssub:method_triangle_second__fermat__point}
2287 See [\ref{ssub:method_triangle_fermat__axis}]
2288 ]
2289
2290 \subsubsection{Method \tkzMeth{triangle}{kenmotu\_point()}}
2291 \label{ssub:_triangle_kenmotu__point}
2292
2293 This method returns the \textbf{Kenmotu point} of the triangle, also known as the \emph{congruent squares point}. It is listed as $X_{(371)}$ in Kimberling’s classification.
2294
2295 \medskip
2296
2297 The Kenmotu point is the unique point where three equal squares, each inscribed in the triangle and touching two sides, intersect at a single common point. Each square is constructed so that it fits snugly between two adjacent triangle sides.
2298
2299 \medskip
2300
2301 This triangle center is remarkable for its connection to equal-area geometric constructions and is defined purely by square congruence and tangency conditions.
2302
2303 \medskip
2304
2305 See the illustration in section~\ref{ssub:kenmotu_circle} for a visual representation of the configuration.
2306 \begin{flushright}
2307 \small
2308 \href{https://mathworld.wolfram.com/KenmotuPoint.html}{Weisstein, Eric W. "Kenmotu Point." MathWorld}
2309 \end{flushright}
2310
2311 \subsubsection{Method \tkzMeth{triangle}{adams\_points()}}
2312 \label{ssub:method_triangle_adams_points}
2313 Given a triangle $ABC$, construct the \code{contact} triangle $T_AT_BT_C$. Now extend lines parallel to the sides of the contact triangle from the \code{Gergonne} point. These intersect the triangle $ABC$ in the six points $P, Q, R, S, T$, and $U$. \code{C. Adams} proved in 1843 that these points are concyclic in a circle now known as the Adams' circle.
2314 \begin{flushright}
2315 \small
2316 \href{ https://mathworld.wolfram.com/AdamsCircle.html}{Weisstein, Eric W. "Adams' Circle." From MathWorld--A Wolfram Web Resource.}
2317 \end{flushright}
2318
2319 \subsubsection{Method \tkzMeth{triangle}{macbeath\_point}}
2320 \label{ssub:method_triangle_macbeath_point}
2321 The MacBeath point is the center of the cercle kimberling(264).
2322
2323 \begin{tkzexample}[latex=.5\textwidth]
2324 \directlua{
2325 init_elements()
2326 z.A = point(.5, 3)
2327 z.B = point(0, 0)
2328 z.C = point(5, 0)
2329 T.ABC = triangle(z.A, z.B, z.C)
2330 z.MB = T.ABC:macbeath_point()
2331 z.Xa, z.Xb,
2332 z.Xc = T.ABC:macbeath():get()}
2333 \begin{tikzpicture}
2334 \tkzGetNodes
2335 \tkzDrawPolygons(A,B,C Xa,Xb,Xc)
2336 \tkzDrawSegments(A,Xa B,Xb C,Xc)
2337 \tkzDrawPoints(A,B,C,MB,Xa,Xb,Xc)
2338 \tkzLabelPoints(B,C,MB)
2339 \tkzLabelPoints[above](A)
2340 \end{tikzpicture}
2341 \end{tkzexample}
2342
2343 \subsubsection{Method \tkzMeth{triangle}{poncelet\_point}(p)}
2344 \label{ssub:method_triangle_poncelet_point}
2345
2346 If the three vertices and the $p$ point do not form a orthocentric system et no three of them are collinear. The nine-point circles of the four triangles obtained with three of the four points have one thing in common, called \tkzname{Poncelet} point.
2347
2348 \begin{tkzexample}[latex=.5\textwidth]
2349 \directlua{
2350 init_elements()
2351 z.A = point(1, 1)
2352 z.B = point(6, 0)
2353 z.C = point(0, 5)
2354 z.X = point(2, 2)
2355 T.ABC = triangle(z.A, z.B, z.C)
2356 z.P = T.ABC:poncelet_point(z.X)
2357 z.I = T.ABC.eulercenter
2358 z.Ma, z.Mb, z.Mc = T.ABC:medial():get()
2359 T.ABX = triangle(z.A, z.B, z.X)
2360 z.I1 = T.ABX.eulercenter}
2361 \begin{center}
2362 \begin{tikzpicture}
2363 \tkzGetNodes
2364 \tkzDrawPolygons(A,B,C)
2365 \tkzDrawPoints(A,B,C,X,P)
2366 \tkzDrawCircles[red](I,Ma I1,Mc)
2367 \tkzLabelPoints(A,B)
2368 \tkzLabelPoints[above](C,X,P)
2369 \end{tikzpicture}
2370 \end{center}
2371 \end{tkzexample}
2372
2373 \subsubsection{Method \tkzMeth{triangle}{orthopole}}
2374 \label{ssub:method_triangle_orthopole}
2375
2376 For the definition and some properties, please refer to:
2377 \begin{flushright}
2378 \small
2379 \href{ https://mathworld.wolfram.com/Orthopole.html}{Weisstein, Eric W. "Orthopole." From MathWorld--A Wolfram Web Resource.}
2380 \end{flushright}
2381
2382 See the following example for the link between orthopole and Simson line: (An example x
2383 can be found in the document \tkzname{Euclidean Geometry} presented in \href{http://altermundus.fr}{altermundus.fr}.)
2384
2385 \begin{tkzexample}[latex=.5\textwidth]
2386 \directlua{
2387 init_elements()
2388 z.A = point(0, 0)
2389 z.B = point(5, 0)
2390 z.C = point(1, 4)
2391 T.ABC = triangle(z.A, z.B, z.C)
2392 z.N = T.ABC.eulercenter
2393 z.H = T.ABC.orthocenter
2394 L.NH = line(z.N, z.H)
2395 z.P = T.ABC:orthopole(L.NH)
2396 }
2397 \begin{center}
2398 \begin{tikzpicture}
2399 \tkzGetNodes
2400 \tkzDrawPolygons[cyan](A,B,C)
2401 \tkzDrawLine[purple,add = 2 and 2](N,H)
2402 \tkzDrawPoints(A,B,C,N,H,P)
2403 \tkzLabelPoints(A,B,H,N)
2404 \tkzLabelPoints[above](C,P)
2405 \end{tikzpicture}
2406 \end{center}
2407 \end{tkzexample}
2408
2409 \subsubsection{Method \tkzMeth{triangle}{isodynamic\_points()}}
2410 \label{ssub:isodynamic_points}
2411
2412 This method computes the two isodynamic points of a non-degenerate triangle.
2413
2414 \medskip
2415
2416 \texttt{Geometric background: }
2417 Given a triangle $ABC$, consider the three Apollonius circles associated with its sides:
2418 \[
2419 \mathcal{A}_{a},\quad \mathcal{A}_{b},\quad \mathcal{A}_{c},
2420 \]
2421 each defined as the locus of points $M$ satisfying a ratio of distances
2422 corresponding to the opposite sides.
2423
2424 A classical and fundamental property states that:
2425
2426 \begin{quote}
2427 \emph{The three Apollonius circles intersect in exactly two points.
2428 These intersections are the first and second isodynamic points of the triangle.}
2429 \end{quote}
2430
2431 The first isodynamic point is symmetric to the second by reflection in the
2432 circumcenter. Both points are isogonal conjugates of the Fermat points.
2433
2434 \medskip
2435
2436 \texttt{Description: }
2437 The method \code{isodynamic\_points()} returns the two common intersection points of the Applonius circles.
2438
2439 \medskip
2440 \texttt{Return values: }
2441 \begin{itemize}
2442 \item \code{S1} — the first isodynamic point,
2443 \item \code{S2} — the second isodynamic point.
2444 \end{itemize}
2445
2446 \medskip
2447 \texttt{Example: }
2448 \begin{verbatim}
2449 S1, S2 = T.ABC:isodynamic_points()
2450 \end{verbatim}
2451
2452 Each point can then be used like any other \code{point} object in subsequent constructions.
2453
2454 \medskip
2455 \texttt{Application: }
2456
2457 \begin{tkzexample}[vbox]
2458 \directlua{%
2459 z.A = point (0, 0)
2460 z.B = point (5, 0)
2461 z.C = point (3.5, 2)
2462 T.ABC = triangle (z.A, z.B, z.C)
2463 C.ab, C.bc,
2464 C.ca = T.ABC:three_apollonius_circles()
2465 z.w1, z.t1 = C.ab:get()
2466 z.w2, z.t2 = C.bc:get()
2467 z.w3, z.t3 = C.ca:get()
2468 z.S, z.Sp = T.ABC:isodynamic_points()
2469 }
2470 \begin{center}
2471 \begin{tikzpicture}[scale=.5]
2472 \tkzGetNodes
2473 \tkzDrawLines[add = 1.5 and 1.5,
2474 dashed](A,B B,C C,A)
2475 \tkzDrawPolygons(A,B,C)
2476 \tkzDrawCircle[purple](O,A)
2477 \tkzDrawCircles[cyan](w1,t1 w2,t2 w3,t3)
2478 \tkzDrawLines[purple](w1,w2)
2479 \tkzDrawPoints(A,B,C,w1,w2,w3,S,S')
2480 \tkzLabelPoints(A,B,w1,w2,w3)
2481 \tkzLabelPoints[above](C,S,S')
2482 \end{tikzpicture}
2483 \end{center}
2484 \end{tkzexample}
2485
2486
2487 \subsubsection{Method \tkzMeth{triangle}{apollonius\_points(side)}}
2488 \label{ssub:apollonius_points}
2489
2490 This method returns the two Apollonius division points associated with a
2491 specified side of the triangle.
2492
2493 \medskip
2494
2495 \paragraph{Description.}
2496 Given a triangle $ABC$ and a chosen side:
2497
2498 \begin{itemize}
2499 \item \code{"ab"} — side $AB$, ratio defined by the opposite side $c = AB$,
2500 \item \code{"bc"} — side $BC$, ratio defined by the opposite side $a = BC$,
2501 \item \code{"ca"} — side $CA$, ratio defined by the opposite side $b = CA$,
2502 \end{itemize}
2503
2504 the method returns the two
2505 points that divide the chosen side internally and externally according to the
2506 ratio of the adjacent sides.
2507
2508 \medskip
2509 \texttt{Return values: }
2510 Two points:
2511 \begin{itemize}
2512 \item \code{P\_int} — internal division point on the chosen side,
2513 \item \code{P\_ext} — external division point on the chosen side.
2514 \end{itemize}
2515
2516 \medskip
2517
2518 \texttt{Example: }
2519 \begin{verbatim}
2520 Pin, Pex = T.ABC:apollonius_points("ab")
2521 \end{verbatim}
2522
2523 The returned objects are standard \code{point} instances usable in further
2524 constructions.
2525
2526 \texttt{Application: } See [\ref{ssub:apollonius_circle}]
2527
2528
2529 \subsubsection{Method \tkzMeth{triangle}{apollonius\_point()}}
2530 \label{ssub:apollonius_point}
2531
2532 This method should not be confused with the previous one.
2533
2534 Consider the excircles $J_A$, $J_B$, and $J_C$ of a triangle, and the external Apollonius circle tangent externally to all three. Denote the contact point by $xa$, $xb$ and $xc$, etc. Then the lines $Axa$, $Bxb$, and $Cxc$ concur in a point known as the Apollonius point. This point is Kimberling center $X_(181)$ (Kimberling 1998, p. 102).
2535
2536 \begin{flushright}
2537 \small
2538 \href{https://mathworld.wolfram.com/ApolloniusPoint.html}{\textit{(Reference: Weisstein, Eric W. "Apollonius Point." MathWorld)}}
2539 \end{flushright}
2540
2541
2542 \subsubsection{Method \tkzMeth{triangle}{cevian\_point()}}
2543 \label{ssub:cevian_point}
2544
2545 \texttt{Usage: }
2546
2547 \begin{verbatim}
2548 triangle:cevian_point(p,q,eps)
2549 \end{verbatim}
2550
2551 \medskip
2552
2553 \texttt{Arguments: }
2554
2555 p: First point defining the cevian configuration \\
2556 q: Second point defining the cevian configuration \\
2557 eps: Optional numerical tolerance \\
2558
2559
2560 \medskip
2561
2562 This method computes a cevian point associated with the current triangle from
2563 the points \texttt{p} and \texttt{q}. It also determines the three feet of the
2564 corresponding cevians on the sides of the triangle.
2565
2566 The optional parameter \texttt{eps} is used as a numerical tolerance in the
2567 internal tests and comparisons.
2568
2569 \medskip
2570
2571 \texttt{Returns: }
2572
2573 Four points: the cevian point and the three feet of its cevians on the sides
2574 $BC$, $CA$, and $AB$.
2575
2576
2577 \begin{tkzexample}[latex=.5\textwidth]
2578 \directlua{
2579 init_elements()
2580 z.A = point(1, 5)
2581 z.B = point(0, 0)
2582 z.C = point(6, 0)
2583 T.ABC = triangle(z.A, z.B, z.C)
2584 z.P = T.ABC.ab:point(0.4)
2585 z.Q = T.ABC.ca:point(0.6)
2586 z.X, z.D,
2587 z.E, z.F = T.ABC:cevian_point(z.P, z.Q)
2588 }
2589 \begin{center}
2590 \begin{tikzpicture}
2591 \tkzGetNodes
2592 \tkzDrawPolygon(A,B,C)
2593 \tkzDrawSegments(A,D B,E C,F)
2594 \tkzDrawPoints(A,B,C,D,E,F,X)
2595 \end{tikzpicture}
2596 \end{center}
2597 \end{tkzexample}
2598
2599
2600
2601 \subsubsection{Method \tkzMeth{triangle}{complement(pt)}}
2602 \label{ssub:complement}
2603
2604 Let $ABC$ be a non-degenerate triangle with centroid $G$.
2605
2606 \paragraph{Definition.}
2607 The complement of a point $P$ with respect to triangle $ABC$ is the point $\mathcal{K}(P)$ defined as the image of $P$ under the homothety centered at $G$ with ratio $-\dfrac{1}{2}$:
2608
2609 \[
2610 \mathcal{K}(P)=\mathcal{H}_{(G,-\frac{1}{2})}(P).
2611 \]
2612
2613 Equivalently,
2614 \[
2615 \overrightarrow{G\mathcal{K}(P)}=-\dfrac{1}{2}\overrightarrow{GP},
2616 \]
2617 so that $G$ is the midpoint of the segment $[P\,\mathcal{K}(P)]$.
2618
2619 \paragraph{Properties.}
2620 \begin{itemize}
2621 \item The complement is an affine transformation.
2622 \item $\mathcal{K}(G)=G$.
2623 \item The complement of the orthocenter is the nine-point center.
2624 \item The complement of the Nagel point is the Spieker point.
2625 \end{itemize}
2626
2627
2628 \texttt{Remark: }
2629 The complement frequently appears in triangle geometry in relation with affine constructions and triangle centers.
2630
2631 \subsubsection{Method \tkzMeth{triangle}{anticomplement(pt)}}
2632 \label{ssub:anticomplement}
2633
2634 Let $ABC$ be a non-degenerate triangle with centroid $G$.
2635
2636 \texttt{Definition: }
2637 The anticomplement of a point $P$ is defined as the image of $P$ under the homothety centered at $G$ with ratio $-2$:
2638
2639 \[
2640 \mathcal{K}^{-1}(P)=\mathcal{H}_{(G,-2)}(P).
2641 \]
2642
2643 Equivalently,
2644 \[
2645 \overrightarrow{G\mathcal{K}^{-1}(P)}=-2\overrightarrow{GP}.
2646 \]
2647
2648 \texttt{Properties: }
2649 \begin{itemize}
2650 \item The anticomplement is the inverse of the complement transformation.
2651 \item $G$ is fixed.
2652 \item The anticomplement of the nine-point center is the orthocenter.
2653 \item The anticomplement of the Spieker point is the Nagel point.
2654 \end{itemize}
2655
2656 \texttt{Implementation in \tkzname{elements}: }
2657
2658
2659 \texttt{Remark: }
2660 The anticomplement is useful when moving from affine constructions back to classical triangle centers.
2661
2662
2663 \subsubsection{Method \tkzMeth{triangle}{isotomic(pt)}}
2664 \label{ssub:isotomic}
2665
2666
2667 Let $ABC$ be a non-degenerate triangle and let $P$ be a point not lying on its sides.
2668
2669 \texttt{Definition: }
2670 Let $D,E,F$ be the intersections of $AP,BP,CP$ with $BC,CA,AB$.
2671 Let $D',E',F'$ be the points on the same sides such that
2672
2673 \[
2674 BD'=DC,\quad CE'=EA,\quad AF'=FB.
2675 \]
2676
2677 The cevians $AD',BE',CF'$ concur at a point called the isotomic conjugate of $P$, denoted $P^{\mathrm{iso}}$.
2678
2679 \texttt{Barycentric form: }
2680 If $P=(x:y:z)$ in barycentric coordinates, then
2681
2682 \[
2683 P^{\mathrm{iso}}=(1/x:1/y:1/z).
2684 \]
2685
2686 \texttt{Properties: }
2687 \begin{itemize}
2688 \item Isotomic conjugation is an involution:
2689 \[
2690 (P^{\mathrm{iso}})^{\mathrm{iso}}=P.
2691 \]
2692 \item The centroid is self-isotomic.
2693 \item The isotomic conjugate of the Gergonne point is the Nagel point.
2694 \end{itemize}
2695
2696
2697 \texttt{Remark: }
2698 Unlike complement and anticomplement, isotomic conjugation is a projective transformation rather than an affine one.
2699 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2700 %%%%%%%%%%% Lines %%%%%%%%%%%
2701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2702
2703 \subsection{Returns a line}
2704 \subsubsection{Method \tkzMeth{triangle}{symmedian\_line(n)}}
2705 \label{ssub:method_imeth_triangle_symmedian__line}
2706
2707 This method returns one of the \textbf{symmedians} of the triangle.
2708
2709 \medskip
2710
2711 The lines $AL_a$, $BL_b$, and $CL_c$, which are the isogonal conjugates of the medians $AM_a$, $BM_b$, and $CM_c$, are called the triangle’s \textbf{symmedians}. These lines concur at a point $L$, known as the \textbf{Lemoine point} or \textbf{symmedian point}. It is the isogonal conjugate of the centroid $G$.
2712
2713 \medskip
2714
2715 The triangle $L_aL_bL_c$, formed by the intersections of the symmedians with the sides of the triangle $ABC$, is called the \textbf{symmedial triangle}. The circle circumscribed about this triangle is known as the \textbf{symmedial circle}.
2716
2717 \medskip
2718
2719 To obtain:
2720 \begin{itemize}
2721 \item all three symmedians, use the method \code{symmedian()};
2722 \item the point of concurrency, use \code{symmedian\_point()} or \code{lemoine\_point()};
2723 \item only one symmedian, use \code{symmedian\_line(n)} with \(n=0\), \(1\), or \(2\), corresponding respectively to the vertices $A$, $B$, or $C$.
2724 \end{itemize}
2725
2726 \medskip
2727
2728 In the following example, the point $L$ is the Lemoine point, and the triangle $L_aL_bL_c$ is the symmedial triangle.
2729 \begin{flushright}
2730 \small
2731 \href{https://mathworld.wolfram.com/SymmedianPoint.html}{Weisstein, Eric W. "Symmedian Point." MathWorld.}
2732 \end{flushright}
2733
2734 \vspace{1em}
2735
2736 \begin{minipage}{.55\textwidth}
2737 \directlua{
2738 init_elements()
2739 z.A = point(0, 0)
2740 z.B = point(7, -1)
2741 z.C = point(2.6, 3)
2742 T.ABC = triangle(z.A, z.B, z.C)
2743 z.L = T.ABC:lemoine_point()
2744 T.SY = T.ABC:symmedial()
2745 T.med = T.ABC:medial()
2746 z.La, z.Lb, z.Lc = T.SY:get()
2747 z.Ma, z.Mb, z.Mc = T.med:get()
2748 L.Lb = T.ABC:symmedian_line(1)
2749 _, z.Lb = L.Lb:get()
2750 z.G = T.ABC.centroid
2751 z.Ia, z.Ib, z.Ic = T.ABC:incentral():get()
2752 z.I = T.ABC.incenter
2753 }
2754 \begin{center}
2755 \begin{tikzpicture}[scale =1,font=\small]
2756 \tkzGetNodes
2757 \tkzDrawPolygons(A,B,C)
2758 \tkzDrawPoints(A,B,C,L,La,Lb,Lc,G,Ma,Mb,Mc,Ia,Ib,Ic,I)
2759 \tkzDrawSegments[cyan](A,La B,Lb C,Lc)
2760 \tkzDrawSegments[green](A,Ma B,Mb C,Mc)
2761 \tkzDrawSegments[dashed,red](A,Ia B,Ib C,Ic)
2762 \tkzLabelPoints[above](C,La,Ia,Ma)
2763 \tkzLabelPoints[above=4pt](Lb)
2764 \tkzLabelPoints[above left=1pt](Ib)
2765 \tkzLabelPoints[left](Mb)
2766 \tkzLabelPoints(A,B,L,Lc,I,Ic,Mc,G)
2767 \end{tikzpicture}
2768 \end{center}
2769 \end{minipage}
2770 \begin{minipage}{.45\textwidth}
2771 \begin{tkzexample}[code only]
2772 \directlua{
2773 init_elements()
2774 z.A = point(0, 0)
2775 z.B = point(6, 0)
2776 z.C = point(2.4, 1.8)
2777 T.ABC = triangle(z.A, z.B, z.C)
2778 z.L = T.ABC:lemoine_point()
2779 T.SY = T.ABC:symmedian()
2780 T.med = T.ABC:medial()
2781 z.Ka, z.Kb, z.Kc = T.SY:get()
2782 z.Ma, z.Mb, z.Mc = T.med:get()
2783 L.Kb = T.ABC:symmedian_line(1)
2784 _, z.Kb = L.Kb:get()
2785 z.G = T.ABC.centroid
2786 z.Ia, z.Ib,
2787 z.Ic = T.ABC:incentral():get()
2788 z.I = T.ABC.incenter}
2789 \end{tkzexample}
2790 \end{minipage}
2791
2792 \subsubsection{Method \tkzMeth{triangle}{altitude(arg)}} %(fold)
2793 \label{ssub:method_triangle_altitude}
2794
2795 This method returns one of the \textbf{altitudes} of a triangle.
2796
2797 \medskip
2798 There are multiple ways to access altitudes:
2799 \begin{itemize}
2800 \item \tkzMeth{triangle}{orthic} returns the \textbf{orthic triangle}, whose vertices are the feet of the three altitudes.
2801 \item \tkzMeth{triangle}{altitude} returns a single altitude line, based on an optional argument.
2802 \end{itemize}
2803
2804 \medskip
2805 The optional argument \code{arg} determines from which vertex the altitude is dropped. It may be:
2806 \begin{itemize}
2807 \item \code{nil} or \code{0} (default): returns the altitude from vertex $A$;
2808 \item \code{1}: returns the altitude from vertex $B$;
2809 \item \code{2}: returns the altitude from vertex $C$;
2810 \item a point equal to \code{z.A}, \code{z.B}, or \code{z.C} (the vertex of origin).
2811 \end{itemize}
2812
2813 \medskip
2814
2815 This interface matches that of other methods such as \tkzMeth{triangle}{bisector} and \tkzMeth{triangle}{symmedian\_line}.
2816
2817 \vspace{1em}
2818
2819 \begin{minipage}{.5\textwidth}
2820 \directlua{
2821 init_elements()
2822 z.A = point(0, 0)
2823 z.B = point(5, 0)
2824 z.C = point(2, 4)
2825 T.ABC = triangle(z.A, z.B, z.C)
2826 z.H = T.ABC.orthocenter
2827 L.HA = T.ABC:altitude()
2828 L.HC = T.ABC:altitude(z.C)
2829 z.Hc = L.HC.pb
2830 z.Ha = L.HA.pb
2831 z.a, z.b,
2832 z.c = T.ABC:orthic():get()}
2833 \begin{tikzpicture}
2834 \tkzGetNodes
2835 \tkzDrawPolygon(A,B,C)
2836 \tkzDrawPolygon[red](a,b,c)
2837 \tkzDrawPoints(A,B,C,H)
2838 \tkzDrawSegments[red](C,Hc A,Ha)
2839 \tkzLabelPoints(A,B,H)
2840 \tkzLabelPoints(Hc)
2841 \tkzLabelPoints[above](Ha,C)
2842 \tkzMarkRightAngles[fill = gray!30,
2843 opacity=.4](B,Hc,C A,Ha,C)
2844 \end{tikzpicture}
2845 \end{minipage}
2846 \begin{minipage}{.5\textwidth}
2847 \begin{tkzexample}[code only]
2848 \directlua{
2849 init_elements()
2850 z.A = point(0, 0)
2851 z.B = point(5, 0)
2852 z.C = point(2, 4)
2853 T.ABC = triangle(z.A, z.B, z.C)
2854 z.H = T.ABC.orthocenter
2855 L.HA = T.ABC:altitude()
2856 L.HC = T.ABC:altitude(z.C)
2857 z.Hc = L.HC.pb
2858 z.Ha = L.HA.pb
2859 z.a, z.b,
2860 z.c = T.ABC:orthic():get()}
2861 \end{tkzexample}
2862 \end{minipage}
2863
2864 \subsubsection{Method \tkzMeth{triangle}{bisector(arg)}} %(fold)
2865 \label{ssub:method_triangle_bisector}
2866
2867 This method returns one of the three \textbf{internal angle bisectors} of a triangle.
2868
2869 \medskip
2870
2871 In many cases, it may be sufficient to compute the incenter and connect it to the triangle’s vertices, since all bisectors pass through the incenter. For example:
2872 \begin{mybox}
2873 \code{z.I = T.ABC.incenter}
2874 \end{mybox}
2875
2876
2877 However, the method \code{bisector(arg)} explicitly computes the intersection of the bisector with the opposite side. This is useful for constructing the \emph{incentral triangle} or other derived figures.
2878
2879 \medskip
2880
2881 If all three bisectors are needed, use the method \tkzMeth{triangle}{incentral}, which returns the \textbf{incentral triangle}, whose vertices are the feet of the internal bisectors.
2882
2883 \medskip
2884
2885 The optional argument \code{arg} controls from which vertex the bisector originates. It can be:
2886 \begin{itemize}
2887 \item \code{nil} or \code{0} (default): bisector from vertex $A$;
2888 \item \code{1}: bisector from vertex $B$;
2889 \item \code{2}: bisector from vertex $C$;
2890 \item a point equal to one of the triangle’s vertices, such as \code{z.A}, \code{z.B}, or \code{z.C}.
2891 \end{itemize}
2892
2893
2894 This behavior is consistent with other methods like \code{altitude}, \code{symmedian\_line}, and \code{mediator}.
2895
2896 \vspace{1em}
2897 \begin{minipage}{.5\textwidth}
2898 \directlua{
2899 init_elements()
2900 z.A = point(0, 0)
2901 z.B = point(3, 2)
2902 z.C = point(2, 5)
2903 T.ABC = triangle(z.A, z.B, z.C)
2904 L.AE = T.ABC:bisector()
2905 z.E = L.AE.pb
2906 z.F = T.ABC:bisector(z.B).pb
2907 z.a, z.b, z.c = T.ABC:incentral():get()
2908 z.I = T.ABC.incenter}
2909 \begin{center}
2910 \begin{tikzpicture}
2911 \tkzGetNodes
2912 \tkzDrawPolygon(A,B,C)
2913 \tkzDrawPolygon[cyan](a,b,c)
2914 \tkzDrawLines(A,B A,C A,E B,F)
2915 \tkzDrawPoints(A,B,C,a,b,c)
2916 \tkzMarkAngles[cyan,mark=|,size=.75](B,A,a a,A,C)
2917 \tkzMarkAngles[mark=||,size=.5](C,B,b b,B,A)
2918 \tkzDrawLines[red](A,E B,F)
2919 \tkzDrawPoints(A,B,C,E,F,I)
2920 \tkzLabelPoints(A,B,I)
2921 \tkzLabelPoints[above left](C,F,E)
2922 \end{tikzpicture}
2923 \end{center}
2924 \end{minipage}
2925 \begin{minipage}{.5\textwidth}
2926 \begin{tkzexample}[code only]
2927 \directlua{
2928 init_elements()
2929 z.A = point(0, 0)
2930 z.B = point(3, 2)
2931 z.C = point(2, 5)
2932 T.ABC = triangle(z.A, z.B, z.C)
2933 L.AE = T.ABC:bisector()
2934 z.E = L.AE.pb
2935 z.F = T.ABC:bisector(z.B).pb
2936 z.a, z.b, z.c = T.ABC:incentral():get()
2937 z.I = T.ABC.incenter}
2938 \end{tkzexample}
2939 \end{minipage}
2940
2941 \subsubsection{Method \tkzMeth{triangle}{bisector\_ext(arg)}}
2942 \label{ssub:method_triangle_bisector_ext}
2943
2944 This method returns an \textbf{external angle bisector} of the triangle, from a specified vertex.
2945
2946 \medskip
2947
2948 Its interface is identical to \tkzMeth{triangle}{bisector}, accepting either an index \code{n} or a vertex point (\code{z.A}, \code{z.B}, \code{z.C}). See Section~\ref{ssub:method_triangle_bisector} for usage details.
2949
2950 \subsubsection{Method \tkzMeth{triangle}{mediator(...)}}
2951 \label{ssub:triangle_mediator}
2952 In classical English geometry, the line called médiatrice in French is usually referred to as the perpendicular bisector of a segment.
2953 The word mediator is not standard in modern English mathematical literature and may occasionally denote a perpendicular bisecting plane in three-dimensional geometry.
2954 However, throughout this documentation, we deliberately use the term mediator to designate:
2955 the line in the plane passing through the midpoint of a segment and perpendicular to it.
2956 This choice is motivated by terminological coherence with the French mathematical tradition and by the desire to keep method names concise and readable in code.
2957 Whenever the term mediator appears in this manual, it should therefore be understood as the perpendicular bisector of a segment in the plane.
2958
2959
2960 This method returns the perpendicular bisector of one side of a triangle.
2961
2962 \texttt{Syntax: }
2963
2964 \begin{verbatim}
2965 L = triangle:mediator()
2966 L = triangle:mediator(n) n = 0, 1 or 2
2967 L = triangle:mediator(pt) pt vertex of the triangle
2968 \end{verbatim}
2969
2970 \texttt{Arguments: }
2971
2972 \begin{itemize}
2973 \item If no argument or \texttt{n = 0} is given, the bisector of side \tkzname{AB} is returned.
2974 \item If \texttt{n = 1}, the bisector of side \tkzname{BC} is returned.
2975 \item If \texttt{n = 2}, the bisector of side \tkzname{CA} is returned.
2976 \item If a point (\tkzname{pa}, \tkzname{pb}, \tkzname{pc}) is passed, the method returns the bisector of the side opposite to that vertex.
2977 \end{itemize}
2978
2979 \texttt{Return value: }
2980
2981 Returns a \tkzname{line} object representing the perpendicular bisector of the selected side.
2982
2983 \texttt{Examples.}
2984
2985 \begin{mybox}
2986 \begin{verbatim}
2987 T = triangle(z.A, z.B, z.C)
2988 L1 = T:mediator() -- bisector of AB
2989 L2 = T:mediator(1) -- bisector of BC
2990 L3 = T:mediator(z.C) -- bisector of AB (since C is opposite AB)
2991 \end{verbatim}
2992 \end{mybox}
2993
2994
2995 \begin{tkzexample}[latex=.55\textwidth]
2996 \directlua{
2997 z.A = point(0, 0)
2998 z.B = point(3, 2)
2999 z.C = point(2, 5)
3000 T.ABC = triangle(z.A, z.B, z.C)
3001 L.MA = T.ABC:mediator(z.A)
3002 L.MB = T.ABC:mediator(z.B)
3003 L.MC = T.ABC:mediator(z.C)
3004 z.ma1, z.ma2 = L.MA:get()
3005 z.mb1, z.mb2 = L.MB:get()
3006 z.mc1, z.mc2 = L.MC:get()}
3007 \begin{center}
3008 \begin{tikzpicture}
3009 \tkzGetNodes
3010 \tkzDrawPolygon(A,B,C)
3011 \tkzDrawLines[red,
3012 add = .25 and .25](ma1,ma2 mb1,mb2
3013 mc1,mc2)
3014 \tkzDrawPoints(A,B,C,ma1,ma2)
3015 \end{tikzpicture}
3016 \end{center}
3017 \end{tkzexample}
3018
3019
3020 \texttt{See also: } \tkzFct{line}{mediator}, \tkzFct{triangle}{altitude}, \tkzFct{triangle}{bisector}
3021
3022 \subsubsection{Method \tkzMeth{triangle}{antiparallel(arg)}}
3023 \label{antiparallel}
3024
3025 This method returns an \texttt{antiparallel line} associated with a triangle and one of its angles.
3026
3027 Two lines, such as $(PQ)$ and $(BC)$, are said to be \texttt{antiparallel} with respect to an angle (e.g., $\hat{A}$) if they form equal angles (in opposite directions) with the bisector of that angle.
3028
3029
3030 Useful properties of antiparallel lines:
3031 \begin{itemize}
3032 \item If $(PQ)$ and $(BC)$ are antiparallel with respect to $\hat{A}$, then the four points $P$, $Q$, $B$, and $C$ are \texttt{concyclic}.
3033 \item Antiparallelism is symmetric: if $(PQ)$ is antiparallel to $(BC)$, then $(BC)$ is antiparallel to $(PQ)$.
3034 \end{itemize}
3035
3036 \medskip
3037
3038 This method takes two arguments:
3039 \begin{itemize}
3040 \item \code{pt} (mandatory): a point through which the antiparallel line will pass;
3041 \item \code{arg} (optional): specifies the vertex of the triangle that defines the reference angle.
3042 \end{itemize}
3043
3044
3045 The second argument \code{arg} can be:
3046 \begin{itemize}
3047 \item \code{nil} or \code{0} (default): antiparallel to $BC$ w.r.t.\ angle $\hat{A}$;
3048 \item \code{1}: antiparallel to $AC$ w.r.t.\ angle $\hat{B}$;
3049 \item \code{2}: antiparallel to $AB$ w.r.t.\ angle $\hat{C}$;
3050 \item a point equal to one of the triangle’s vertices: \code{z.A}, \code{z.B}, or \code{z.C}.
3051 \end{itemize}
3052
3053 \medskip
3054
3055 This method is used, for example, in the construction of the symmedian point (see Section~\ref{ssub:method_triangle_lemoine_point}).
3056
3057 \vspace{1em}
3058 \begin{tkzexample}[latex =.5\textwidth]
3059 \directlua{
3060 init_elements()
3061 z.B = point(0, 0)
3062 z.C = point(5, 0)
3063 z.A = point(1, 4)
3064 T.ABC = triangle(z.A, z.B, z.C)
3065 z.M = point(2, 2)
3066 L.anti = T.ABC:antiparallel(z.M, z.A)
3067 z.P, z.Q = L.anti:get()
3068 T.PQ = triangle(z.P, z.Q, z.B)
3069 z.W = T.PQ.circumcenter}
3070 \begin{tikzpicture}[scale=.8]
3071 \tkzGetNodes
3072 \tkzDrawPolygons(A,B,C)
3073 \tkzDrawPoints(A,B,C,M,P,Q)
3074 \tkzLabelPoints(A,B,P,Q)
3075 \tkzLabelPoints[above](M,C)
3076 \tkzDrawSegments(P,Q)
3077 \tkzDrawCircle(W,P)
3078 \end{tikzpicture}
3079 \end{tkzexample}
3080
3081
3082 \subsubsection{Method \tkzMeth{triangle}{orthic\_axis()} and \tkzMeth{triangle}{orthic\_axis\_points()}}
3083 \label{ssub:method_triangle_orthic_axis}
3084 \label{ssub:method_triangle_orthic_axis_points}
3085
3086 Let $H_AH_BH_C$ be the \textbf{orthic triangle} of a reference triangle $ABC$ (i.e., the triangle formed by the feet of the altitudes from each vertex).
3087
3088 \medskip
3089
3090 Each side of triangle $ABC$ intersects each side of triangle $H_AH_BH_C$, and the three points of intersection all lie on a common straight line. This line is known as the \textbf{orthic axis} of the triangle.
3091
3092 \medskip
3093
3094 The method \tkzMeth{triangle}{orthic\_axis()} returns this line as an object of class \code{line}.
3095 The method \tkzMeth{triangle}{orthic\_axis\_points()} returns the three intersection points between corresponding sides of the reference triangle and the orthic triangle. These are the points $O_A$, $O_B$, and $O_C$ aligned on the orthic axis.
3096
3097 \medskip
3098
3099 This remarkable line is a classical geometric construction, often overlooked despite its elegance.
3100
3101 \vspace{1em}
3102
3103 \begin{tkzexample}[latex=.5\textwidth]
3104 \directlua{
3105 z.B = point(0, 0)
3106 z.C = point(5, 0)
3107 z.A = point(.6, 3)
3108 T.ABC = triangle(z.A, z.B, z.C)
3109 z.H = T.ABC.orthocenter
3110 z.H_A, z.H_B,
3111 z.H_C = T.ABC:orthic():get()
3112 L.orthic = T.ABC:orthic_axis()
3113 z.Q_A, z.Q_B,
3114 z.Q_C = T.ABC:orthic_axis_points()}
3115 \begin{center}
3116 \begin{tikzpicture}
3117 \tkzGetNodes
3118 \tkzDrawPolygons[cyan](A,B,C)
3119 \tkzDrawLines[red](Q_C,Q_B)
3120 \tkzDrawSegments(A,Q_C B,Q_A A,H_A)
3121 \tkzDrawSegments(B,H_B C,H_C C,Q_B)
3122 \tkzDrawSegments[dashed](H_B,Q_C H_B,Q_A)
3123 \tkzDrawSegments[dashed](H_A,Q_B)
3124 \tkzDrawPoints(A,B,C,H_A,H_B,H_C)
3125 \tkzDrawPoints(H,Q_A,Q_B,Q_C)
3126 \tkzLabelPoints(H)
3127 \tkzLabelPoints(B,C,H_A)
3128 \tkzLabelPoints[above right](A,H_B)
3129 \tkzLabelPoints[left](H_C,Q_A,Q_B,Q_C)
3130 \end{tikzpicture}
3131 \end{center}
3132 \end{tkzexample}
3133
3134
3135 \subsubsection{Methods \tkzMeth{triangle}{euler\_line()} and \tkzMeth{triangle}{orthic\_axis()}} %(fold)
3136 \label{ssub:euler_line}
3137
3138 These two methods return two fundamental lines associated with triangle geometry: the \textbf{Euler line} and the \textbf{orthic axis}.
3139
3140 \medskip
3141
3142 \textbf{Euler line} — The line on which lie several remarkable triangle centers:
3143 \begin{itemize}
3144 \item the orthocenter $H$,
3145 \item the centroid $G$,
3146 \item the circumcenter $O$,
3147 \item the nine-point center $N$,
3148 \item and many others.
3149 \end{itemize}
3150
3151
3152
3153 \medskip
3154
3155 \textbf{Orthic axis} — Let $h_a$, $h_b$, and $h_c$ be the vertices of the orthic triangle of triangle $ABC$. Each side of triangle $ABC$ intersects each side of the orthic triangle. The three points of intersection lie on a line called the \textbf{orthic axis}.
3156
3157 \begin{itemize}
3158 \item This line is \emph{perpendicular} to the Euler line.
3159 \item It is returned by the method \tkzMeth{triangle}{orthic\_axis()} as a \code{line} object.
3160 \item To obtain the three intersection points explicitly, use \tkzMeth{triangle}{orthic\_axis\_points()}.
3161 \end{itemize}
3162
3163
3164 \vspace{1em}
3165
3166 \begin{minipage}{.5\textwidth}
3167 \directlua{
3168 init_elements()
3169 z.B = point(0 ,0)
3170 z.C = point(5, 0)
3171 z.A = point(.6, 3)
3172 T.ABC = triangle(z.A, z.B, z.C)
3173 z.N = T.ABC.eulercenter
3174 z.H = T.ABC.orthocenter
3175 z.O = T.ABC.circumcenter
3176 z.G = T.ABC.centroid
3177 z.ha, z.hb, z.hc = T.ABC:orthic():get()
3178 L.orthic = T.ABC:orthic_axis()
3179 z.Qa, z.Qb, z.Qc = T.ABC:orthic_axis_points()
3180 L.euler = T.ABC:euler_line()
3181 z.ea, z.eb = L.euler:get()
3182 z.K = L.orthic:projection(z.N)}
3183 \begin{center}
3184 \begin{tikzpicture}[scale=1]
3185 \tkzGetNodes
3186 \tkzDrawPolygons[cyan](A,B,C)
3187 \tkzDrawLines[red](Qc,Qb)
3188 \tkzDrawSegments(A,Qc B,Qa A,ha B,hb C,hc C,Qb)
3189 \tkzDrawSegments[dashed](hb,Qc hb,Qa ha,Qb)
3190 \tkzDrawLines[blue, add = .5 and .5](ea,eb)
3191 \tkzDrawPoints(A,B,C,ha,hb,hc)
3192 \tkzDrawPoints(N,H,O,G,Qa,Qb,Qc)
3193 \tkzLabelPoints(N,H,O,G)
3194 \tkzLabelPoints(B,C,ha)
3195 \tkzLabelPoints[above right](A,hb)
3196 \tkzLabelPoints[left](hc,Qa,Qb,Qc)
3197 \tkzMarkRightAngle(N,K,Qb)
3198 \tkzLabelSegment[sloped,blue,pos=1.4,above](ea,eb){\small\texttt{euler\_line}}
3199 \tkzLabelSegment[sloped,red,pos=.9](Qc,Qb){\small\texttt{orthic\_axis}}
3200 \end{tikzpicture}
3201 \end{center}
3202 \end{minipage}
3203 \begin{minipage}{.5\textwidth}
3204 \begin{tkzexample}[code only]
3205 \directlua{
3206 init_elements()
3207 z.B = point(0 ,0)
3208 z.C = point(5, 0)
3209 z.A = point(.6, 3)
3210 T.ABC = triangle(z.A, z.B, z.C)
3211 z.N = T.ABC.eulercenter
3212 z.H = T.ABC.orthocenter
3213 z.O = T.ABC.circumcenter
3214 z.G = T.ABC.centroid
3215 z.ha, z.hb, z.hc = T.ABC:orthic():get()
3216 L.orthic = T.ABC:orthic_axis()
3217 z.Qa, z.Qb,
3218 z.Qc = T.ABC:orthic_axis_points()
3219 L.euler = T.ABC:euler_line()
3220 z.ea, z.eb = L.euler:get()
3221 z.K = L.orthic:projection(z.N)}
3222 \end{tkzexample}
3223 \end{minipage}
3224
3225 \subsubsection{Method \tkzMeth{triangle}{steiner\_line(pt)}} %(fold)
3226 \label{ssub:method_triangle_steiner__line}
3227
3228 Let $ABC$ be a triangle with orthocenter $H$, and let $M$ be a point on the circumcircle of triangle $ABC$.
3229
3230 \medskip
3231
3232 Define the following:
3233 \begin{itemize}
3234 \item $H_A$, $H_B$, and $H_C$ are the reflections of point $M$ across the sides $BC$, $AC$, and $AB$ respectively.
3235 \item The points $H_A$, $H_B$, $H_C$, and the orthocenter $H$ are collinear.
3236 \end{itemize}
3237
3238
3239 The line passing through these four points is called the \textbf{Steiner line} of point $M$ with respect to triangle $ABC$.
3240
3241 \medskip
3242
3243 The method \tkzMeth{triangle}{steiner\_line(pt)} returns this line as a \code{line} object, provided that the point \code{pt} lies on the circumcircle of the triangle. The Steiner line always passes through the orthocenter $H$.
3244
3245 \medskip
3246
3247 A necessary and sufficient condition for the points $H_A$, $H_B$, and $H_C$ to be collinear (and for the Steiner line to exist) is that $M$ lies on the circumcircle of triangle $ABC$.
3248
3249 \vspace{1em}
3250
3251 \begin{tkzexample}[vbox]
3252 \directlua{
3253 z.B = point(0, 0)
3254 z.C = point(4, 0)
3255 z.A = point(1, 4)
3256 T.ABC = triangle(z.A, z.B, z.C)
3257 C.ABC = T.ABC:circum_circle()
3258 z.O = T.ABC.circumcenter
3259 z.H = T.ABC.orthocenter
3260 z.M = C.ABC:point(.65)
3261 z.H_P = T.ABC.ab:reflection(z.M)
3262 z.H_Q = T.ABC.bc:reflection(z.M)
3263 z.H_R = T.ABC.ca:reflection(z.M)
3264 L.steiner = T.ABC:steiner_line(z.M)
3265 z.P = T.ABC.ab:projection(z.M)
3266 z.Q = T.ABC.bc:projection(z.M)
3267 z.R = T.ABC.ca:projection(z.M)}
3268 \begin{center}
3269 \begin{tikzpicture}
3270 \tkzGetNodes
3271 \tkzDrawLines[cyan,add= .25 and .25](A,C A,B B,C)
3272 \tkzDrawLines[red,thick](H_P,H_Q)
3273 \tkzDrawCircles(O,A)
3274 \tkzDrawPoints(A,B,C,M,H_P,H_Q,H_R,O,H,P,Q,R)
3275 \tkzLabelPoints(B,C,H_P,H_Q,H_R,R)
3276 \tkzLabelPoints[above](O,H)
3277 \tkzLabelPoints[above right](P,Q,A,M)
3278 \tkzDrawSegments(M,H_P M,H_Q M,H_R)
3279 \tkzMarkRightAngles(B,P,M M,R,A M,Q,B)
3280 \end{tikzpicture}
3281 \end{center}
3282 \end{tkzexample}
3283
3284 \subsubsection{Method \tkzMeth{triangle}{lemoine\_axis()}} %(fold)
3285 \label{ssub:method_triangle_lemoine__line}
3286
3287 This method returns the \textbf{Lemoine axis} of the triangle.
3288
3289 \medskip
3290
3291 The Lemoine axis is a classical and remarkable line associated with triangle geometry. It is defined in several equivalent ways:
3292 \begin{itemize}
3293 \item It is the \textbf{polar} of the \textbf{Lemoine point} (or symmedian point) with respect to the circumcircle of the triangle.
3294 \item It passes through the points of intersection of the \textbf{tangents} to the circumcircle at each vertex and the \textbf{opposite sides}. These tangents are antiparallel to the opposite sides.
3295 \item It also contains the \textbf{centers of the three Apollonius circles} corresponding to the ordered triplets:
3296 \[
3297 (A, B, \frac{CA}{CB}), \quad (B, C, \frac{AB}{AC}), \quad (C, A, \frac{BC}{BA})
3298 \]
3299 \end{itemize}
3300
3301
3302 The method \tkzMeth{triangle}{lemoine\_axis()} returns the line as an object of type \code{line}.
3303
3304 \vspace{1em}
3305
3306 \begin{minipage}{.5\textwidth}
3307 \directlua{
3308 z.A = point(0, -2)
3309 z.B = point(5, 2)
3310 z.C = point(1, 1)
3311 T.ABC = triangle(z.A, z.B, z.C)
3312 z.L = T.ABC:lemoine_point()
3313 z.O = T.ABC.circumcenter
3314 L.L = T.ABC:lemoine_axis()
3315 z.la,
3316 z.lb = L.L:get()
3317 L.B = T.ABC:brocard_axis()
3318 z.ba,
3319 z.bb = L.B:get()}
3320 \begin{center}
3321 \begin{tikzpicture}[scale=.6]
3322 \tkzGetNodes
3323 \tkzDrawPolygons[cyan](A,B,C)
3324 \tkzDrawLines[purple,add = 1 and 1](la,lb)
3325 \tkzDrawLines[red,add = 1 and 1](ba,bb)
3326 \tkzDrawCircle(O,A)
3327 \tkzDrawPoints(A,B,L,O,la,lb)
3328 \tkzLabelPoints(A,B)
3329 \tkzLabelPoints[below](L,O)
3330 \tkzLabelPoints[above](C)
3331 \tkzLabelLine[sloped,above,
3332 purple](la,lb){Lemoine\_axis}
3333 \tkzLabelLine[sloped,above,red,
3334 pos=.2](ba,bb){Brocard\_line}
3335 \end{tikzpicture}
3336 \end{center}
3337
3338 \end{minipage}
3339 \begin{minipage}{.5\textwidth}
3340 \begin{tkzexample}[code only]
3341 \directlua{
3342 z.A = point(0, -2)
3343 z.B = point(5, 2)
3344 z.C = point(1, 1)
3345 T.ABC = triangle(z.A, z.B, z.C)
3346 z.L = T.ABC:lemoine_point()
3347 z.O = T.ABC.circumcenter
3348 L.L = T.ABC:lemoine_axis()
3349 z.la,
3350 z.lb = L.L:get()
3351 L.B = T.ABC:brocard_axis()
3352 z.ba,
3353 z.bb = L.B:get()}
3354 \end{tkzexample}
3355 \end{minipage}
3356
3357 \subsubsection{Method \tkzMeth{triangle}{fermat\_axis}} %(fold)
3358 \label{ssub:method_triangle_fermat__axis}
3359
3360 The Fermat axis is the line connecting the first and second Fermat points.
3361
3362 \begin{minipage}{.5\textwidth}
3363 \directlua{
3364 z.A = point(1, 2)
3365 z.B = point(5, 1)
3366 z.C = point(2.5, 3)
3367 T.ABC = triangle(z.A, z.B, z.C)
3368 z.F1 = T.ABC:first_fermat_point()
3369 z.F2 = T.ABC:second_fermat_point()
3370 L.F = T.ABC:fermat_axis()
3371 z.a, z.b = L.F:get()
3372 z.L = T.ABC:lemoine_point()}
3373 \begin{center}
3374 \begin{tikzpicture}[scale =1.5]
3375 \tkzGetNodes
3376 \tkzDrawPolygon(A,B,C)
3377 \tkzDrawLine(a,b)
3378 \tkzDrawPoints(A,B,C)
3379 \tkzDrawPoints(F1,F2,L)
3380 \tkzLabelPoints[right](B,F1,F2,L)
3381 \tkzLabelPoints[above](C)
3382 \tkzLabelPoints(A)
3383 \end{tikzpicture}
3384 \end{center}
3385 \end{minipage}
3386 \begin{minipage}{.5\textwidth}
3387 \begin{tkzexample}[code only]
3388 \directlua{
3389 z.A = point(1, 2)
3390 z.B = point(5, 1)
3391 z.C = point(2.5, 3)
3392 T.ABC = triangle(z.A, z.B, z.C)
3393 z.F1 = T.ABC:first_fermat_point()
3394 z.F2 = T.ABC:second_fermat_point()
3395 L.F = T.ABC:fermat_axis()
3396 z.a, z.b = L.F:get()
3397 z.L = T.ABC:lemoine_point()}
3398 \end{tkzexample}
3399 \end{minipage}
3400
3401 \subsubsection{Method \tkzMeth{triangle}{brocard\_axis()}} %(fold)
3402 \label{ssub:method_triangle_brocard__axis}
3403
3404 The \textbf{Brocard axis} is the straight line passing through the \textbf{symmedian point} $K$ and the \textbf{circumcenter} $O$ of a triangle. The segment $[KO]$ is referred to as the \emph{Brocard diameter} (see Kimberling, 1998, p.~150).
3405
3406 \medskip
3407
3408 This line has several remarkable properties:
3409 \begin{itemize}
3410 \item It is \texttt{perpendicular} to the \texttt{Lemoine axis} (see Section~\ref{ssub:method_triangle_lemoine__line}).
3411 \item It is the \texttt{isogonal conjugate} of the \texttt{Kiepert hyperbola}.
3412 \end{itemize}
3413
3414
3415 The method \tkzMeth{triangle}{brocard\_axis()} returns this line as an object of type \code{line}.
3416 \begin{flushright}
3417 \small
3418 \href{https://mathworld.wolfram.com/BrocardAxis.html}{Weisstein, Eric W. "Brocard Axis." MathWorld}
3419 \end{flushright}
3420
3421 \vspace{1em}
3422
3423 \subsubsection{Method \tkzMeth{triangle}{simson\_line(pt)}} %(fold)
3424 \label{ssub:method_triangle_simson__line}
3425
3426 The \textbf{Simson line} of a point $M$ with respect to triangle $ABC$ is the line that passes through the feet of the perpendiculars dropped from $M$ to the sides (or their extensions) of the triangle.
3427
3428 \medskip
3429
3430 Let $P$, $Q$, and $R$ be the feet of the perpendiculars from $M$ to sides $BC$, $CA$, and $AB$ respectively. If $M$ lies on the \textbf{circumcircle} of triangle $ABC$, then the points $P$, $Q$, and $R$ are \textbf{collinear}. The line through them is called the \emph{Simson line} of $M$.
3431
3432 \medskip
3433
3434 The method \tkzMeth{triangle}{simson\_line(pt)} returns this line (as a \code{line} object), assuming the point \code{pt} lies on the circumcircle of the triangle.
3435 \begin{flushright}
3436 \small
3437 \href{https://mathworld.wolfram.com/SimsonLine.html}{Jackson, Frank and Weisstein, Eric W. "Simson Line." MathWorld}
3438 \end{flushright}
3439
3440 \vspace{1em}
3441 \begin{tkzexample}[vbox]
3442 \directlua{
3443 z.B = point(0, 0)
3444 z.C = point(4, 0)
3445 z.A = point(1, 4)
3446 T.ABC = triangle(z.A, z.B, z.C)
3447 C.ABC = T.ABC:circum_circle()
3448 z.O = T.ABC.circumcenter
3449 z.H = T.ABC.orthocenter
3450 z.M = C.ABC:point(.65)
3451 z.H_P = T.ABC.ab:reflection(z.M)
3452 z.H_Q = T.ABC.bc:reflection(z.M)
3453 z.H_R = T.ABC.ca:reflection(z.M)
3454 L.steiner = T.ABC:steiner_line(z.M)
3455 z.P = T.ABC.ab:projection(z.M)
3456 z.Q = T.ABC.bc:projection(z.M)
3457 z.R = T.ABC.ca:projection(z.M)
3458 L.simson = T.ABC:simson_line(z.M)
3459 z.sa, z.sb = L.simson:get()}
3460 \begin{center}
3461 \begin{tikzpicture}
3462 \tkzGetNodes
3463 \tkzDrawLines[cyan,add= .25 and .25](A,C A,B B,C)
3464 \tkzDrawLines[red,thick](H_P,H_Q)
3465 \tkzDrawLines[blue,thick](sa,sb)
3466 \tkzDrawCircles(O,A)
3467 \tkzDrawPoints(A,B,C,M,H_P,H_Q,H_R,O,H,P,Q,R)
3468 \tkzLabelPoints(B,C,H_P,H_Q,H_R,R)
3469 \tkzLabelPoints[above](O,H)
3470 \tkzLabelPoints[above right](P,Q,A,M)
3471 \tkzDrawSegments(M,H_P M,H_Q M,H_R)
3472 \tkzMarkRightAngles(B,P,M M,R,A M,Q,B)
3473 \end{tikzpicture}
3474 \end{center}
3475 \end{tkzexample}
3476
3477
3478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3479 %%%%%% Circles %%%%%%
3480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3481
3482 \subsection{Returns a circle}
3483 \subsubsection{Method \tkzMeth{triangle}{euler\_circle()}} %(fold)
3484 \label{ssub:method_triangle_euler_circle}
3485
3486 The \textbf{nine-point circle}, also called the \textbf{Euler circle} or \textbf{Feuerbach circle}, is a fundamental circle in triangle geometry.
3487
3488 \medskip
3489
3490 It passes through the following nine notable points of any triangle $ABC$:
3491 \begin{itemize}
3492 \item The feet $H_A$, $H_B$, $H_C$ of the altitudes from each vertex to the opposite side;
3493 \item The midpoints $M_A$, $M_B$, $M_C$ of the sides of the triangle;
3494 \item The midpoints $E_A$, $E_B$, $E_C$ of the segments joining each vertex to the orthocenter $H$ (called the \emph{Euler points}).
3495 \end{itemize}
3496
3497
3498 This circle was described by \texttt{Euler} in 1765 and further studied by \texttt{Feuerbach}, who proved that it is tangent to the triangle’s incircle and excircles.
3499
3500 \medskip
3501
3502 There are two ways to define this circle in the package:
3503 \begin{itemize}
3504 \item By computing its center using the attribute \code{T.eulercenter}, then using a midpoint to define the radius;
3505 \item Or directly, using the method \tkzMeth{triangle}{euler\_circle()}, which returns a \code{circle} object representing the nine-point circle.
3506 \end{itemize}
3507 \begin{flushright}
3508 \small
3509 \href{https://mathworld.wolfram.com/Nine-PointCircle.html}{Weisstein, Eric W. "Nine-Point Circle." MathWorld}
3510 \end{flushright}
3511
3512 \vspace{1em}
3513 \begin{tkzexample}[latex=.5\textwidth]
3514 \directlua{
3515 init_elements()
3516 z.A = point(0, 0)
3517 z.B = point(5, 0)
3518 z.C = point(1, 4)
3519 T.ABC = triangle(z.A, z.B, z.C)
3520 C.euler = T.ABC:euler_circle()
3521 z.N, z.K = C.euler:get()}
3522 \begin{center}
3523 \begin{tikzpicture}
3524 \tkzGetNodes
3525 \tkzDrawPolygons[red](A,B,C)
3526 \tkzDrawCircle(N,K)
3527 \tkzDrawPoints(A,B,C,N,K)
3528 \tkzLabelPoints(A,B,N)
3529 \tkzLabelPoints[above](C,K)
3530 \end{tikzpicture}
3531 \end{center}
3532 \end{tkzexample}
3533
3534 \subsubsection{Method \tkzMeth{triangle}{circum\_circle()}} %(fold)
3535 \label{ssub:method_triangle_circum_circle}
3536
3537 The \textbf{circumscribed circle} (or \textbf{circumcircle}) of a triangle is the unique circle that passes through its three vertices.
3538
3539 \medskip
3540
3541 There are two ways to obtain it:
3542 \begin{itemize}
3543 \item If you only need the \emph{center}, use the attribute \code{T.circumcenter}.
3544 \item If you need the \emph{entire circle object} (center and a point on the circle), use the method \tkzMeth{triangle}{circum\_circle()}, which returns a \code{circle}.
3545 \end{itemize}
3546
3547
3548 This method is useful if the circle needs to be reused in further constructions, such as drawing or testing tangency.
3549
3550 \vspace{1em}
3551
3552 \begin{tkzexample}[latex=.5\textwidth]
3553 \directlua{
3554 init_elements()
3555 z.A = point(0, 0)
3556 z.B = point(5, 0)
3557 z.C = point(1, 4)
3558 T.ABC = triangle(z.A, z.B, z.C)
3559 C.circum = T.ABC:circum_circle()
3560 z.O,
3561 z.K = C.circum:get()}
3562 \begin{center}
3563 \begin{tikzpicture}
3564 \tkzGetNodes
3565 \tkzDrawPolygons[red](A,B,C)
3566 \tkzDrawCircle(O,K)
3567 \tkzDrawPoints(A,B,C,O,K)
3568 \tkzLabelPoints(A,B,O)
3569 \tkzLabelPoints[above](C,K)
3570 \end{tikzpicture}
3571 \end{center}
3572 \end{tkzexample}
3573
3574 \subsubsection{Method \tkzMeth{triangle}{in\_circle()}} %(fold)
3575 \label{ssub:method_triangle_in_circle}
3576
3577 The \textbf{incircle} of a triangle is the unique circle that is \emph{tangent to all three sides} of the triangle and lies entirely within it. This circle is also known as the \emph{inscribed circle}.
3578
3579 \medskip
3580
3581 Its properties are as follows:
3582 \begin{itemize}
3583 \item The \textbf{center} $I$ of the incircle, called the \emph{incenter}, is the point of intersection of the three internal \textbf{angle bisectors}.
3584 \item The \textbf{radius} of the circle is called the \emph{inradius}.
3585 \item The points of tangency $M_A$, $M_B$, and $M_C$ of the incircle with the triangle's sides form the so-called \textbf{contact triangle}.
3586 \end{itemize}
3587
3588
3589 Geometrically, the contact triangle can also be seen as the \textbf{pedal triangle} of the incenter (see Section~\ref{ssub:method_triangle_pedal}) or as the \textbf{tangential triangle} (see Section~\ref{ssub:method_triangle_medial}).
3590
3591 \medskip
3592
3593 The method \tkzMeth{triangle}{in\_circle()} returns a \code{circle} object representing the incircle.
3594 \begin{flushright}
3595 \small
3596 \href{https://mathworld.wolfram.com/Incircle.html}{Weisstein, Eric W. "Incircle." MathWorld}
3597 \end{flushright}
3598
3599 \vspace{1em}
3600
3601 \directlua{
3602 init_elements()
3603 z.A = point(0, 0)
3604 z.B = point(5, 0)
3605 z.C = point(1, 3)
3606 T.ABC = triangle(z.A , z.B , z.C)
3607 z.E = T.ABC:bisector().pb
3608 z.F = T.ABC:bisector(1).pb
3609 z.G = T.ABC:bisector(2).pb
3610 C.IH = T.ABC:in_circle()
3611 z.I, z.H = C.IH:get()}
3612 \begin{center}
3613 \begin{tikzpicture}
3614 [scale = 2,
3615 new/.style ={ color = orange },
3616 one/.style = { new,/tkzmkangle/size=.5 },
3617 two/.style = { new,/tkzmkangle/size=.6 },
3618 l/.style = { /tkzmkangle/arc=l },
3619 ll/.style = { /tkzmkangle/arc=ll },
3620 lll/.style = { /tkzmkangle/arc=lll }]
3621 \tkzGetNodes
3622 \tkzDrawPolygon(A,B,C)
3623 \tkzDrawSegments[new](A,E B,F C,G)
3624 \tkzDrawSegments[dashed,add=0 and .5](I,H)
3625 \tkzDrawPoints(A,B,C,E,F,G,I)
3626 \tkzDrawCircle(I,H)
3627 \tkzDrawPoints(I,A,B,C,H)
3628 \begin{scope}[one]
3629 \tkzMarkAngles[l](B,A,E)
3630 \tkzMarkAngles[ll](C,B,F)
3631 \tkzMarkAngles[lll](A,C,G)
3632 \end{scope}
3633 \begin{scope}[two]
3634 \tkzMarkAngles[l](E,A,C)
3635 \tkzMarkAngles[ll](F,B,A)
3636 \tkzMarkAngles[lll](G,C,B)
3637 \end{scope}
3638 \tkzLabelPoints(A,B,I)
3639 \tkzLabelPoints[above](C,H)
3640 \end{tikzpicture}
3641 \end{center}
3642
3643 \begin{minipage}{.5\textwidth}
3644 \begin{verbatim}
3645 \directlua{
3646 init_elements()
3647 z.A = point(0, 0)
3648 z.B = point(5, 0)
3649 z.C = point(1, 3)
3650 T.ABC = triangle(z.A, z.B, z.C)
3651 z.E = T.ABC:bisector().pb
3652 z.F = T.ABC:bisector(1).pb
3653 z.G = T.ABC:bisector(2).pb
3654 C.IH = T.ABC:in_circle()
3655 z.I, z.H = C.IH:get()}
3656 \end{verbatim}
3657 \end{minipage}
3658 \begin{minipage}{.5\textwidth}
3659 \begin{verbatim}
3660 \begin{tikzpicture}%
3661 [new/.style ={color = orange },
3662 one/.style = { new,/tkzmkangle/size=.5 },
3663 two/.style = { new,/tkzmkangle/size=.6 },
3664 l/.style = { /tkzmkangle/arc=l },
3665 ll/.style = { /tkzmkangle/arc=ll },
3666 lll/.style = { /tkzmkangle/arc=lll }]
3667 \tkzGetNodes
3668 \tkzDrawPolygon(A,B,C)
3669 \tkzDrawSegments[new](A,E B,F C,G)
3670 \tkzDrawSegments[dashed,add=0 and .5](I,H)
3671 \tkzDrawPoints(A,B,C,E,F,G,I)
3672 \tkzDrawCircle(I,H)
3673 \tkzDrawPoints(I,A,B,C,H)
3674 \begin{scope}[one]
3675 \tkzMarkAngles[l](B,A,E)
3676 \tkzMarkAngles[ll](C,B,F)
3677 \tkzMarkAngles[lll](A,C,G)
3678 \end{scope}
3679 \begin{scope}[two]
3680 \tkzMarkAngles[l](E,A,C)
3681 \tkzMarkAngles[ll](F,B,A)
3682 \tkzMarkAngles[lll](G,C,B)
3683 \end{scope}
3684 \tkzLabelPoints(A,B,I)
3685 \tkzLabelPoints[above](C,H)
3686 \end{tikzpicture}
3687 \end{verbatim}
3688 \end{minipage}
3689
3690 \subsubsection{Method \tkzMeth{triangle}{ex\_circle(arg)}} %(fold)
3691 \label{ssub:method_triangle_ex__circle}
3692
3693 An \textbf{excircle} (or \emph{escribed circle}) of a triangle is a circle that lies outside the triangle and is tangent to one side and to the extensions of the two others.
3694
3695 \medskip
3696
3697 For each vertex of the triangle, there exists one such circle:
3698 \begin{itemize}
3699 \item The excircle opposite vertex $A$ is tangent to side $BC$ and the extensions of sides $AB$ and $AC$;
3700 \item The corresponding \textbf{excenter} lies at the intersection of two \emph{external} angle bisectors and one \emph{internal} bisector.
3701 \end{itemize}
3702
3703
3704 The method \tkzMeth{triangle}{ex\_circle(arg)} returns the excircle
3705 associated with the first vertex of the list obtained by performing
3706 a cyclic permutation of $(A,B,C)$ \verb|arg| times.
3707
3708 \begin{itemize}
3709 \item \verb|arg = 0| (or \verb|nil|) corresponds to vertex $A$,
3710 \item \verb|arg = 1| corresponds to vertex $B$,
3711 \item \verb|arg = 2| corresponds to vertex $C$.
3712 \end{itemize}
3713
3714 The argument \verb|arg| may also be the vertex itself (e.g., \tkzname{z.A}, \tkzname{z.B}, or \tkzname{z.C}).
3715
3716 \vspace{1em}
3717
3718 \begin{minipage}{.5\textwidth}
3719 \directlua{
3720 init_elements()
3721 z.A = point(0, 0)
3722 z.B = point(5, 0)
3723 z.C = point(-.4, 4)
3724 T.ABC = triangle(z.A, z.B, z.C)
3725 z.I,_ = T.ABC:ex_circle():get()
3726 z.J,_ = T.ABC:ex_circle(1):get()
3727 z.K,_ = T.ABC:ex_circle(2):get()
3728 z.Xk ,
3729 z.Yk,
3730 z.Zk = T.ABC:projections(z.K)
3731 z.Xi ,
3732 z.Yi,
3733 z.Zi = T.ABC:projections(z.I)
3734 z.Xj ,
3735 z.Yj,
3736 z.Zj = T.ABC:projections(z.J)
3737 }
3738 \begin{center}
3739 \begin{tikzpicture}[scale=.5]
3740 \tkzGetNodes
3741 \tkzDrawPolygon[red](A,B,C)
3742 \tkzDrawArc(K,Yk)(Zk)
3743 \tkzDrawArc(I,Zi)(Xi)
3744 \tkzDrawArc(J,Xj)(Yj)
3745 \tkzDrawSegments[blue,dashed](I,Xi I,Yi I,Zi)
3746 \tkzDrawSegments[blue,dashed](J,Xj J,Yj J,Zj)
3747 \tkzDrawSegments[blue,dashed](K,Xk K,Yk K,Zk)
3748 \tkzDrawPoints(A,B,C,I,J,K,Xk,Yk,Zk,Xi,Yj)
3749 \tkzLabelPoints(K,Xk,Yk)
3750 \tkzLabelPoints[above](C,B,Zk,Xi,Yi,Zi,Xj,Yj,Zj)
3751 \tkzLabelPoints[left](A)
3752 \tkzMarkRightAngles[fill=gray!20,opacity=.4](A,Zk,K A,Yk,K K,Xk,B)
3753 \end{tikzpicture}
3754 \end{center}
3755 \end{minipage}
3756 \begin{minipage}{.5\textwidth}
3757 \begin{tkzexample}[code only]
3758 \directlua{
3759 init_elements()
3760 z.A = point(0, 0)
3761 z.B = point(5, 0)
3762 z.C = point(-.4, 4)
3763 T.ABC = triangle(z.A, z.B, z.C)
3764 z.I,_ = T.ABC:ex_circle():get()
3765 z.J,_ = T.ABC:ex_circle(1):get()
3766 z.K,_ = T.ABC:ex_circle(2):get()
3767 z.Xk,
3768 z.Yk,
3769 z.Zk = T.ABC:projections(z.K)
3770 z.Xi,
3771 z.Yi,
3772 z.Zi = T.ABC:projections(z.I)
3773 z.Xj,
3774 z.Yj,
3775 z.Zj = T.ABC:projections(z.J)}
3776 \end{tkzexample}
3777 \end{minipage}
3778
3779 \subsubsection{Method \tkzMeth{triangle}{spieker\_circle()}} %(fold)
3780 \label{ssub:method_triangle_spieker__circle}
3781
3782 In triangle geometry, the \textbf{Spieker circle} is defined as the \textbf{incircle of the medial triangle} of a reference triangle $ABC$.
3783
3784 \medskip
3785
3786 Its center is known as the \textbf{Spieker center}, which is also the center of the \emph{radical circle} of the three \emph{excircles} of triangle $ABC$.
3787
3788 \medskip
3789
3790 To construct the Spieker circle:
3791 \begin{itemize}
3792 \item First form the \emph{medial triangle} whose vertices are the midpoints of the sides of $ABC$;
3793 \item Then construct the incircle of this medial triangle.
3794 \end{itemize}
3795
3796
3797 The method \tkzMeth{triangle}{spieker\_circle()} returns a \code{circle} object representing this circle.
3798 \begin{flushright}
3799 \small
3800 \href{https://mathworld.wolfram.com/SpiekerCircle.html}{Weisstein, Eric W. "Spieker Circle." MathWorld}
3801 \end{flushright}
3802
3803 \vspace{1em}
3804
3805
3806 \begin{minipage}{.5\textwidth}
3807 \directlua{
3808 init_elements()
3809 z.A = point(1, 1)
3810 z.B = point(5, 1)
3811 z.C = point(2.2, 4)
3812 T.ABC = triangle(z.A, z.B, z.C)
3813 C.first_lemoine = T.ABC:spieker_circle()
3814 z.S, z.w = C.first_lemoine:get()
3815 z.Ma, z.Mb, z.Mc = T.ABC:medial():get()
3816 z.N = T.ABC:nagel_point()
3817 z.Qa = tkz.midpoint(z.A, z.N)
3818 z.Qb = tkz.midpoint(z.B, z.N)
3819 z.Qc = tkz.midpoint(z.C, z.N)
3820 }
3821 \begin{center}
3822 \begin{tikzpicture}[scale = 1.25]
3823 \tkzGetNodes
3824 \tkzDrawPolygons(A,B,C Qa,Qb,Qc)
3825 \tkzDrawPolygons[red](Ma,Mb,Mc)
3826 \tkzDrawCircles[red](S,w)
3827 \tkzDrawSegments[dashed](N,A N,B N,C)
3828 \tkzDrawPoints(A,B,C,S,w,Ma,Mb,Mc,Qa,Qb,Qc,N)
3829 \tkzLabelPoints(A,B,S,w,Mc,N)
3830 \tkzLabelPoints[above](C,Ma,Mb,Qa,Qb,Qc)
3831 \end{tikzpicture}
3832 \end{center}
3833
3834 \end{minipage}
3835 \begin{minipage}{.5\textwidth}
3836 \begin{tkzexample}[code only]
3837 \directlua{
3838 init_elements()
3839 z.A = point(1, 1)
3840 z.B = point(5, 1)
3841 z.C = point(2.2, 4)
3842 T.ABC = triangle(z.A, z.B, z.C)
3843 C.first_lemoine = T.ABC:spieker_circle()
3844 z.S, z.w = C.first_lemoine:get()
3845 z.Ma, z.Mb, z.Mc = T.ABC:medial():get()
3846 z.N = T.ABC:nagel_point()
3847 z.Qa = tkz.midpoint(z.A, z.N)
3848 z.Qb = tkz.midpoint(z.B, z.N)
3849 z.Qc = tkz.midpoint(z.C, z.N)}
3850 \end{tkzexample}
3851 \end{minipage}
3852
3853 \subsubsection{Method \tkzMeth{triangle}{cevian\_circle}(pt)}
3854 \label{ssub:_triangle_cevian__circle_pt}
3855
3856 See [\ref{ssub:method_triangle_cevian}]
3857
3858 The \textbf{Cevian circle} of a point $P$ with respect to triangle $ABC$ is the circle passing through the three points where the cevians $AP$, $BP$, and $CP$ intersect the opposite sides (or their extensions). It is a special case of a pedal circle and is closely related to triangle center constructions.
3859
3860 The method \tkzMeth{triangle}{cevian\_circle(pt)} returns the circle passing through these three intersection points.
3861
3862 \vspace{1em}
3863
3864 \begin{tkzexample}[latex=8cm]
3865 \directlua{
3866 init_elements()
3867 z.A = point(0, 0)
3868 z.B = point(5, 0)
3869 z.C = point(2, 4)
3870 T.ABC = triangle(z.A, z.B, z.C)
3871 z.P = point(2.5, 1.5)
3872 C.cev = T.ABC:cevian_circle(z.P)
3873 z.w,z.t = C.cev:get()}
3874 \begin{tikzpicture}
3875 \tkzGetNodes
3876 \tkzDrawPolygon(A,B,C)
3877 \tkzDrawCircle(w,t)
3878 \tkzDrawPoints(A,B,C,P)
3879 \tkzLabelPoints(A,B,C,P)
3880 \end{tikzpicture}
3881 \end{tkzexample}
3882
3883 \subsubsection{Method \tkzMeth{triangle}{symmedial\_circle()}}
3884 \label{ssub:method_triangle_symmedial_circ}
3885 The symmedial circle is the circumcircle of the symmedial triangle.
3886
3887 \begin{tkzexample}[latex=8cm]
3888 \directlua{
3889 init_elements()
3890 z.A = point(0,0)
3891 z.B = point(5,0)
3892 z.C = point(2,4)
3893 T.ABC = triangle(z.A,z.B,z.C)
3894 C.sym = T.ABC:symmedial_circle()
3895 z.O,z.T = C.sym:get()}
3896 \begin{tikzpicture}
3897 \tkzGetNodes
3898 \tkzDrawPolygon(A,B,C)
3899 \tkzDrawCircle(O,T)
3900 \tkzDrawPoints(A,B,C,O,T)
3901 \tkzLabelPoints(A,B,C,O,T)
3902 \end{tikzpicture}
3903 \end{tkzexample}
3904
3905
3906 \subsubsection{Methods \tkzMeth{triangle}{conway\_points()} and \tkzMeth{triangle}{conway\_circle()}} %(fold)
3907 \label{ssub:method_triangle_conway}
3908
3909 In plane geometry, Conway's circle theorem states that when the sides meeting at each vertex of a triangle are extended by the length of the opposite side, the six endpoints of the three resulting line segments lie on a circle whose centre is the centre of incenter of the triangle.
3910
3911 The method \code{conway\_points()} creates the six points as defined by Conway’s theorem and constructs the circle that passes through them.
3912
3913 \vspace{1em}
3914 \begin{tkzexample}[latex=.5\textwidth]
3915 \directlua{
3916 init_elements()
3917 z.A = point(0, 0)
3918 z.C = point(5, 0)
3919 z.B = point(1, 3)
3920 T.ABC = triangle(z.A, z.B, z.C)
3921 C.conway = T.ABC:conway_circle()
3922 z.w, z.t = C.conway:get()
3923 z.t1, z.t2, z.t3,
3924 z.t4, z.t5,
3925 z.t6= T.ABC:conway_points()}
3926 \begin{tikzpicture}[ scale = .5]
3927 \tkzGetNodes
3928 \tkzDrawPolygon(A,B,C)
3929 \tkzDrawCircles(w,t)
3930 \tkzDrawPoints(t1,t2,t3,t4,t5,t6)
3931 \tkzLabelPoints(t1,t2,t3,t4,t5,t6)
3932 \tkzDrawSegments[dashed](t1,A t2,A t3,B)
3933 \tkzDrawSegments[dashed](t4,B t5,C t6,C)
3934 \tkzMarkSegments(B,C t1,A t2,A)
3935 \tkzMarkSegments[mark=||](A,C t3,B t4,B)
3936 \tkzMarkSegments[mark=|||](A,B t5,C t6,C)
3937 \end{tikzpicture}
3938 \end{tkzexample}
3939
3940 \subsubsection{Methods \tkzMeth{triangle}{pedal()} and \tkzMeth{triangle}{pedal\_circle()}} %(fold)
3941 \label{ssub:method_triangle_pedal}
3942
3943 Given a point $P$, the pedal triangle of $P$ is the triangle whose polygon vertices are the feet of the perpendiculars from $P$ to the side lines.
3944
3945 \vspace{1em}
3946 \begin{minipage}{.5\textwidth}
3947 \directlua{
3948 init_elements()
3949 z.A = point(0, 0)
3950 z.B = point(5, 0)
3951 z.C = point(1.5, 3)
3952 z.O = point(2, 1)
3953 T.ABC = triangle(z.A, z.B, z.C)
3954 T.pedal = T.ABC:pedal(z.O)
3955 z.E, z.F, z.G = T.pedal:get()
3956 C.pedal = T.ABC:pedal_circle(z.O)
3957 z.w = C.pedal.center
3958 z.T = C.pedal.through}
3959 \begin{center}
3960 \begin{tikzpicture}[scale = 1.2]
3961 \tkzGetNodes
3962 \tkzDrawPolygon(A,B,C)
3963 \tkzDrawPolygon[red](E,F,G)
3964 \tkzDrawCircle(w,T)
3965 \tkzDrawSegments(O,E O,F O,G)
3966 \tkzDrawPoints(A,B,C,E,F,G,O)
3967 \tkzLabelPoints(A,B,E)
3968 \tkzLabelPoints[left](G)
3969 \tkzLabelPoints[above](C,F)
3970 \end{tikzpicture}
3971 \end{center}
3972 \end{minipage}
3973 \begin{minipage}{.5\textwidth}
3974 \begin{tkzexample}[code only]
3975 \directlua{
3976 init_elements()
3977 z.A = point(0, 0)
3978 z.B = point(5, 0)
3979 z.C = point(1.5, 3)
3980 z.O = point(2, 1)
3981 T.ABC = triangle(z.A, z.B, z.C)
3982 T.pedal = T.ABC:pedal(z.O)
3983 z.E, z.F, z.G = T.pedal:get()
3984 C.pedal = T.ABC:pedal_circle(z.O)
3985 z.w = C.pedal.center
3986 z.T = C.pedal.through}
3987 \end{tkzexample}
3988 \end{minipage}
3989
3990 \subsubsection{Method \tkzMeth{triangle}{first\_lemoine\_circle()}}
3991 \label{ssub:method_triangle_first_lemoine_circle}
3992
3993 This method constructs the \emph{first Lemoine circle} of a triangle.
3994
3995 Through the \code{symmedian point} $L$ (also called the \code{Lemoine point}) of triangle $ABC$, draw three lines parallel to each side of the triangle:
3996
3997 The lines \( (P_AQ_A) \parallel (BC) \), \( (P_BQ_B) \parallel (AC) \), and \( (P_CQ_C) \parallel (AB) \) pass through the Lemoine point \( L \). These lines intersect the sides of the triangle in six points that lie on a common circle: the \emph{first Lemoine circle}.
3998
3999 Each of these lines intersects the triangle’s sides in two points. The six points thus obtained lie on a same circle, known as the \emph{first Lemoine circle}. Its center is $L$, and it is a special case of a circle associated with symmedians.
4000 \begin{flushright}
4001 \small
4002 \href{https://mathworld.wolfram.com/FirstLemoineCircle.html}
4003 {\textit{Weisstein, Eric W. "First Lemoine Circle." From MathWorld—A Wolfram Web Resource.}}
4004 \end{flushright}
4005
4006 \vspace{1em}
4007 \begin{minipage}{.5\textwidth}
4008 \directlua{
4009 z.A = point(0, 0)
4010 z.B = point(5, 1)
4011 z.C = point(1, 4)
4012 T.ABC = triangle(z.A, z.B, z.C)
4013 z.L = T.ABC:lemoine_point()
4014 C.flemoine = T.ABC:first_lemoine_circle()
4015 z.w, z.t = C.flemoine:get()
4016 z.Q_A, z.Q_B, z.Q_C,
4017 z.P_A, z.P_B, z.P_C = T.ABC:first_lemoine_points()
4018 }
4019 \begin{tikzpicture}
4020 \tkzGetNodes
4021 \tkzDrawPolygons[cyan](A,B,C)
4022 \tkzDrawCircle[red, thick](w, t)
4023 \tkzDrawSegments[cyan,dashed](P_A,Q_C Q_A,P_B Q_B,P_C)
4024 \tkzDrawPoints(A,B,L,Q_A,Q_B,Q_C)
4025 \tkzDrawPoints(P_A, P_B, P_C)
4026 \tkzLabelPoints(A,B,L, Q_B, P_A)
4027 \tkzLabelPoints[above](C)
4028 \tkzLabelPoints[above right](C,Q_C,P_B)
4029 \tkzLabelPoints[left](P_C,Q_A)
4030 \end{tikzpicture}
4031 \end{minipage}
4032 \begin{minipage}{.5\textwidth}
4033 \begin{tkzexample}[code only]
4034 \directlua{
4035 z.A = point(0, 0)
4036 z.B = point(5, 1)
4037 z.C = point(1, 4)
4038 T.ABC = triangle(z.A, z.B, z.C)
4039 z.L = T.ABC:lemoine_point()
4040 C.flemoine = T.ABC:first_lemoine_circle()
4041 z.w, z.t = C.flemoine:get()
4042 z.Q_A, z.Q_B, z.Q_C,
4043 z.P_A, z.P_B,
4044 z.P_C = T.ABC:first_lemoine_points()}
4045 \end{tkzexample}
4046 \end{minipage}
4047
4048 \subsubsection{Method \tkzMeth{triangle}{second\_lemoine\_circle()}}
4049
4050 This method constructs the \emph{second Lemoine circle} of a triangle.
4051
4052 Through the \code{symmedian point} \( L \) of triangle \( ABC \), draw lines parallel to the sides of the \emph{orthic triangle}. These lines intersect the sides of triangle \( ABC \) in six points. All six points lie on the same circle, called the \emph{second Lemoine circle}, whose center is also the point \( L \).
4053 \begin{flushright}
4054 \small
4055 \href{https://mathworld.wolfram.com/SecondLemoineCircle.html}
4056 {\textit{Weisstein, Eric W. "Second Lemoine Circle." From MathWorld—A Wolfram Web Resource.}}
4057 \end{flushright}
4058
4059 \vspace{1em}
4060 \begin{minipage}{.35\textwidth}
4061 \directlua{
4062 init_elements()
4063 z.A = point(0,0)
4064 z.B = point(5,1)
4065 z.C = point(1,4)
4066 T.ABC = triangle(z.A,z.B,z.C)
4067 z.L = T.ABC:lemoine_point()
4068 C.slemoine = T.ABC:second_lemoine_circle()
4069 z.w, z.t = C.slemoine:get()
4070 T.orthic = T.ABC:orthic()
4071 z.H_A, z.H_B, z.H_C = T.orthic:get()
4072 z.Q_A, z.Q_B, z.Q_C,
4073 z.P_A, z.P_B, z.P_C = T.ABC:second_lemoine_points()}
4074 \begin{tikzpicture}
4075 \tkzGetNodes
4076 \tkzDrawPolygons[cyan](A,B,C)
4077 \tkzDrawPolygons[purple](H_A,H_B,H_C)
4078 \tkzDrawCircle[red](w, t)
4079 \tkzDrawSegments[cyan,dashed](P_A,Q_C Q_A,P_B Q_B,P_C)
4080 \tkzDrawPoints(A,B,L)
4081 \tkzDrawPoints(H_A, H_B, H_C)
4082 \tkzLabelPoints(A,B,L, Q_B, P_A,H_C)
4083 \tkzLabelPoints[above right](C,Q_C,P_B,H_A)
4084 \tkzLabelPoints[left](P_C,Q_A,H_B)
4085 \end{tikzpicture}
4086 \end{minipage}
4087 \begin{minipage}{.65\textwidth}
4088 \begin{tkzexample}[code only]
4089 \directlua{
4090 init_elements()
4091 z.A = point(0, 0)
4092 z.B = point(5, 1)
4093 z.C = point(1, 4)
4094 T.ABC = triangle(z.A, z.B, z.C)
4095 z.L = T.ABC:lemoine_point()
4096 C.slemoine = T.ABC:second_lemoine_circle()
4097 z.w, z.t = C.slemoine:get()
4098 T.orthic = T.ABC:orthic()
4099 z.H_A, z.H_B, z.H_C = T.orthic:get()
4100 z.Q_A, z.Q_B, z.Q_C,
4101 z.P_A, z.P_B, z.P_C = T.ABC:second_lemoine_points()}
4102 \end{tkzexample}
4103 \end{minipage}
4104
4105 \subsubsection{Method \tkzMeth{triangle}{bevan\_circle()} } %(fold)
4106 \label{ssub:methods_triangle_bevan_circle}
4107
4108 This method constructs the \emph{Bevan circle}, also known as the \emph{excentral circle}.
4109
4110 The Bevan circle is the \emph{circumcircle} of the excentral triangle of the reference triangle \( ABC \), i.e., the circle passing through the three \emph{excenters} of \( ABC \). Its center is known as the \emph{Bevan point}, which is therefore the \code{circumcenter} of the excentral triangle.
4111 \begin{flushright}
4112 \small
4113 \href{https://mathworld.wolfram.com/BevanCircle.html}
4114 {\textit{Weisstein, Eric W. "Bevan Circle." From MathWorld—A Wolfram Web Resource.}}
4115 \end{flushright}
4116
4117 \vspace{1em}
4118 \begin{tkzexample}[latex=.5\textwidth]
4119 \directlua{
4120 init_elements()
4121 z.A = point(1, 1)
4122 z.B = point(6, 0)
4123 z.C = point(2, 4)
4124 T.ABC = triangle(z.A, z.B, z.C)
4125 z.Ea,z.Eb,z.Ec = T.ABC:excentral():get()
4126 C.bevan = T.ABC:bevan_circle()
4127 z.V, z.t = C.bevan:get()}
4128 \begin{center}
4129 \begin{tikzpicture}[scale =.4]
4130 \tkzGetNodes
4131 \tkzDrawPolygons(A,B,C Ea,Eb,Ec)
4132 \tkzDrawCircle(V,t)
4133 \tkzDrawPoints(A,B,C,V,Ea,Eb,Ec)
4134 \tkzLabelPoints(A,B,V)
4135 \tkzLabelPoints[above](C)
4136 \end{tikzpicture}
4137 \end{center}
4138 \end{tkzexample}
4139
4140 \subsubsection{Method \tkzMeth{triangle}{taylor\_circle()}} %(fold)
4141 \label{ssub:method_triangle_taylor__circle}
4142
4143 The six projections of the feet of the heights of a triangle onto the adjacent sides are cocylic.
4144
4145 \begin{tkzexample}[latex=.5\textwidth]
4146 \directlua{
4147 init_elements()
4148 z.A = point(0, 0)
4149 z.B = point(6, 0)
4150 z.C = point(2.8, 4)
4151 T.ABC = triangle(z.A, z.B, z.C)
4152 T.DEF = T.ABC:orthic()
4153 z.D, z.E, z.F = T.DEF:get()
4154 z.D_1,
4155 z.D_2,
4156 z.E_1,
4157 z.E_2,
4158 z.F_1,
4159 z.F_2 = T.ABC:taylor_points()
4160 C.taylor = T.ABC:taylor_circle()
4161 z.w, z.t = C.taylor:get()}
4162 \begin{center}
4163 \begin{tikzpicture}[scale = 1.25]
4164 \tkzGetNodes
4165 \tkzDrawPolygons(A,B,C D,E,F)
4166 \tkzDrawPoints(A,B,...,F)
4167 \tkzDrawPoints(D_1,D_2,E_1,E_2,F_1,F_2)
4168 \tkzDrawSegments[orange](D,D_1 D,D_2)
4169 \tkzDrawSegments[purple](E,E_1 E,E_2)
4170 \tkzDrawSegments[red](F,F_1 F,F_2)
4171 \tkzDrawCircles[blue](w,t)
4172 \tkzLabelPoints(A,B,F,E_1,D_2)
4173 \tkzLabelPoints[above left](F_2,E,C,D_1)
4174 \tkzLabelPoints[above right](E_2,D,F_1)
4175 \end{tikzpicture}
4176 \end{center}
4177 \end{tkzexample}
4178
4179
4180 \subsubsection{Method \tkzMeth{triangle}{adams\_circle()}}
4181 \label{ssub:method_triangle_adams_circle}
4182 See [\ref{ssub:method_triangle_adams_points}]
4183 \begin{tkzexample}[latex=.5\textwidth]
4184 \directlua{
4185 z.A = point(0.5, 4)
4186 z.B = point(0, 0)
4187 z.C = point(5, 0)
4188 T.ABC = triangle(z.A, z.B, z.C)
4189 C.a = T.ABC:adams_circle()
4190 z.w, z.t = C.a:get()
4191 z.t1, z.t2, z.t3,
4192 z.t4, z.t5,
4193 z.t6 = T.ABC:adams_points()}
4194 \begin{center}
4195 \begin{tikzpicture}
4196 \tkzGetNodes
4197 \tkzDrawPolygon(A,B,C)
4198 \tkzDrawCircles[blue](w,t)
4199 \tkzDrawPoints(t1,t2,t3,t4,t5,t6)
4200 \tkzLabelPoints(t3,t4)
4201 \tkzLabelPoints(B,C)
4202 \tkzLabelPoints[above](A)
4203 \tkzLabelPoints[left](t1,t2)
4204 \tkzLabelPoints[right](t5,t6)
4205 \end{tikzpicture}
4206 \end{center}
4207 \end{tkzexample}
4208
4209
4210 % lamoen_points()
4211 \subsubsection{Method \tkzMeth{triangle}{lamoen\_circle}}
4212 \label{ssub:method_triangle_lamoen_points}
4213
4214 This method returns the six \emph{Lamoen points} associated with a triangle.
4215
4216 By dividing a triangle using its three medians, six smaller triangles are formed. Remarkably, the \emph{circumcenters} of these six triangles are \emph{concyclic}, meaning they lie on a common circle. This circle is known as the \emph{van Lamoen circle}.
4217
4218 The six circumcenters themselves are called the \emph{Lamoen points}. See an example on the document \tkzname{Euclidean Geometry} presented in \href{http://altermundus.fr}{altermundus.fr}.
4219
4220 \vspace{1em}
4221
4222 \begin{tkzexample}[latex=.5\textwidth]
4223 \directlua{
4224 init_elements()
4225 z.A = point(1.2, 2)
4226 z.B = point(0, 0)
4227 z.C = point(4, 0)
4228 T.ABC = triangle(z.A, z.B, z.C)
4229 T.med = T.ABC:medial()
4230 z.G = T.ABC.centroid
4231 z.ma,z.mb,z.mc = T.med:get()
4232 z.Oab, z.Oac,
4233 z.Oba, z.Obc,
4234 z.Oca, z.Ocb = T.ABC:lamoen_points()
4235 C.lamoen = T.ABC:lamoen_circle()
4236 z.w = C.lamoen.center}
4237 \begin{center}
4238 \begin{tikzpicture}[scale = 1.5]
4239 \tkzGetNodes
4240 \tkzDrawPolygon(A,B,C)
4241 \tkzDrawPolygon[red](ma,mb,mc)
4242 \tkzDrawPoints(A,B,C,ma,mb,mc,G)
4243 \tkzDrawCircle[purple](w,Oab)
4244 \tkzDrawCircles(Oab,A Oac,B)
4245 \tkzDrawPoints[size=2,purple,
4246 fill=white](Oab,Oac,Oba,Obc,Oca,Ocb)
4247 \tkzLabelPoints(A,B,C,G)
4248 \end{tikzpicture}
4249 \end{center}
4250 \end{tkzexample}
4251
4252
4253 \subsubsection{Method \tkzMeth{triangle}{soddy\_circle()}}
4254 \label{ssub:method_triangle_soddy_circle}
4255
4256 \begin{tkzexample}[latex=.5\textwidth]
4257 \directlua{
4258 init_elements()
4259 z.A = point(0, 0)
4260 z.B = point(4, 0.5)
4261 z.C = point(1, 3)
4262 T.ABC = triangle(z.A, z.B, z.C)
4263 local ra = (T.ABC.b + T.ABC.c -T.ABC.a)/2
4264 local rb = (T.ABC.c + T.ABC.a -T.ABC.b)/2
4265 local rc = (T.ABC.b + T.ABC.a -T.ABC.c)/2
4266 C.a = circle(through(z.A, ra))
4267 C.b = circle(through(z.B, rb))
4268 C.c = circle(through(z.C, rc))
4269 z.ta = C.a.through
4270 z.tb = C.b.through
4271 z.tc = C.c.through
4272 C.i = T.ABC:soddy_circle()
4273 z.w, z.t = C.i:get()
4274 C.o = T.ABC:soddy_circle("outer")
4275 z.wp,z.tp = C.o:get()}
4276 \begin{tikzpicture}[scale=.75]
4277 \tkzGetNodes
4278 \tkzDrawPolygon(A,B,C)
4279 \tkzDrawCircles(A,ta B,tb C,tc)
4280 \tkzDrawCircles[red](w,t w',t')
4281 \tkzDrawPoints(A,B,C)
4282 \tkzLabelPoints(A,B,C)
4283 \end{tikzpicture}
4284 \end{tkzexample}
4285
4286
4287 \subsubsection{Method \tkzMeth{triangle}{yiu\_circles()}}
4288 \label{ssub:method_yiu_circles}
4289
4290 The \emph{Yiu $A$-circle} of a reference triangle $ABC$ is the circle passing through vertex $A$ and the reflections of vertices $B$ and $C$ across the opposite sides $AC$ and $AB$, respectively.
4291
4292 The \emph{Yiu $B$-} and \emph{$C$-circles} are defined analogously. These three circles intersect at a unique point — their common \emph{radical center}. However, they do not admit a common radical circle.
4293 \begin{flushright}
4294 \small
4295 \href{https://mathworld.wolfram.com/YiuCircles.html}
4296 {\textit{Weisstein, Eric W. "Yiu Circles." From MathWorld—A Wolfram Web Resource.}}
4297 \end{flushright}
4298
4299 \vspace{1em}
4300
4301 \begin{tkzexample}[latex=.5\textwidth]
4302 \directlua{
4303 z.A = point(-.2, 2)
4304 z.B = point(0, 0)
4305 z.C = point(2, 0)
4306 T.ABC = triangle(z.A,z.B,z.C)
4307 z.Ap,
4308 z.Bp,
4309 z.Cp = T.ABC:reflection():get()
4310 z.O_A, z.O_B, z.O_C = T.ABC:yiu_centers()
4311 C.A,
4312 C.B,
4313 C.C = T.ABC:yiu_circles()
4314 x,y = intersection(C.A,C.B)
4315 if C.C:in_out(x) then z.S = x
4316 else z.S = y end}
4317 \begin{center}
4318 \begin{tikzpicture}[scale=.8]
4319 \tkzGetNodes
4320 \tkzInit[xmin=-4,xmax=4,ymin=-4,ymax=4]
4321 \tkzClip
4322 \tkzDrawPolygon(A,B,C)
4323 \tkzDrawCircles[purple](O_A,A O_B,B O_C,C)
4324 \tkzDrawSegments[orange,
4325 dashed](A,A' B,B' C,C')
4326 \tkzDrawPoints(A,B,C,A',B',C',O_A,O_B,O_C,S)
4327 \tkzLabelPoints(B,C,A',C')
4328 \tkzLabelPoints[above](A,B',S)
4329 \end{tikzpicture}
4330 \end{center}
4331 \end{tkzexample}
4332
4333
4334 \subsubsection{Method \tkzMeth{triangle}{kenmotu\_circle()}}
4335 \label{ssub:kenmotu_circle}
4336
4337 The \emph{Kenmotu circle} is the circle passing through the six contact points of the three congruent squares constructed on the sides of a triangle. These squares are used in the construction of the \emph{Kenmotu point}, also known as the \emph{congruent squares point} (see Kimberling center $X_{(371)}$).
4338
4339 The Kenmotu circle contains all six points of tangency between the triangle sides and the inscribed squares.
4340 \begin{flushright}
4341 \small
4342 \href{https://mathworld.wolfram.com/KenmotuCircle.html}
4343 {\textit{Weisstein, Eric W. "Kenmotu Circle." From MathWorld—A Wolfram Web Resource.}}
4344 \end{flushright}
4345
4346 \vspace{1em}
4347
4348
4349 \begin{tkzexample}[latex=6cm]
4350 \directlua{
4351 init_elements()
4352 z.A = point(1.6, 4.5)
4353 z.B = point(0, 0)
4354 z.C = point(5, 0)
4355 T.ABC = triangle(z.A, z.B, z.C)
4356 local ken_circle = T.ABC:kenmotu_circle()
4357 z.K, z.T = ken_circle.center, ken_circle.through
4358 z.p1,z.p2,z.p3,z.p4,z.p5,z.p6 = T.ABC:kenmotu_points()
4359 z.p7 = z.p1 + z.p6 - z.K
4360 z.p8 = z.p2 + z.p3 - z.K
4361 z.p9 = z.p4 + z.p5 - z.K}
4362 \begin{center}
4363 \begin{tikzpicture}[scale = 1]
4364 \tkzGetNodes
4365 \tkzDrawCircles(K,T)
4366 \tkzFillPolygon[opacity=.4,red!40](K,p1,p7,p6)
4367 \tkzFillPolygon[opacity=.4,blue!40](K,p2,p8,p3)
4368 \tkzFillPolygon[opacity=.4,orange!40](K,p4,p9,p5)
4369 \tkzDrawPolygons(A,B,C)
4370 \tkzDrawPolygons(K,p1,p7,p6 K,p2,p8,p3 K,p4,p9,p5)
4371 \tkzDrawPolygons(A,B,C)
4372 \tkzDrawPoints(A,B,C,K)
4373 \tkzLabelPoints(B,C)
4374 \tkzDrawPoints[red](p1,p2,p3,p4,p5,p6,p7,p8,p9)
4375 \tkzLabelPoints[above](A)
4376 \tkzLabelPoints[above right](K)
4377 \end{tikzpicture}
4378 \end{center}
4379 \end{tkzexample}
4380
4381
4382
4383 \subsubsection{Method \tkzMeth{triangle}{thebault} or \tkzMeth{triangle}{c\_c} }
4384 \label{ssub:method_triangle_c_c}
4385
4386 The |c_c| (or |thebault|) method constructs a circle tangent to two sides of a triangle at a chosen vertex, and tangent to a given circle passing through the two remaining vertices.
4387
4388 \medskip
4389 \texttt{Name and purpose: }
4390
4391 Circle tangent to the two sides issuing from a vertex $p$ and tangent to the circle centered at $C$ passing through the other two vertices of the triangle.
4392 Alias: \code{triangle.thebault = triangle.c\_c}.
4393
4394 Given a non-degenerate triangle $ABC$ and a chosen vertex $p\in\{A,B,C\}$, this method constructs the unique circle $\mathcal{T}$ that
4395 \begin{itemize}
4396 \item is tangent to the two sides adjacent to $p$ (i.e.\ the lines through $p$ that contain the two incident edges of the triangle), and
4397 \item is tangent to the circle with center $C$ and radius equal to the distance from \(C\) to each of the two vertices \emph{other than} $p$.
4398 \end{itemize}
4399
4400 \texttt{Signature: }
4401
4402 \begin{verbatim}
4403 circle triangle:c_c(p, C)
4404 \end{verbatim}
4405
4406 \texttt{Parameters: }
4407
4408 \begin{description}
4409 \item[\code{p}] The chosen vertex of the triangle (\code{triangle.pa}, \code{.pb} or \code{.pc}). The method internally detects which vertex you passed.
4410 \item[\code{C}] The center of the reference circle through the other two vertices (i.e.\ if \(p=A\), then \(|CB|=|CC|=|C\!B|\) and the circle \(\mathcal{C}(C,|CB|)\) passes through \(B\) and \(C\)). In practice, \(C\) must lie on the perpendicular bisector of the segment joining those two vertices.
4411 \end{description}
4412
4413 \texttt{Return value: }
4414
4415 A \code{circle} object $\mathcal{T}$ tangent to the two sides adjacent to \(p\) and tangent to the circle $\mathcal{C}(C,\cdot)$ through the other two vertices.
4416
4417
4418 \texttt{Preconditions \& diagnostics :}
4419
4420 \begin{itemize}
4421 \item The triangle must be non-degenerate (three non-collinear points).
4422 \item The point \code{p} must coincide with one of the triangle’s vertices; otherwise the internal index resolution will be inconsistent.
4423 \item The point \code{C} must be equidistant from the two vertices other than \(p\) (i.e.\ it lies on their perpendicular bisector). If not, the “reference circle” is ill-defined for this problem and the construction may fail or produce an irrelevant circle.
4424 \end{itemize}
4425
4426 \texttt{Notes: }
4427
4428 \begin{itemize}
4429 \item This configuration is a classical variant often linked to Thébault-type constructions; for convenience an alias \code{triangle.thebault} is provided.
4430 \item The circle returned is tangent to the \emph{lines} supporting the two sides adjacent to \(p\). If you need the segment contact points explicitly, intersect the result with those lines and/or use orthogonal projections.
4431 \end{itemize}
4432
4433 \medskip
4434 \texttt{Example usage: }
4435
4436 \begin{tkzexample}[latex=.5\textwidth]
4437 \directlua{
4438 init_elements()
4439 z.A = point(2, 4)
4440 z.B = point(-3, 0)
4441 z.C = point(3, 0)
4442 T.ABC = triangle(z.A, z.B, z.C)
4443 L.med = T.ABC:mediator(z.A)
4444 z.Oa = L.med:point(1)
4445 C.main = circle(z.Oa, z.C)
4446 z.wa,
4447 z.Ea = T.ABC:thebault(z.A, C.main):get()
4448 }
4449 \begin{center}
4450 \begin{tikzpicture}%[ scale = 1]
4451 \tkzGetNodes
4452 \tkzDrawCircles(Oa,C)
4453 \tkzDrawCircles(wa,Ea)
4454 \tkzDrawPolygon[color = purple](A,B,C)
4455 \tkzDrawPoints(A,B,C,wa)
4456 \tkzLabelPoints(A,B,C,wa)
4457 \end{tikzpicture}
4458 \end{center}
4459 \end{tkzexample}
4460
4461 \medskip
4462 \texttt{Application: }
4463
4464 \begin{tkzexample}[latex=.5\textwidth]
4465 \directlua{
4466 init_elements()
4467 z.A = point(2, 4)
4468 z.B = point(-3, 0)
4469 z.C = point(3, 0)
4470 T.ABC = triangle(z.A, z.B, z.C)
4471 L.med = T.ABC:mediator(z.A)
4472 z.Oa = L.med:point(1)
4473 C.main = circle(z.Oa, z.C)
4474 z.wa,
4475 z.Ea = T.ABC:thebault(z.A, C.main):get()
4476 L.med = T.ABC:mediator(z.B)
4477 z.Ob = L.med:point(1)
4478 C.main = circle(z.Ob, z.C)
4479 z.wb,
4480 z.Eb = T.ABC:thebault(z.B, C.main):get()
4481 L.med = T.ABC:mediator(z.C)
4482 z.Oc = L.med:point(1)
4483 C.main = circle(z.Oc, z.A)
4484 z.wc,
4485 z.Ec = T.ABC:thebault(z.C, C.main):get()
4486 }
4487 \begin{center}
4488 \begin{tikzpicture}[scale = .7]
4489 \tkzGetNodes
4490 \tkzFillCircles[purple!20,opacity=.2](Oa,C)
4491 \tkzFillCircles[purple!40,opacity=.2](wa,Ea)
4492 \tkzFillCircles[green!20,opacity=.2](Ob,C)
4493 \tkzFillCircles[green!40,opacity=.2](wb,Eb)
4494 \tkzFillCircles[orange!20,opacity=.2](Oc,A)
4495 \tkzFillCircles[orange!40,opacity=.2](wc,Ec)
4496 \tkzDrawCircles(Oa,C Ob,C Oc,A)
4497 \tkzDrawCircles(wa,Ea wb,Eb wc,Ec)
4498 \tkzDrawPolygon[color = purple](A,B,C)
4499 \tkzDrawPoints(A,B,C,wa,wb,wc)
4500 \tkzLabelPoints(A,B,C,wa,wb,wc)
4501 \end{tikzpicture}
4502 \end{center}
4503 \end{tkzexample}
4504
4505
4506 \subsubsection{Method \tkzMeth{triangle}{mixtilinear\_incircle(arg)}}
4507 \label{ssub:method_triangle_mixti}
4508
4509 A circle that in internally tangent to two sides of a triangle and to the circumcircle is called a mixtilinear incircle. There are three mixtilinear incircles, one corresponding to each angle of the triangle.
4510 \begin{flushright}
4511 \small
4512 \href{https://mathworld.wolfram.com/MixtilinearIncircles.html}{MathWorld — van Lamoen, Floor. "Mixtilinear Incircles.}
4513 \end{flushright}
4514
4515 The argument is either one of the vertices of the triangle or an integer between $0$
4516 and $2$.
4517
4518 \begin{tkzexample}[latex=.52\textwidth]
4519 \directlua{
4520 z.A = point(0, 0)
4521 z.B = point(5, 0)
4522 z.C = point(-1, 4)
4523 T.ABC = triangle(z.A, z.B, z.C)
4524 C.mix = T.ABC:mixtilinear_incircle(z.B)
4525 z.w, z.t = C.mix:get()
4526 z.O = T.ABC.circumcenter}
4527 \begin{tikzpicture}
4528 \tkzGetNodes
4529 \tkzDrawCircles(w,t O,A)
4530 \tkzDrawPolygon(A,B,C)
4531 \tkzDrawPoints(A,B,C)
4532 \tkzLabelPoints(A,B)
4533 \tkzLabelPoints[above](C)
4534 \end{tikzpicture}
4535 \end{tkzexample}
4536
4537 \subsubsection{Method \tkzMeth{triangle}{three\_tangent\_circles}()}
4538 \label{ssub:method_triangle_three_tgt_c}
4539
4540 Any three points can serve as the centers of three mutually tangent circles.
4541 If we connect these centers, we obtain a triangle.
4542 The angle bisectors of this triangle meet at a single point called the \emph{incenter}.
4543 From this point, perpendiculars dropped to the three sides determine the points of tangency with an inscribed circle (the \emph{incircle}).
4544
4545 \medskip
4546 This incircle touches each side at exactly one point, and those points also serve as the common tangency points with the three outer circles.
4547 Each of these outer circles is defined by one vertex of the triangle (its center) and the tangency point opposite to it.
4548
4549 \medskip
4550 The method \tkzname{three\_tangent\_circles()} implements this geometric construction as follows:
4551 \begin{itemize}
4552 \item it computes the incenter of the triangle,
4553 \item finds the perpendicular projections of this incenter onto the three sides,
4554 \item and constructs the three outer circles, each passing through one vertex and tangent to the incircle.
4555 \end{itemize}
4556
4557
4558 \texttt{Return value: }
4559
4560 Three circle objects tangent to one another and to the triangle’s sides.
4561
4562
4563 \texttt{Example usage: }
4564
4565 % \begin{tkzexample}[latex=.45\textwidth]
4566 % \directlua{
4567 % init_elements()
4568 % z.A = point(0, 0)
4569 % z.B = point(5, 0)
4570 % z.C = point(1, 4)
4571 % T.ABC = triangle(z.A, z.B, z.C)
4572 % C.A,
4573 % C.B,
4574 % C.C = T.ABC:three_tangent_circles()
4575 % z.ta = C.A.through
4576 % z.tb = C.B.through
4577 % z.tc = C.C.through
4578 % C.ins = T.ABC:in_circle()
4579 % z.I, z.T = C.ins:get()}
4580 % \begin{center}
4581 % \begin{tikzpicture}[scale=.6]
4582 % \tkzGetNodes
4583 % \tkzDrawCircles(A,ta B,tb C,tc I,T)
4584 % \tkzDrawPolygon(A,B,C)
4585 % \tkzDrawPoints(A,B,C)
4586 % \tkzLabelPoints(A,B)
4587 % \tkzLabelPoints[above](C)
4588 % \end{tikzpicture}
4589 % \end{center}
4590 % \end{tkzexample}
4591
4592 \subsubsection{Method \tkzMeth{triangle}{three\_apollonius\_circles()}}
4593 \label{ssub:three_apollonius_circles}
4594
4595 This method constructs the three Apollonius circles of a non-degenerate triangle.
4596
4597 \medskip
4598 \texttt{Geometric background: }
4599 Given a triangle $ABC$ with side lengths $a = BC$, $b = CA$, and $c = AB$, one can
4600 associate to each vertex an Apollonius circle, defined as the locus of points $M$
4601 for which the ratio of distances to the two opposite vertices is fixed
4602 (in terms of the side lengths of the triangle).
4603
4604 These three Apollonius circles have the remarkable property that they intersect
4605 in exactly two common points, which are the isodynamic points of the triangle
4606 (see Method \tkzMeth{triangle}{isodynamic\_points()}).
4607
4608 \medskip
4609 \texttt{Description.}
4610 The method \code{three\_apollonius\_circles()} builds the three Apollonius circles
4611 associated with the triangle and returns them as circle objects.
4612
4613 \medskip
4614 \texttt{Return values: }
4615 \begin{itemize}
4616 \item \code{Ca} — Apollonius circle associated with side $a = BC$,
4617 \item \code{Cb} — Apollonius circle associated with side $b = CA$,
4618 \item \code{Cc} — Apollonius circle associated with side $c = AB$.
4619 \end{itemize}
4620
4621 \medskip
4622 \texttt{Example: }
4623 \begin{verbatim}
4624 Ca, Cb, Cc = T.ABC:three_apollonius_circles()
4625 \end{verbatim}
4626
4627 Each of \code{Ca}, \code{Cb}, and \code{Cc} is a \code{circle} object that can be
4628 used in further constructions (for instance, to compute the isodynamic points
4629 from their intersections).
4630
4631 \medskip
4632 \texttt{Application: }
4633
4634 \begin{tkzexample}[vbox]
4635 \directlua{%
4636 z.A = point (0, 0)
4637 z.B = point (4, 0)
4638 z.C = point (0, 3)
4639 T.ABC = triangle (z.A, z.B, z.C)
4640 C.ab, C.bc,
4641 C.ca = T.ABC:three_apollonius_circles()
4642 z.w1, z.t1 = C.ab:get()
4643 z.w2, z.t2 = C.bc:get()
4644 z.w3, z.t3 = C.ca:get()}
4645 \begin{center}
4646 \begin{tikzpicture}[scale=.5]
4647 \tkzGetNodes
4648 \tkzDrawLines[add = 2 and 2,
4649 dashed](A,B B,C C,A)
4650 \tkzDrawPolygons(A,B,C)
4651 \tkzDrawCircle[purple](O,A)
4652 \tkzDrawCircles[cyan](w1,t1 w2,t2 w3,t3)
4653 \tkzDrawLines[purple](w3,w2)
4654 \tkzDrawPoints(A,B,C,w1,w2,w3)
4655 \tkzLabelPoints(A,B,w1,w2,w3)
4656 \tkzLabelPoints[above](C)
4657 \end{tikzpicture}
4658 \end{center}
4659 \end{tkzexample}
4660
4661 \subsubsection{Method \tkzMeth{triangle}{apollonius\_circle(side, EPS)}}
4662 \label{ssub:apollonius_circle}
4663
4664 This method returns one of the three Apollonius circles of the triangle.
4665
4666 \medskip
4667
4668 \texttt{Description: }
4669 Given a triangle $ABC$, the method \code{apollonius\_circle(side)} constructs the
4670 Apollonius circle associated with the specified side:
4671 \begin{itemize}
4672 \item \code{"ab"} → Apollonius circle opposite vertex $C$,
4673 \item \code{"bc"} → Apollonius circle opposite vertex $A$,
4674 \item \code{"ca"} → Apollonius circle opposite vertex $B$.
4675 \end{itemize}
4676
4677 The optional parameter \code{EPS} controls numerical tolerance for the
4678 underlying intersection or ratio calculations.
4679 If omitted, it defaults to \code{tkz.epsilon}.
4680
4681 \medskip
4682 \texttt{Return value: }
4683 A single \code{circle} object corresponding to the chosen side.
4684
4685 \medskip
4686
4687 \texttt{Example: }
4688 \begin{verbatim}
4689 Cc = T.ABC:apollonius_circle("ab")
4690 \end{verbatim}
4691
4692 This circle can be used independently or as part of the construction of the
4693 three Apollonius circles or the isodynamic points.
4694
4695 \medskip
4696 \texttt{Application: }
4697
4698 \begin{tkzexample}[latex = .5\textwidth]
4699 \directlua{
4700 z.A = point(0, 0)
4701 z.B = point(5, 0)
4702 z.C = point(4.5, 2)
4703 T.ABC = triangle: new(z.A, z.B, z.C)
4704 C.apo_ab = T.ABC:apollonius_circle("ab")
4705 z.N,z.K = C.apo_ab:get()
4706 z.P,
4707 z.Q = T.ABC:apollonius_points("ab")}
4708 \begin{center}
4709 \begin{tikzpicture}[scale=.75]
4710 \tkzGetNodes
4711 \tkzDrawPolygons[red](A,B,C)
4712 \tkzDrawCircle(N,K)
4713 \tkzDrawLine[dashed](B,Q)
4714 \tkzDrawPoints(A,B,C,P,Q)
4715 \tkzLabelPoints(A,B)
4716 \tkzLabelPoints[above](C,P,Q)
4717 \end{tikzpicture}
4718 \end{center}
4719 \end{tkzexample}
4720
4721
4722
4723 \subsubsection{Method \tkzMeth{triangle}{feuerbach\_apollonius\_k181}(<EPS<)}
4724 \label{ssub:feuerbach_apollonius_k181}
4725
4726 This method constructs a circle through three points obtained from simple
4727 line--line intersections involving:
4728
4729 \begin{itemize}
4730 \item the three Feuerbach points $E_a,E_b,E_c$,
4731 \item the Apollonius point $K_{181}$ of the triangle,
4732 \item the Spieker center~$S$.
4733 \end{itemize}
4734
4735 \texttt{Construction idea: }
4736 For each Feuerbach point $E_a$, consider the lines
4737 $(A,K_{181})$ and $(S,E_a)$.
4738 Their intersection defines a point $x_a$.
4739 Repeating the process with $B,E_b$ and $C,E_c$ gives three points
4740 $x_a,x_b,x_c$ which always lie on a unique circle.
4741
4742 This circle is the \emph{Apollonius--K181 Feuerbach circle}.
4743
4744 \texttt{Usage: }
4745
4746 \begin{verbatim}
4747 local C = T.ABC:feuerbach_apollonius_k181()
4748 \end{verbatim}
4749
4750 \texttt{Return: }
4751 A \tkzClass{circle} object: the circumcircle of the three intersection points
4752 $x_a,x_b,x_c$.
4753
4754
4755
4756 \subsubsection{Method \tkzMeth{triangle}{feuerbach\_apollonius}(EPS)}
4757 \label{ssub:feuerbach_apollonius}
4758
4759 This method constructs a remarkable Apollonius-type circle associated with the
4760 triangle.
4761 The construction is based on three Feuerbach points and an inversion in a
4762 circle orthogonal to the excircle touching point.
4763
4764 \texttt{Definition: }
4765 Let $E_a,E_b,E_c$ be the three Feuerbach contact points of the triangle, and
4766 let $J_a$ be the excenter opposite to vertex~$A$.
4767 Let $C_{J_aE_a}$ be the circle with center $J_a$ passing through $E_a$, and
4768 let~$S$ be the Spieker center.
4769
4770 The circle $C_{J_aE_a}$ admits a unique orthogonal circle through $S$.
4771 Inverting the Euler circle in this orthogonal circle maps the three Feuerbach
4772 points to points $x_a,x_b,x_c$ which lie on a common circle.
4773 This is the \emph{Feuerbach--Apollonius circle}.
4774
4775 \paragraph{Usage: }
4776
4777 \begin{verbatim}
4778 local C = T.ABC:feuerbach_apollonius()
4779 \end{verbatim}
4780
4781 \texttt{Return: }
4782 A \code{circle} object: the circle passing through the three inverted
4783 Feuerbach points.
4784
4785
4786
4787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4788 %%%%% Triangles %%%%%
4789
4790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4791
4792 \subsection{Returns a triangle}
4793 \subsubsection{Method \tkzMeth{triangle}{medial()}} %(fold)
4794 \label{ssub:method_triangle_medial}
4795
4796 The \emph{medial triangle} of a triangle $ABC$ is the triangle formed by connecting the midpoints $M_a$, $M_b$, and $M_c$ of the sides $BC$, $AC$, and $AB$ respectively. This triangle is similar to the reference triangle and shares the same centroid.
4797
4798 The medial triangle is sometimes also called the \emph{auxiliary triangle} Dixon 1991. It appears frequently in classical geometry and serves as a useful tool for constructions involving symmetry, similarity, and triangle centers.
4799 \begin{flushright}
4800 \small
4801 \href{https://mathworld.wolfram.com/MedialTriangle.html}
4802 {\textit{Weisstein, Eric W. "Medial Triangle." From MathWorld—A Wolfram Web Resource.}}
4803 \end{flushright}
4804
4805 \vspace{1em}
4806
4807 \vspace{1em}
4808 \begin{minipage}{.5\textwidth}
4809 \directlua{
4810 init_elements()
4811 z.A = point(0, 1)
4812 z.B = point(5, 0)
4813 z.C = point(2, 4)
4814 T.ABC = triangle(z.A, z.B, z.C)
4815 T.med = T.ABC:medial()
4816 z.Ma, z.Mb, z.Mc= T.med:get()
4817 z.G = T.ABC.centroid
4818 z.O = T.ABC.circumcenter}
4819 \begin{center}
4820 \begin{tikzpicture}[scale = 1.2]
4821 \tkzGetNodes
4822 \tkzDrawPolygons(A,B,C)
4823 \tkzDrawPolygons[red](Ma,Mb,Mc)
4824 \tkzDrawSegments(A,Ma B,Mb C,Mc)
4825 \tkzDrawSegments[dashed,cyan](O,Ma O,Mb O,Mc)
4826 \tkzDrawPoints(A,B,C,Ma,Mb,Mc,O,G)
4827 \tkzLabelPoints(A,B,Mc,O)
4828 \tkzLabelPoints[above](C)
4829 \tkzLabelPoints[left](Mb)
4830 \tkzLabelPoints[right](Ma,G)
4831 \tkzMarkRightAngles[fill=cyan!20,
4832 opacity=.4](O,Ma,B O,Mb,A O,Mc,A)
4833 \end{tikzpicture}
4834 \end{center}
4835 \end{minipage}
4836 \begin{minipage}{.5\textwidth}
4837 \begin{tkzexample}[code only]
4838 \directlua{
4839 init_elements()
4840 z.A = point(0, 1)
4841 z.B = point(5, 0)
4842 z.C = point(2, 4)
4843 T.ABC = triangle(z.A, z.B, z.C)
4844 T.med = T.ABC:medial()
4845 z.Ma, z.Mb, z.Mc= T.med:get()
4846 z.G = T.ABC.centroid
4847 z.O = T.ABC.circumcenter}
4848 \end{tkzexample}
4849 \end{minipage}
4850
4851 \subsubsection{Method \tkzMeth{triangle}{orthic()}}
4852 \label{ssub:method_triangle_orthic}
4853
4854 Given a triangle $ABC$, the triangle $H_AH_BH_C$ formed by connecting the feet of the perpendiculars dropped from each vertex to the opposite side is called the \emph{orthic triangle}, or sometimes the \emph{altitude triangle}.
4855
4856 The points $H_A$, $H_B$, and $H_C$ are the feet of the altitudes from $A$, $B$, and $C$, respectively. The three altitudes $(AH_A)$, $(BH_B)$, and $(CH_C)$ are concurrent at a single point: the \emph{orthocenter} $H$ of the triangle $ABC$.
4857
4858 This method returns the triangle $H_AH_BH_C$ as a new triangle object.
4859
4860 \vspace{1em}
4861
4862 \begin{tkzexample}[latex=8cm]
4863 \directlua{
4864 init_elements()
4865 z.A = point(0, 0)
4866 z.B = point(5, 1)
4867 z.C = point(2, 4)
4868 T.ABC = triangle(z.A, z.B, z.C)
4869 T.H = T.ABC:orthic()
4870 z.Ha, z.Hb, z.Hc = T.H:get()
4871 z.H = T.ABC.orthocenter
4872 }
4873 \begin{tikzpicture}
4874 \tkzGetNodes
4875 \tkzDrawPolygon(A,B,C)
4876 \tkzDrawPolygon(Ha,Hb,Hc)
4877 \tkzDrawPoints(A,B,C,Ha,Hb,Hc,H)
4878 \tkzLabelPoints(A,B,C,Ha,Hb,Hc,H)
4879 \tkzMarkRightAngle(A,Hc,B)
4880 \tkzMarkRightAngle(B,Ha,C)
4881 \tkzMarkRightAngle(C,Hb,A)
4882 \end{tikzpicture}
4883 \end{tkzexample}
4884
4885 \subsubsection{Method \tkzMeth{triangle}{incentral()}}
4886 \label{ssub:method_incentral}
4887
4888 The \emph{incentral triangle} $I_aI_bI_c$ is the Cevian triangle of the reference triangle $ABC$ with respect to its incenter $I$. That is, the vertices of the incentral triangle are the points where the internal angle bisectors of triangle $ABC$ intersect the opposite sides.
4889
4890 This triangle is useful in many triangle center constructions, especially in connection with the incircle and the Gergonne point.\begin{flushright}
4891 \small
4892 \href{https://mathworld.wolfram.com/IncentralTriangle.html}{Weisstein, Eric W. "Incentral Triangle." From MathWorld--A Wolfram Web Resource.}
4893 \end{flushright}
4894
4895 \vspace{1em}
4896
4897 \vspace{1em}
4898 \begin{minipage}{.5\textwidth}
4899 \directlua{
4900 init_elements()
4901 z.A = point(0, 0)
4902 z.B = point(6, 0)
4903 z.C = point(1, 4)
4904 T.ABC = triangle(z.A, z.B, z.C)
4905 z.I = T.ABC.incenter
4906 z.Ia, z.Ib,
4907 z.Ic = T.ABC:incentral():get()
4908 z.Ta, z.Tb,
4909 z.Tc = T.ABC:intouch():get()}
4910 \begin{center}
4911 \begin{tikzpicture}
4912 \tkzGetNodes
4913 \tkzDrawPolygon(A,B,C)
4914 \tkzDrawPolygon[dashed,red](Ia,Ib,Ic)
4915 \tkzDrawSegments[dashed,red](A,Ia B,Ib C,Ic)
4916 \tkzDrawCircle(I,Ta)
4917 \tkzDrawPoints(A,B,C,Ia,Ib,Ic,I,Ta,Tb,Tc)
4918 \tkzLabelPoints(A,B,Ic,I,Tc)
4919 \tkzLabelPoints[above](Ia,Ta,C)
4920 \tkzLabelPoints[above left](Ib)
4921 \tkzLabelPoints[below left](Tb)
4922 \end{tikzpicture}
4923 \end{center}
4924 \end{minipage}
4925 \begin{minipage}{.5\textwidth}
4926 \begin{tkzexample}[code only]
4927 \directlua{
4928 init_elements()
4929 z.A = point(0, 0)
4930 z.B = point(6, 0)
4931 z.C = point(1, 4)
4932 T.ABC = triangle(z.A, z.B, z.C)
4933 z.I = T.ABC.incenter
4934 z.Ia, z.Ib,
4935 z.Ic = T.ABC:incentral():get()
4936 z.Ta, z.Tb,
4937 z.Tc = T.ABC:intouch():get()}
4938 \end{tkzexample}
4939 \end{minipage}
4940
4941 \subsubsection{Method \tkzMeth{triangle}{excentral()}}
4942 \label{ssub:method_triangle_excentral}
4943
4944 The \emph{excentral triangle}, also called the \emph{tritangent triangle}, of a reference triangle $ABC$ is the triangle $J_AJ_BJ_C$ whose vertices are the excenters of $ABC$. Each excenter is the intersection point of two external angle bisectors and one internal angle bisector of the triangle.
4945
4946 The excentral triangle plays an important role in triangle geometry, particularly in constructions involving the excircles, the Bevan circle, and certain triangle centers.
4947 \begin{flushright}
4948 \small
4949 \href{https://mathworld.wolfram.com/ExcentralTriangle.html}{Weisstein, Eric W. "Excentral Triangle." From MathWorld--A Wolfram Web Resource.}
4950 \end{flushright}
4951
4952 \vspace{1em}
4953
4954 \begin{tkzexample}[latex=.5\textwidth]
4955 \directlua{
4956 init_elements()
4957 z.A = point(0, 0)
4958 z.B = point(3, -0.5)
4959 z.C = point(1.2, 2)
4960 T.ABC = triangle(z.A, z.B, z.C)
4961 T.exc = T.ABC:excentral()
4962 z.I = T.ABC.incenter
4963 z.Ja, z.Jb, z.Jc = T.exc:get()
4964 z.Xa, _, _ = T.ABC:projections(z.Ja)
4965 z.Xb, _, _ = T.ABC:projections(z.Jb)
4966 z.Xc, _, _ = T.ABC:projections(z.Jc)}
4967 \begin{tikzpicture}[scale=.75]
4968 \tkzGetNodes
4969 \tkzDrawLines[add=1 and 1](A,B B,C C,A)
4970 \tkzDrawPolygon[cyan](A,B,C)
4971 \tkzDrawCircles[cyan](Ja,Xa Jb,Xb Jc,Xc)
4972 \tkzDrawPolygon[orange](Ja,Jb,Jc)
4973 \tkzDrawSegments[orange](A,Ja B,Jb C,Jc)
4974 \tkzDrawPoints(A,B,C,Ja,Jb,Jc,I)
4975 \tkzLabelPoints(A,B,Jc,I)
4976 \tkzLabelPoints[above](C,Ja,Jb)
4977 \end{tikzpicture}
4978 \end{tkzexample}
4979
4980 \subsubsection{Method \tkzMeth{triangle}{intouch()}}
4981 \label{ssub:method_triangle_intouch}
4982
4983 The \emph{contact triangle} of a triangle $ABC$, also known as the \emph{intouch triangle}, is the triangle $t_at_bt_c$ formed by the points of tangency of the incircle of $ABC$ with its three sides. These points are where the incircle touches $BC$, $AC$, and $AB$ respectively.
4984
4985 The intouch triangle is useful in studying properties related to the incircle and its associated centers such as the Gergonne point.
4986 \begin{flushright}
4987 \small
4988 \href{https://mathworld.wolfram.com/ContactTriangle.html}{Weisstein, Eric W. "Contact Triangle." From MathWorld--A Wolfram Web Resource.}
4989 \end{flushright}
4990
4991 \vspace{1em}
4992
4993 \begin{minipage}{.5\textwidth}
4994 \directlua{
4995 init_elements()
4996 z.a = point(1, 0)
4997 z.b = point(6, 3)
4998 z.c = point(1, 3)
4999 T.abc = triangle(z.a, z.b, z.c)
5000 z.g = T.abc:gergonne_point ()
5001 z.i = T.abc.incenter
5002 z.ta, z.tb,
5003 z.tc = T.abc:intouch():get()}
5004 \begin{tikzpicture}[scale=1.25]
5005 \tkzGetNodes
5006 \tkzDrawPolygons(a,b,c)
5007 \tkzDrawSegments(a,ta b,tb c,tc)
5008 \tkzDrawSegments[red](i,ta i,tb i,tc)
5009 \tkzDrawPoints(a,b,c)
5010 \tkzDrawPoints(g,i,ta,tb,tc)
5011 \tkzDrawCircle[red](i,ta)
5012 \tkzLabelPoints(tc,i,g)
5013 \tkzLabelPoints(a,b)
5014 \tkzLabelPoints[left](tb)
5015 \tkzLabelPoints[above](c,ta)
5016 \end{tikzpicture}
5017 \end{minipage}
5018 \begin{minipage}{.5\textwidth}
5019 \begin{tkzexample}[code only]
5020 \directlua{
5021 init_elements()
5022 z.a = point(1, 0)
5023 z.b = point(6, 3)
5024 z.c = point(1, 3)
5025 T.abc = triangle(z.a, z.b, z.c)
5026 z.g = T.abc:gergonne_point ()
5027 z.i = T.abc.incenter
5028 z.ta, z.tb,
5029 z.tc = T.abc:intouch():get()}
5030 \end{tkzexample}
5031 \end{minipage}
5032
5033 \subsubsection{Method \tkzMeth{triangle}{extouch()}}
5034 \label{ssub:method_triangle_extouch}
5035
5036 The \emph{extouch triangle} of a triangle $ABC$ is the triangle formed by the points of tangency of the triangle with its three \emph{excircles}. Each excircle is tangent to one side of the triangle and the extensions of the other two. The points of tangency lie respectively on the sides $BC$, $AC$, and $AB$.
5037
5038 The extouch triangle is the Cevian triangle of the \emph{Nagel point}, which is the point of concurrency of the segments joining the triangle's vertices to the points where the opposite excircles touch the triangle.
5039 \begin{flushright}
5040 \small
5041 \href{https://mathworld.wolfram.com/ExtouchTriangle.html}{Weisstein, Eric W. "Extouch Triangle." From MathWorld--A Wolfram Web Resource.}
5042 \end{flushright}
5043
5044 \vspace{1em}
5045
5046 \begin{mybox}
5047 \begin{tkzexample}[code only]
5048 z.E_a,z.E_b,z.E_c = T.ABC:cevian(z.Na):get()
5049 \end{tkzexample}
5050 \end{mybox}
5051
5052 \begin{minipage}{.55\textwidth}
5053 \directlua{
5054 init_elements()
5055 z.A = point(0, 0)
5056 z.B = point(3.6, 0)
5057 z.C = point(2.8, 4)
5058 T.ABC = triangle(z.A, z.B, z.C)
5059 z.Na = T.ABC:nagel_point()
5060 z.J_a,z.J_b,
5061 z.J_c = T.ABC:excentral():get()
5062 z.E_a,z.E_b,z.E_c = T.ABC:extouch():get()}
5063 \begin{center}
5064 \begin{tikzpicture}[scale=.8]
5065 \tkzGetNodes
5066 \tkzDrawPoints(A,B,C)
5067 \tkzDrawPoints[red,size=2](J_a,J_b,J_c)
5068 \tkzClipBB
5069 \tkzDrawLines[add=1.75 and 1.75,teal](A,B A,C B,C)
5070 \tkzDrawCircles(J_a,E_a J_b,E_b J_c,E_c)
5071 \tkzDrawSegments[orange](A,E_a B,E_b C,E_c)
5072 \tkzDrawPoints[red,size=2](Na,E_a,E_b,E_c)
5073 \tkzLabelPoints(A,B,Na)
5074 \tkzLabelPoints(E_c,J_a,J_b,J_c)
5075 \tkzLabelPoints[above](E_a,E_b,C)
5076 \end{tikzpicture}
5077 \end{center}
5078 \end{minipage}
5079 \begin{minipage}{.45\textwidth}
5080 \begin{tkzexample}[code only]
5081 \directlua{
5082 z.A = point(0, 0)
5083 z.B = point(3.6, 0)
5084 z.C = point(2.8, 4)
5085 T.ABC = triangle(z.A, z.B, z.C)
5086 z.Na = T.ABC:nagel_point()
5087 z.J_a,z.J_b,
5088 z.J_c = T.ABC:excentral():get()
5089 z.E_a,z.E_b,
5090 z.E_c = T.ABC:extouch():get()}
5091 \end{tkzexample}
5092 \end{minipage}
5093
5094 \subsubsection{Method \tkzMeth{triangle}{feuerbach()}}
5095 \label{ssub:method_triangle_feuerbach}
5096
5097 The \emph{Feuerbach triangle} of a reference triangle $ABC$ is the triangle formed by the three points of tangency between the \emph{nine-point circle} and the three \emph{excircles} of $ABC$.
5098
5099 By \emph{Feuerbach’s theorem}, each excircle is tangent to the nine-point circle, and these three tangency points define the Feuerbach triangle.
5100
5101 The circumcenter of the Feuerbach triangle coincides with the nine-point center of triangle $ABC$.
5102 \begin{flushright}
5103 \small
5104 \href{https://mathworld.wolfram.com/FeuerbachTriangle.html}{Weisstein, Eric W. "Feuerbach Triangle." From MathWorld--A Wolfram Web Resource.}
5105 \end{flushright}
5106
5107 \vspace{1em}
5108
5109 \begin{tkzexample}[latex=.5\textwidth]
5110 \directlua{
5111 init_elements()
5112 z.A = point(0, 0)
5113 z.B = point(6, 0)
5114 z.C = point(0.8, 4)
5115 T.ABC = triangle(z.A, z.B, z.C)
5116 z.N = T.ABC.eulercenter
5117 z.Fa, z.Fb,
5118 z.Fc = T.ABC:feuerbach():get()
5119 z.Ja, z.Jb,
5120 z.Jc = T.ABC:excentral():get()}
5121 \begin{tikzpicture}
5122 \tkzGetNodes
5123 \tkzInit[xmin=-1,xmax=7,ymin=-1,ymax=5]
5124 \tkzClip
5125 \tkzDrawPoints(Ja,Jb,Jc)
5126 \tkzDrawPolygons(Fa,Fb,Fc)
5127 \tkzFillCircles[green!30,
5128 opacity=.25](N,Fa)
5129 \tkzDrawLines[add=3 and 3](A,B A,C B,C)
5130 \tkzDrawCircles(Ja,Fa Jb,Fb Jc,Fc N,Fa)
5131 \tkzDrawPoints(A,B,C,Fa,Fb,Fc,N)
5132 \tkzLabelPoints(N,A,B,Fc)
5133 \tkzLabelPoints[above](Fa)
5134 \tkzLabelPoints[left](Fb,C)
5135 \end{tikzpicture}
5136 \end{tkzexample}
5137
5138 \subsubsection{Method \tkzMeth{triangle}{cevian()}}
5139 \label{ssub:method_triangle_cevian}
5140
5141 A \emph{Cevian} is a line segment that joins a vertex of a triangle to a point on the opposite side (or its extension). The condition for three Cevians to concur is given by \emph{Ceva's Theorem}.
5142
5143 Given a point $P$ in the interior of triangle $ABC$, the Cevians from each vertex through $P$ intersect the opposite sides at points $P_a$, $P_b$, and $P_c$. The triangle $P_aP_bP_c$ is called the \emph{Cevian triangle} of $ABC$ with respect to $P$.
5144
5145 The circumcircle of the triangle $P_aP_bP_c$ is known as the \emph{Cevian circle}.
5146 \begin{flushright}
5147 \small
5148 \href{https://mathworld.wolfram.com/CevianTriangle.html}{Weisstein, Eric W. "Cevian Triangle." From MathWorld--A Wolfram Web Resource.}
5149 \end{flushright}
5150
5151 \vspace{1em}
5152
5153 \vspace{1em}
5154 \begin{minipage}{.5\textwidth}
5155 \directlua{
5156 init_elements()
5157 z.A = point(0, 0)
5158 z.B = point(4, 0)
5159 z.C = point(1.8, 3)
5160 T.ABC = triangle(z.A, z.B, z.C)
5161 z.Q = point(1, -0.4)
5162 z.P = point(2, 1)
5163 T.cevian = T.ABC:cevian(z.Q)
5164 z.Qa, z.Qb, z.Qc = T.cevian:get()
5165 T.cevian = T.ABC:cevian(z.P)
5166 z.Pa, z.Pb, z.Pc = T.cevian:get()
5167 C.cev = T.ABC:cevian_circle(z.P)
5168 z.w = C.cev.center
5169 }
5170 \begin{center}
5171 \begin{tikzpicture}
5172 \tkzGetNodes
5173 \tkzDrawPolygons[cyan](A,B,C)
5174 \tkzDrawSegments[cyan](A,Qb B,Qa)
5175 \tkzDrawSegments[red](A,Qa B,Qb C,Q)
5176 \tkzDrawSegments[blue](A,Pa B,Pb C,Pc)
5177 \tkzDrawCircles(w,Pa)
5178 \tkzDrawPoints(A,B,C,Qa,Qb,Qc,P,Q,Pa,Pb,Pc)
5179 \tkzLabelPoints(A,B,P,Q,Pc)
5180 \tkzLabelPoints[above](C,Qc)
5181 \tkzLabelPoints[left](Qb,Pb)
5182 \tkzLabelPoints[right](Qa,Pa)
5183 \end{tikzpicture}
5184 \end{center}
5185 \end{minipage}
5186 \begin{minipage}{.5\textwidth}
5187 \begin{tkzexample}[code only]
5188 \directlua{
5189 init_elements()
5190 z.A = point(0, 0)
5191 z.B = point(4, 0)
5192 z.C = point(1.8, 3)
5193 T.ABC = triangle(z.A, z.B, z.C)
5194 z.Q = point(1, -0.4)
5195 z.P = point(2, 1)
5196 T.cevian = T.ABC:cevian(z.Q)
5197 z.Qa, z.Qb, z.Qc = T.cevian:get()
5198 T.cevian = T.ABC:cevian(z.P)
5199 z.Pa, z.Pb, z.Pc = T.cevian:get()
5200 C.cev = T.ABC:cevian_circle(z.P)
5201 z.w = C.cev.center}
5202 \end{tkzexample}
5203 \end{minipage}
5204
5205 \subsubsection{Method \tkzMeth{triangle}{symmedian()}} %(fold)
5206 \label{ssub:method_triangle_symmedial}
5207
5208 The lines $AL_a$, $BL_b$, and $CL_c$ which are isogonal to the triangle medians $AM_a$, $BM_b$, and $CM_c$ of a triangle are called the triangle's \code{symmedian}. The symmedians are concurrent in a point $L$ called the \code{Lemoine} point or the \code{symmedian} point which is the isogonal conjugate of the triangle centroid $G$.
5209
5210 The \code{symmedial} or \code{symmedian} triangle $L_aL_bL-c$ is the triangle whose vertices are the intersection points of the symmedians with the reference triangle $ABC$.
5211
5212 The following example groups several concepts around the symmedian. As a reminder, a symmedian of a triangle is the reflection of the median with respect to the angle bisector.
5213 \begin{flushright}
5214 \small
5215 \href{https://mathworld.wolfram.com/SymmedianPoint.html}{Weisstein, Eric W. "Symmedian Point." From MathWorld--A Wolfram Web Resource.}
5216 \end{flushright}
5217
5218 \vspace{1em}
5219
5220 \begin{minipage}{.5\textwidth}
5221 \directlua{
5222 init_elements()
5223 z.A = point(1, 2)
5224 z.B = point(5, 1)
5225 z.C = point(3, 5)
5226 T.ABC = triangle(z.A, z.B, z.C)
5227 T.SY = T.ABC:symmedian ()
5228 z.L_a,z.L_b,z.L_c = T.SY:get()
5229 z.L = T.ABC:lemoine_point()}
5230 \begin{tikzpicture}
5231 \tkzGetNodes
5232 \tkzDrawPolygon(A,B,C)
5233 \tkzDrawPoints(A,B,C)
5234 \tkzDrawPolygon[cyan](L_a,L_b,L_c)
5235 \tkzDrawPoints[red](L,L_a,L_b,L_c)
5236 \tkzDrawSegments[dashed,
5237 orange](A,L_a B,L_b C,L_c)
5238 \tkzLabelPoints(A,B,L_c)
5239 \tkzLabelPoints[above](C)
5240 \tkzLabelPoints[left](L_b)
5241 \tkzLabelPoints[right](L_a)
5242 \tkzLabelPoint[left](L){$L$}
5243 \end{tikzpicture}
5244 \end{minipage}
5245 \begin{minipage}{.5\textwidth}
5246 \begin{tkzexample}[code only]
5247 \directlua{
5248 init_elements()
5249 z.A = point(1, 2)
5250 z.B = point(5, 1)
5251 z.C = point(3, 5)
5252 T.ABC = triangle(z.A, z.B, z.C)
5253 T.SY = T.ABC:symmedian ()
5254 z.L_a,z.L_b,z.L_c = T.SY:get()
5255 z.L = T.ABC:lemoine_point()}
5256 \end{tkzexample}
5257 \end{minipage}
5258
5259 \subsubsection{Method \tkzMeth{triangle}{euler()}}
5260 \label{ssub:method_triangle_euler}
5261
5262 The \emph{Euler triangle} of a triangle $ABC$ is the triangle $E_AE_BE_C$ whose vertices are the midpoints of the segments joining the orthocenter $H$ to each of the respective vertices. These points, called the \emph{Euler points}, lie on the \code{nine-point} circle and are among the nine classical points of triangle geometry.
5263 \begin{flushright}
5264 \small
5265 \href{https://mathworld.wolfram.com/EulerTriangle.html}{Weisstein, Eric W. "Euler Triangle." From MathWorld--A Wolfram Web Resource.}
5266 \end{flushright}
5267
5268 \vspace{1em}
5269
5270
5271 \begin{minipage}{.5\textwidth}
5272 \directlua{
5273 init_elements()
5274 z.A = point(0, 0)
5275 z.B = point(5, 0)
5276 z.C = point(1, 4)
5277 T.ABC = triangle(z.A, z.B, z.C)
5278 z.N = T.ABC.eulercenter
5279 z.H = T.ABC.orthocenter
5280 T.euler = T.ABC:euler()
5281 z.E_A,
5282 z.E_B,
5283 z.E_C = T.euler:get ()
5284 z.H_A,
5285 z.H_B,
5286 z.H_C = T.ABC:orthic():get ()}
5287 \begin{tikzpicture}
5288 \tkzGetNodes
5289 \tkzDrawPolygons[cyan](A,B,C)
5290 \tkzDrawPolygons[red](E_A,E_B,E_C)
5291 \tkzDrawCircle[purple](N,E_A)
5292 \tkzDrawSegments[dashed](A,H_A B,H_B C,H_C)
5293 \tkzDrawPoints(E_A,E_B,E_C,H_A,H_B,H_C,H)
5294 \tkzLabelPoints(A,B,H)
5295 \tkzLabelPoints[above](C,E_C)
5296 \tkzLabelPoints(E_A,E_B)
5297 \end{tikzpicture}
5298 \end{minipage}
5299 \begin{minipage}{.5\textwidth}
5300 \begin{tkzexample}[code only]
5301 \directlua{
5302 init_elements()
5303 z.A = point(0, 0)
5304 z.B = point(5, 0)
5305 z.C = point(1, 4)
5306 T.ABC = triangle(z.A, z.B, z.C)
5307 z.N = T.ABC.eulercenter
5308 z.H = T.ABC.orthocenter
5309 T.euler = T.ABC:euler()
5310 z.E_A,
5311 z.E_B,
5312 z.E_C = T.euler:get ()
5313 z.H_A,
5314 z.H_B,
5315 z.H_C = T.ABC:orthic():get ()}
5316 \end{tkzexample}
5317 \end{minipage}
5318
5319 \subsubsection{Method \tkzMeth{triangle}{yiu()}}
5320 \label{ssub:method_triangle_yiu}
5321 The Yiu triangle $O_AO_BO_C$ is the triangle formed by the centers of the Yiu circles. See [\ref{ssub:method_yiu_circles}]
5322
5323 \begin{tkzexample}[latex=.5\textwidth]
5324 \directlua{
5325 z.A = point(-.2, 2)
5326 z.B = point(0, 0)
5327 z.C = point(2, 0)
5328 T.ABC = triangle(z.A, z.B, z.C)
5329 T.Yiu = T.ABC:yiu()
5330 z.O_A, z.O_B,
5331 z.O_C = T.Yiu:get()}
5332 \begin{center}
5333 \begin{tikzpicture}
5334 \tkzGetNodes
5335 \tkzInit[xmin=-3,xmax=4,ymin=-2.5,ymax=3]
5336 \tkzClip
5337 \tkzDrawPolygon(A,B,C)
5338 \tkzDrawPolygon[red](O_A,O_B,O_C)
5339 \tkzDrawCircles[blue](O_A,A O_B,B O_C,C)
5340 \tkzDrawPoints(A,B,C,O_A,O_B,O_C)
5341 \tkzLabelPoints(B,C,O_A,O_B)
5342 \tkzLabelPoints[above](A,O_C)
5343 \end{tikzpicture}
5344 \end{center}
5345 \end{tkzexample}
5346
5347 \subsubsection{Method \tkzMeth{triangle}{projection()}}
5348 \label{ssub:method_triangle_projection}
5349 This method returns a triangle whose vertices are the projections of the original triangle's vertices with respect to the opposite sides.
5350
5351 The result is the orthic triangle.
5352
5353 \begin{tkzexample}[latex=.5\textwidth]
5354 \directlua{%
5355 z.A = point(2, 5)
5356 z.B = point(0, 0)
5357 z.C = point(6, 0)
5358 T.ABC = triangle(z.A,z.B,z.C)
5359 T.orthic = T.ABC:projection()
5360 z.Ap,
5361 z.Bp,
5362 z.Cp = T.orthic:get()
5363 }
5364 \begin{center}
5365 \begin{tikzpicture}
5366 \tkzGetNodes
5367 \tkzDrawPolygons(A,B,C A',B',C')
5368 \tkzDrawPoints(A,B,C,A',B',C')
5369 \tkzLabelPoints(B,C,A')
5370 \tkzLabelPoints[above](A,B',C')
5371 \end{tikzpicture}
5372 \end{center}
5373 \end{tkzexample}
5374
5375
5376 \subsubsection{Method \tkzMeth{triangle}{reflection()}}
5377 \label{ssub:method_triangle_reflection}
5378
5379 This method returns a triangle whose vertices are the reflections of the original triangle's vertices with respect to the opposite sides. That is, each vertex is reflected across the side opposite to it.
5380
5381 \begin{tkzexample}[latex=.5\textwidth]
5382 \directlua{%
5383 z.A = point(-.2, 2)
5384 z.B = point(0, 0)
5385 z.C = point(2, 0)
5386 T.ABC = triangle(z.A,z.B,z.C)
5387 z.Ap,
5388 z.Bp,
5389 z.Cp = T.ABC:reflection():get()
5390 }
5391 \begin{tikzpicture}
5392 \tkzGetNodes
5393 \tkzDrawPolygons(A,B,C A',B',C')
5394 \tkzDrawPoints(A,B,C,A',B',C')
5395 \tkzLabelPoints(B,C,A',C')
5396 \tkzLabelPoints[above](A,B')
5397 \end{tikzpicture}
5398 \end{tkzexample}
5399
5400 \subsubsection{Method \tkzMeth{triangle}{circumcevian(pt)}}
5401 \label{ssub:method_triangle_circumcevian}
5402
5403 Given a triangle $ABC$ and a point $P$ not located at a vertex, the \emph{circumcevian triangle} is defined as follows: let $A'$ be the second point of intersection (other than $A$) between the line $(AP)$ and the circumcircle of $ABC$; define $B'$ and $C'$ analogously for lines $(BP)$ and $(CP)$. The triangle $A'B'C'$ is then called the \emph{circumcevian triangle} of $ABC$ with respect to point $P$.
5404
5405 \vspace{1em}
5406
5407 \begin{tkzexample}[latex=6cm]
5408 \directlua{
5409 z.A = point(0, 0)
5410 z.B = point(5, 0)
5411 z.C = point(2, 4)
5412 T.ABC = triangle(z.A, z.B, z.C)
5413 z.H = T.ABC.orthocenter
5414 z.O = T.ABC.circumcenter
5415 z.Ha, z.Hb, z.Hc = T.ABC:orthic():get()
5416 z.a, z.b, z.c = T.ABC:tangential():get()
5417 z.p, z.q, z.r = T.ABC:circumcevian(z.H):get()
5418 }
5419 \begin{center}
5420 \begin{tikzpicture}[ scale = .5]
5421 \tkzGetNodes
5422 \tkzDrawPolygons[red](A,B,C a,b,c)
5423 \tkzDrawCircle(O,A)
5424 \tkzDrawPoints(A,B,C,O,H,p,q,r)
5425 \tkzDrawSegments[red](C,Hc B,Hb A,Ha)
5426 \tkzDrawPolygons[blue](Ha,Hb,Hc)
5427 \tkzLabelPoints(A,B,C,O,a,b,c)
5428 \tkzLabelPoints[font=\small](Hc)
5429 \tkzLabelPoints[font=\small,above](Ha,Hb)
5430 \end{tikzpicture}
5431 \end{center}
5432
5433 \end{tkzexample}
5434
5435 \subsubsection{Method \tkzMeth{triangle}{tangential()}} %(fold)
5436 \label{ssub:method_triangle_tangential}
5437
5438 The tangential triangle is the triangle $TaTbTc$ formed by the lines tangent to the circumcircle of a given triangle DeltaABC at its vertices. It is therefore antipedal triangle of $ABC$ with respect to the circumcenter $O$. It is also anticevian triangle of $ABC$ with the symmedian point $K$ as the anticevian point(Kimberling 1998, p. 156). Furthermore, the symmedian point $K$ of $ABC$ is the Gergonne point of $TaTbTc$.
5439
5440 The sides of an orthic triangle are parallel to the tangents to the circumcircle at the vertices(Johnson 1929, p. 172). This is equivalent to the statement that each line from a triangle's circumcenter to a vertex is always perpendicular to the corresponding side of the orthic triangle(Honsberger 1995, p. 22), and to the fact that the orthic and tangential triangles are homothetic.\begin{flushright}
5441 \small
5442 \href{https://mathworld.wolfram.com/TangentialTriangle.html}{Weisstein, Eric W. "Tangential Triangle." From MathWorld--A Wolfram Web Resource.}
5443 \end{flushright}
5444
5445 \vspace{1em}
5446 \begin{minipage}{.5\textwidth}
5447 \directlua{
5448 init_elements()
5449 z.A = point(0, 0)
5450 z.B = point(4, 0)
5451 z.C = point(2, 3)
5452 T.ABC = triangle(z.A, z.B, z.C)
5453 z.H = T.ABC.orthocenter
5454 z.O = T.ABC.circumcenter
5455 z.L = T.ABC:symmedian_point()
5456 T.orthic = T.ABC:orthic()
5457 z.Ha,
5458 z.Hb,
5459 z.Hc = T.orthic:get()
5460 z.Ta,
5461 z.Tb,
5462 z.Tc = T.ABC:tangential():get()}
5463 \begin{center}
5464 \begin{tikzpicture}[scale = .75,rotate=60]
5465 \tkzGetNodes
5466 \tkzDrawPolygons[red](A,B,C Ta,Tb,Tc)
5467 \tkzDrawCircle(O,A)
5468 \tkzDrawPoints(A,B,C,O,H,Ta,Tb,Tc,L)
5469 \tkzDrawSegments[red](C,Hc B,Hb A,Ha)
5470 \tkzDrawSegments[cyan](C,Tc B,Tb A,Ta)
5471 \tkzDrawPolygon[blue](Ha,Hb,Hc)
5472 \tkzLabelPoints(A,O,Tc)
5473 \tkzLabelPoints[above](C,Ta)
5474 \tkzLabelPoints[right](Hc,B)
5475 \tkzLabelPoints[left](Hb,Tb)
5476 \tkzLabelPoints[above](Ha)
5477 \tkzMarkRightAngles(A,Ha,C B,Hb,A C,Hc,B)
5478 \end{tikzpicture}
5479 \end{center}
5480
5481 \end{minipage}
5482 \begin{minipage}{.5\textwidth}
5483 \begin{tkzexample}[code only]
5484 \directlua{
5485 init_elements()
5486 z.A = point(0, 0)
5487 z.B = point(4, 0)
5488 z.C = point(2, 3)
5489 T.ABC triangle(z.A, z.B, z.C)
5490 z.H = T.ABC.orthocenter
5491 z.O = T.ABC.circumcenter
5492 z.L = T.ABC:symmedian_point()
5493 T.orthic = T.ABC:orthic()
5494 z.Ha,
5495 z.Hb,
5496 z.Hc = T.orthic:get()
5497 z.Ta,
5498 z.Tb,
5499 z.Tc = T.ABC:tangential():get()}
5500 \end{tkzexample}
5501 \end{minipage}
5502
5503 \subsubsection{Method \tkzMeth{triangle}{anti()}} %(fold)
5504 \label{ssub:method_triangle_anti}
5505
5506 The \emph{anticomplementary triangle} of a reference triangle $ABC$ is the triangle $TaTbTc$ whose medial triangle is $ABC$. It is also known as the \emph{anticevian triangle} of the centroid $G$ (see Kimberling 1998, p.~156). This triangle is obtained by extending each side of the reference triangle beyond its vertices such that the new triangle is homothetic to the reference triangle with ratio $-2$ and center $G$.\begin{flushright}
5507 \small
5508 \href{https://mathworld.wolfram.com/AnticomplementaryTriangle.html}{Weisstein, Eric W. "Anticomplementary Triangle." From MathWorld--A Wolfram Web Resource.}
5509 \end{flushright}
5510
5511 \medskip
5512
5513 This method constructs a new triangle whose sides are parallel to the sides of the original triangle and which pass through its vertices.
5514
5515 \medskip
5516
5517 This triangle can be obtained using any of the following method names: \code{anti}, \code{anticomplementary}, or \code{similar}.
5518
5519 \vspace{1em}
5520
5521
5522
5523 The anticomplementary triangle is the triangle $TaTbTc$ which has a given triangle $ABC$ as its medial triangle. It is therefore the anticevian triangle with respect to the triangle centroid G(Kimberling 1998, p. 156).\begin{flushright}
5524 \small
5525 \href{https://mathworld.wolfram.com/AnticomplementaryTriangle.html}{Weisstein, Eric W. "Anticomplementary Triangle." From MathWorld--A Wolfram Web Resource.}
5526 \end{flushright}
5527
5528 This method creates a new triangle whose sides are parallel to the sides of the original triangle and pass through its vertices.
5529 You have several method names for obtaining this triangle: either \code{anticomplementary} or \code{similar}.
5530
5531 \vspace{1em}
5532
5533 \begin{minipage}{.5\textwidth}
5534 \directlua{
5535 init_elements()
5536 z.A = point(0, 0)
5537 z.B = point(5, 0)
5538 z.C = point(2, 4)
5539 T.ABC = triangle(z.A, z.B, z.C)
5540 T.similar = T.ABC:anti()
5541 z.Ta,
5542 z.Tb,
5543 z.Tc = T.similar:get()}
5544 \begin{center}
5545 \begin{tikzpicture}[scale = .5]
5546 \tkzGetNodes
5547 \tkzDrawPolygons[red](A,B,C)
5548 \tkzDrawPolygon[blue](Ta,Tb,Tc)
5549 \tkzDrawPoints(A,B,C,Ta,Tb,Tc)
5550 \tkzLabelPoints(A,B,Tc)
5551 \tkzLabelPoints[above](Ta,Tb,C)
5552 \end{tikzpicture}
5553 \end{center}
5554 \end{minipage}
5555 \begin{minipage}{.5\textwidth}
5556 \begin{tkzexample}[code only]
5557 \directlua{
5558 init_elements()
5559 z.A = point(0, 0)
5560 z.B = point(5, 0)
5561 z.C = point(2, 4)
5562 T.ABC = triangle(z.A, z.B, z.C)
5563 T.similar = T.ABC:anti()
5564 z.Ta,
5565 z.Tb,
5566 z.Tc = T.similar:get()}
5567 \end{tkzexample}
5568 \end{minipage}
5569
5570 \subsubsection{Method \tkzMeth{triangle}{lemoine()}}
5571 \label{ssub:method_triangle_lemoine}
5572
5573 The \emph{Lemoine triangle} of a reference triangle $ABC$ is the Cevian triangle associated with the Kimberling center $X_{(598)}$. Its vertices are the points of tangency between the \emph{Lemoine inellipse} and the sides of triangle $ABC$.
5574
5575 \medskip
5576
5577 This triangle provides an elegant construction linked to the geometry of the Lemoine point and highlights interesting affine properties. The method returns the triangle formed by these three tangency points.
5578
5579 \vspace{1em}
5580 \begin{tkzexample}[latex=.5\textwidth]
5581 \directlua{
5582 z.A = point(0, 0)
5583 z.B = point(5, 0)
5584 z.C = point(4.6, 3)
5585 T.ABC = triangle(z.A, z.B, z.C)
5586 z.L = T.ABC:lemoine_point()
5587 z.G = T.ABC.centroid
5588 CO.EL = T.ABC:lemoine_inellipse()
5589 curve = CO.EL:points(0, 1, 100)
5590 z.Xa, z.Xb,
5591 z.Xc = T.ABC:lemoine():get()}
5592 \begin{tikzpicture}
5593 \tkzGetNodes
5594 \tkzDrawCoordinates[smooth,red](curve)
5595 \tkzDrawPolygons[cyan](A,B,C Xa,Xb,Xc)
5596 \tkzDrawPoints(A,B,L,Xa,Xb,Xc,G)
5597 \tkzLabelPoints(A,B,L,G)
5598 \tkzLabelPoints[above](C)
5599 \end{tikzpicture}
5600 \end{tkzexample}
5601
5602 \subsubsection{Method \tkzMeth{triangle}{macbeath()}}
5603 \label{ssub:method_triangle_macbeath}
5604 The MacBeath triangle, is the triangle whose vertices are the contact points of the MacBeath inconic with the reference triangle. $MB$ is the MacBeath point
5605
5606 \begin{tkzexample}[latex=.5\textwidth]
5607 \directlua{
5608 init_elements()
5609 z.A = point(.5, 3)
5610 z.B = point(0, 0)
5611 z.C = point(5, 0)
5612 T.ABC = triangle(z.A, z.B, z.C)
5613 z.MB = T.ABC:kimberling(264)
5614 z.Xa, z.Xb,
5615 z.Xc = T.ABC:macbeath():get()}
5616 \begin{tikzpicture}
5617 \tkzGetNodes
5618 \tkzDrawPolygons(A,B,C Xa,Xb,Xc)
5619 \tkzDrawSegments(A,Xa B,Xb C,Xc)
5620 \tkzDrawPoints(A,B,C,MB,Xa,Xb,Xc)
5621 \tkzLabelPoints(B,C,MB)
5622 \tkzLabelPoints[above](A)
5623 \end{tikzpicture}
5624 \end{tkzexample}
5625
5626
5627 %%%%%%%%%%%%%%%%%%%
5628 %%%% Conic
5629 %%%%%%%%%%%%%%%%%%%%
5630
5631
5632 \subsection{Returns a conic}
5633
5634 As the code is relatively large, I've avoided including the \tkzNamePack{tkz-euclide} part in most of the examples. You can find the complete code in the source of this document in the file \code{TKZdoc-elements-triangle.tex}.
5635
5636 The most important point is to trace the conics, which is done with the help of a tool:
5637
5638 \begin{mybox}
5639 \begin{verbatim}
5640 \tkzDrawCoordinates[smooth,cyan](curve)
5641 \end{verbatim}
5642 \end{mybox}
5643
5644 \subsubsection{Method \tkzMeth{triangle}{kiepert\_parabola}}
5645 \label{ssub:method_triangle_kiepert_parabola}
5646
5647 Among all parabolas tangent to the sides of a triangle, the \emph{Kiepert parabola} is distinguished by its geometric properties. Its directrix coincides with the Euler line of the triangle, and it is also tangent to the \emph{Lemoine axis}.
5648
5649 \medskip
5650
5651 This parabola encapsulates rich affine and projective structures and arises in various advanced triangle geometry contexts.
5652
5653 \begin{minipage}{.5\textwidth}
5654 \directlua{
5655 init_elements()
5656 z.A = point(0, 0)
5657 z.B = point(6, 0)
5658 z.C = point(1.1, 4.5)
5659 T.ABC = triangle(z.A, z.B, z.C)
5660 z.H = T.ABC.orthocenter
5661 z.O = T.ABC.circumcenter
5662 kiepert = T.ABC:kiepert_parabola()
5663 curve = kiepert:points(-5, 7, 50)
5664 z.F = kiepert.Fa
5665 z.S = kiepert.vertex
5666 z.K = kiepert.K
5667 z.a = intersection(kiepert, T.ABC.ab)
5668 z.b = intersection(kiepert, T.ABC.bc)
5669 z.c = intersection(kiepert, T.ABC.ca)}
5670 \begin{tikzpicture}[scale=.6]
5671 \tkzGetNodes
5672 \tkzDrawPolygon[cyan](A,B,C)
5673 \tkzDrawPolygon[red](a,b,c)
5674 \tkzDrawLines[purple,
5675 add = .5 and .5](O,H K,F)
5676 \tkzDrawCoordinates[smooth,
5677 red](curve)
5678 \tkzDrawPoints(A,B,C,F,O,H,K,a,b,c)
5679 \tkzDrawSegments(C,c C,b)
5680 \tkzLabelPoints(B,O,H,K,a,b)
5681 \tkzLabelPoints[above](C)
5682 \tkzLabelPoints[left](A)
5683 \tkzLabelPoints[right](F,c)
5684 \end{tikzpicture}
5685 \end{minipage}
5686 \begin{minipage}{.5\textwidth}
5687 \begin{tkzexample}[code only]
5688 \directlua{
5689 init_elements()
5690 z.A = point(0, 0)
5691 z.B = point(6, 0)
5692 z.C = point(1.1, 4.5)
5693 T.ABC = triangle(z.A, z.B, z.C)
5694 z.H = T.ABC.orthocenter
5695 z.O = T.ABC.circumcenter
5696 kiepert = T.ABC:kiepert_parabola()
5697 curve = kiepert:points(-5, 7, 50)
5698 z.F = kiepert.Fa
5699 z.S = kiepert.vertex
5700 z.K = kiepert.K
5701 z.a = intersection(kiepert, T.ABC.ab)
5702 z.b = intersection(kiepert, T.ABC.bc)
5703 z.c = intersection(kiepert, T.ABC.ca)}
5704 \end{tkzexample}
5705 \end{minipage}
5706
5707 \subsubsection{Method \tkzMeth{triangle}{kiepert\_hyperbola()}}
5708 \label{ssub:method_triangle_kiepert__hyperbola}
5709
5710 The \emph{Kiepert hyperbola} is a remarkable triangle conic that arises from Lemoine’s problem and its extension involving isosceles triangles constructed externally on the sides of a given triangle.
5711
5712 \medskip
5713
5714 This hyperbola possesses several notable geometric properties: it passes through the three vertices of the triangle, its centroid, and its orthocenter.
5715 \begin{flushright}
5716 \small
5717 \href{https://mathworld.wolfram.com/KiepertHyperbola.html}{Weisstein, Eric W. "Kiepert Hyperbola." From MathWorld--A Wolfram Web Resource.}
5718 \end{flushright}
5719
5720 \begin{minipage}{.5\textwidth}
5721 \directlua{
5722 init_elements()
5723 z.A = point(0, 0)
5724 z.B = point(5, 0)
5725 z.C = point(4, 4)
5726 T.ABC = triangle(z.A, z.B, z.C)
5727 z.K = T.ABC:kimberling(115)
5728 z.circumcenter = T.ABC.circumcenter
5729 z.G = T.ABC.centroid
5730 L.brocard = T.ABC:brocard_axis()
5731 C.circum = circle(z.circumcenter, z.A)
5732 z.M, z.N = intersection(L.brocard, C.circum)
5733 L.asx = T.ABC:simson_line(z.M)
5734 L.asy = T.ABC:simson_line(z.N)
5735 z.ux, z.uy = L.asx:get()
5736 z.vx, z.vy = L.asy:get()
5737 CO.HY = T.ABC:kiepert_hyperbola()
5738 curve = CO.HY:points(-3, 3, 50)
5739 curveb = CO.HY:points(-3, 3, 50, "swap")
5740 z.F_a, z.F_b = CO.HY.Fa, CO.HY.Fb}
5741 \begin{tikzpicture}[scale = .8]
5742 \tkzInit[xmin=-1,xmax=7,ymin=-2,ymax=8]
5743 \tkzClip
5744 \tkzGetNodes
5745 \tkzDrawPolygons(A,B,C)
5746 \tkzDrawCoordinates[smooth](curve)
5747 \tkzDrawCoordinates[smooth](curveb)
5748 \tkzDrawLines(A,B A,C B,C F_a,F_b)
5749 \tkzDrawLines[red,add = 8 and 5](K,vy)
5750 \tkzDrawLines[red,add = 2 and 1](K,uy)
5751 \tkzDrawPoints(A,B,C,K,G,F_a,F_b)
5752 \tkzLabelPoints(A,B,C,G)
5753 \tkzLabelPoints[right](F_a,F_b,K)
5754 \end{tikzpicture}
5755 \end{minipage}
5756 \begin{minipage}{.5\textwidth}
5757 \begin{tkzexample}[code only]
5758 \directlua{
5759 init_elements()
5760 z.A = point(0, 0)
5761 z.B = point(5, 0)
5762 z.C = point(4, 4)
5763 T.ABC = triangle(z.A, z.B, z.C)
5764 z.K = T.ABC:kimberling(115)
5765 z.circumcenter = T.ABC.circumcenter
5766 z.G = T.ABC.centroid
5767 L.brocard = T.ABC:brocard_axis()
5768 C.circum = circle(z.circumcenter, z.A)
5769 z.M,
5770 z.N = intersection(L.brocard, C.circum)
5771 L.asx = T.ABC:simson_line(z.M)
5772 L.asy = T.ABC:simson_line(z.N)
5773 z.ux, z.uy = L.asx:get()
5774 z.vx, z.vy = L.asy:get()
5775 CO.HY = T.ABC:kiepert_hyperbola()
5776 curve = CO.HY:points(-3, 3, 50)
5777 curveb = CO.HY:points(-3, 3, 50, "swap")
5778 z.F_a, z.F_b = CO.HY.Fa, CO.HY.Fb}
5779 \end{tkzexample}
5780 \end{minipage}
5781
5782
5783
5784
5785 \subsubsection{Method \tkzMeth{triangle}{ellipse\_inscribed}(spec,<eps>)}%(fold)
5786 \label{ssub:ellipse_inscribed}
5787 This method is based on classical results due to Brianchon and Poncelet.
5788
5789 Brianchon showed that for any conic inscribed in a triangle, the lines joining the vertices to the points of tangency are concurrent at a point now called Brianchon’s point. This point is the isotomic conjugate of the complement of the center of the conic.
5790
5791 Poncelet showed that the foci of an inscribed conic are isogonal conjugates. Consequently, a tri-tangent conic can be constructed from a single datum: its center, its Brianchon point, or one of its foci.(see e.g. classical references on triangle geometry)
5792
5793 \medskip
5794 \texttt{Usage: }
5795
5796 \begin{verbatim}
5797 triangle:ellipse_inscribed{spec, eps}
5798 \end{verbatim}
5799
5800 \medskip
5801
5802 This method constructs an ellipse inscribed in the current triangle.
5803
5804 The specification table \texttt{spec} must contain one of the following keys:
5805
5806 \begin{itemize}
5807 \item \texttt{\{brianchon = P\}}: Brianchon’s point of the ellipse;
5808 \item \texttt{\{center = O\}}: the center of the ellipse;
5809 \item \texttt{\{focus = F\}}: one focus of the ellipse.
5810 \end{itemize}
5811
5812 The optional parameter \texttt{eps} is used as a numerical tolerance for internal
5813 tests and comparisons.
5814
5815 \medskip
5816 \texttt{Returns: }
5817
5818 A \texttt{conic} object representing the inscribed ellipse.
5819
5820 \medskip
5821 \texttt{Description: }
5822
5823 The fundamental construction uses Brianchon’s point.
5824 If $P$ denotes this point, the lines $(AP)$, $(BP)$, and $(CP)$ meet the
5825 sides $BC$, $CA$, and $AB$ at the three contact points of the ellipse.
5826
5827 The center of the ellipse is then obtained as
5828 \[
5829 O = \text{complement}\bigl(\text{isotomic}(P)\bigr),
5830 \]
5831 and the ellipse is determined from its three contact points together with two
5832 points obtained by central symmetry about $O$.
5833
5834 The specifications \texttt{center} and \texttt{focus} are internally reduced to
5835 the Brianchon form.
5836
5837 \medskip
5838 \texttt{Examples: }
5839
5840 \begin{itemize}
5841
5842 \item Using Brianchon’s point:
5843 \begin{verbatim}
5844 z.P = T.ABC:barycentric(1,1,.75)
5845 CO.EL = T.ABC:ellipse_inscribed{brianchon = z.P}
5846 \end{verbatim}
5847
5848 \item Using the center:
5849 \begin{verbatim}
5850 z.O = T.ABC:barycentric(1,1,.4)
5851 CO.EL = T.ABC:ellipse_inscribed{center = z.O}
5852 \end{verbatim}
5853
5854 \item Using a focus:
5855 \begin{verbatim}
5856 z.F = point:new(...)
5857 CO.EL = T.ABC:ellipse_inscribed{focus = z.F}
5858 \end{verbatim}
5859
5860 \end{itemize}
5861
5862 \begin{tkzexample}[latex=.4\textwidth]
5863 \directlua{
5864 init_elements()
5865 z.A = point(1.5, 6)
5866 z.B = point(0, 0)
5867 z.C = point(7, 0)
5868 T.ABC = triangle(z.A, z.B, z.C)
5869 z.P = T.ABC:barycentric(1,1,.75)
5870 CO.ELp = T.ABC:ellipse_inscribed{brianchon = z.P}
5871 PA.curveP = CO.ELp:points(0, 1, 100)
5872 z.O = T.ABC:barycentric(1,1,.4)
5873 CO.ELo = T.ABC:ellipse_inscribed{center = z.O}
5874 PA.curveO = CO.ELo:points(0, 1, 100)
5875 z.Fa = T.ABC:barycentric(.8,.2,.6)
5876 CO.ELfa = T.ABC:ellipse_inscribed{focus = z.Fa}
5877 PA.curveFa = CO.ELfa:points(0, 1, 100)
5878 }
5879
5880 \begin{center}
5881 \begin{tikzpicture}[scale=.75]
5882 \tkzGetNodes
5883 \tkzDrawPolygon(A,B,C)
5884 \tkzDrawCoordinates[smooth,purple](PA.curveP)
5885 \tkzDrawCoordinates[smooth,red](PA.curveO)
5886 \tkzDrawCoordinates[smooth,cyan](PA.curveFa)
5887 \tkzDrawPoints(A,B,C)
5888 \tkzDrawPoints[purple](P)
5889 \tkzDrawPoints[cyan](Fa)
5890 \tkzDrawPoints[red](O)
5891 \tkzLabelPoints[below](B,C)
5892 \tkzLabelPoints[above](A)
5893 \tkzLabelPoints[right](O,Fa,P)
5894 \end{tikzpicture}
5895 \end{center}
5896 \end{tkzexample}
5897
5898 \medskip
5899 \texttt{Remark: }
5900 The points of tangency can be found using:
5901
5902 From the Brianchon point |z.P|:
5903
5904 \begin{mybox}
5905 \begin{verbatim}
5906 z.D, z.E, z.F = T.ABC:cevian(z.P)
5907 \end{verbatim}
5908 \end{mybox}
5909
5910 From the center |z.O|:
5911
5912 \begin{mybox}
5913 \begin{verbatim}
5914 z.P = self:isotomic(anticomplement(z.O))
5915 z.D, z.E, z.F = T.ABC:cevian(z.P)
5916 \end{verbatim}
5917 \end{mybox}
5918
5919 From two points of contact |z.T1| and |z.T2|:
5920
5921 \begin{mybox}
5922 \begin{verbatim}
5923 z.D, z.E, z.F = T.ABC:cevian_point(z.T1, z.T2, eps)
5924 \end{verbatim}
5925 \end{mybox}
5926
5927 \subsubsection{Method \tkzMeth{triangle}{euler\_ellipse()}} %(fold)
5928 \label{ssub:euler_ellipse}
5929
5930 The \emph{Euler ellipse} is a conic section associated with a triangle. It is tangent to the three sides of the triangle and has two notable triangle centers as its foci: the orthocenter and the circumcenter.
5931
5932 \medskip
5933
5934 This ellipse can be seen as a generalization of the Euler circle (nine-point circle), which is obtained when the conic becomes a circle. The method \code{euler\_ellipse()} computes this conic based on the triangle geometry.
5935
5936 \medskip
5937
5938 An example combining both the Euler circle and the Euler ellipse is provided in the documentation to illustrate their relationship.
5939
5940 \vspace{1em}
5941
5942
5943 \begin{minipage}{.5\textwidth}
5944 \directlua{
5945 init_elements()
5946 z.A = point(2, 3.8)
5947 z.B = point(0, 0)
5948 z.C = point(6.2, 0)
5949 L.AB = line(z.A, z.B)
5950 T.ABC = triangle(z.A, z.B, z.C)
5951 z.K = tkz.midpoint(z.B, z.C)
5952 CO.euler = T.ABC:euler_ellipse()
5953 curve = CO.euler:points(0, 1, 50)
5954 z.N = T.ABC.eulercenter
5955 C.euler = circle(z.N, z.K)
5956 z.O = T.ABC.circumcenter
5957 z.G = T.ABC.centroid
5958 z.H = T.ABC.orthocenter
5959 }
5960 \begin{center}
5961 \begin{tikzpicture}
5962 \tkzGetNodes
5963 \tkzDrawPolygon(A,B,C)
5964 \tkzDrawCircle(N,K)
5965 \tkzDrawCoordinates[smooth,cyan](curve)
5966 \tkzDrawLine(O,H)
5967 \tkzDrawPoints(A,B,C,N,O,H,G)
5968 \tkzLabelPoints[below left](B,C,N,O,H,G)
5969 \tkzLabelPoints[above](A)
5970 \end{tikzpicture}
5971 \end{center}
5972 \end{minipage}
5973 \begin{minipage}{.5\textwidth}
5974 \begin{tkzexample}[code only]
5975 \directlua{
5976 init_elements()
5977 z.A = point(2, 3.8)
5978 z.B = point(0, 0)
5979 z.C = point(6.2, 0)
5980 L.AB = line(z.A, z.B)
5981 T.ABC = triangle(z.A, z.B, z.C)
5982 z.K = tkz.midpoint(z.B, z.C)
5983 CO.euler = T.ABC:euler_ellipse()
5984 curve = CO.euler:points(0, 1, 50)
5985 z.N = T.ABC.eulercenter
5986 C.euler = circle(z.N, z.K)
5987 z.O = T.ABC.circumcenter
5988 z.G = T.ABC.centroid
5989 z.H = T.ABC.orthocenter}
5990 \end{tkzexample}
5991 \end{minipage}
5992
5993 \subsubsection{Methods \tkzMeth{triangle}{steiner\_inellipse()} and \tkzMeth{triangle}{steiner\_circumellipse()}} %(fold)
5994 \label{ssub:steiner_inellipse_and_circumellipse}
5995
5996 These methods return the inner and outer Steiner ellipses associated with a triangle.
5997
5998 \medskip
5999
6000 The \emph{Steiner inellipse} is the unique ellipse inscribed in a triangle and tangent to the midpoints of its sides. Its center is the centroid of the triangle. It minimizes the sum of the squared distances from any point on the ellipse to the triangle’s sides.
6001
6002 \medskip
6003
6004 The \emph{Steiner circumellipse}, or outer ellipse, is the unique ellipse circumscribed about the triangle, passing through the three vertices and centered at the centroid. It minimizes the sum of the squared distances from the vertices to the ellipse.
6005
6006 \medskip
6007
6008 These constructions are valid for acute triangles. The orthoptic circle, i.e., the locus of points from which chords of the ellipse are seen under right angles, is also shown in the associated example.
6009 \begin{flushright}
6010 \small
6011 \href{https://mathworld.wolfram.com/SteinerInellipse.html}{Weisstein, Eric W. \emph{“Steiner Inellipse”}},\\
6012 \href{https://mathworld.wolfram.com/SteinerCircumellipse.html}{Weisstein, Eric W. \emph{“Steiner Circumellipse”}}
6013 \end{flushright}
6014
6015 \vspace{1em}
6016
6017 \begin{minipage}{.5\textwidth}
6018 \directlua{
6019 init_elements()
6020 z.A = point(1, 4)
6021 z.B = point(11, 1)
6022 z.C = point(5, 12)
6023 T.ABC = triangle(z.A, z.B, z.C)
6024 CO.EL_a = T.ABC:steiner_inellipse()
6025 curve_a = CO.EL_a:points(0,1,100)
6026 z.G = CO.EL_a.center
6027 ang = math.deg(CO.EL_a.slope)
6028 z.F = CO.EL_a.Fa
6029 z.E = CO.EL_a.Fb
6030 C = CO.EL_a:orthoptic()
6031 z.w = C.center
6032 z.o = C.through
6033 CO.EL_b = T.ABC:steiner_circumellipse()
6034 curve_b = CO.EL_b:points(0, 1, 100)
6035 z.M = C:point(0)
6036 L.T1,
6037 L.T2 = CO.EL_a:tangent_from(z.M)
6038 z.T1 = L.T1.pb
6039 z.T2 = L.T2.pb}
6040 \begin{center}
6041 \begin{tikzpicture}[scale =.5]
6042 \tkzGetNodes
6043 \tkzDrawPolygon(A,B,C)
6044 \tkzDrawCircles[black!50!green](w,o)
6045 \tkzDrawCoordinates[smooth,red](curve_a)
6046 \tkzDrawCoordinates[smooth,cyan](curve_b)
6047 \tkzDrawLines(F,E M,T1 M,T2)
6048 \tkzDrawPoints(A,B,C,F,E,G,M,T1,T2)
6049 \tkzLabelPoints[above](C)
6050 \tkzLabelPoints[right](B)
6051 \tkzLabelPoints[below left](A,F,E,G,T1,T2,M)
6052 \end{tikzpicture}
6053 \end{center}
6054 \end{minipage}
6055 \begin{minipage}{.5\textwidth}
6056 \begin{tkzexample}[code only]
6057 \directlua{
6058 init_elements()
6059 z.A = point(1, 4)
6060 z.B = point(11, 1)
6061 z.C = point(5, 12)
6062 T.ABC = triangle(z.A, z.B, z.C)
6063 CO.EL_a = T.ABC:steiner_inellipse()
6064 curve_a = CO.EL_a:points(0,1,100)
6065 z.G = CO.EL_a.center
6066 ang = math.deg(CO.EL_a.slope)
6067 z.F = CO.EL_a.Fa
6068 z.E = CO.EL_a.Fb
6069 C = CO.EL_a:orthoptic()
6070 z.w = C.center
6071 z.o = C.through
6072 CO.EL_b = T.ABC:steiner_circumellipse()
6073 curve_b = CO.EL_b:points(0, 1, 100)
6074 z.M = C:point(0)
6075 L.T1,
6076 L.T2 = CO.EL_a:tangent_from(z.M)
6077 z.T1 = L.T1.pb
6078 z.T2 = L.T2.pb}
6079 \end{tkzexample}
6080 \end{minipage}
6081
6082 \subsubsection{Method \tkzMeth{triangle}{lemoine\_inellipse}}
6083 \label{ssub:method_triangle_lemoine_inellipse}
6084
6085 The \emph{Lemoine inellipse} is the unique inconic (an inscribed conic) of a triangle that has the centroid $G$ and the symmedian point $K$ as its foci.
6086
6087 \medskip
6088
6089 This ellipse is always an actual ellipse and reflects key symmetries of the triangle. It is intimately connected with the triangle’s geometry and often appears in advanced triangle center constructions.
6090 \begin{flushright}
6091 \small
6092 \href{https://mathworld.wolfram.com/LemoineEllipse.html}{Weisstein, Eric W. \emph{“Lemoine Ellipse.”} From MathWorld}
6093 \end{flushright}
6094
6095 \vspace{1em}
6096
6097 \begin{minipage}{.5\textwidth}
6098 \directlua{
6099 init_elements()
6100 z.A = point(0, 0)
6101 z.B = point(5, 0)
6102 z.C = point(5.6, 3)
6103 T.ABC = triangle(z.A, z.B, z.C)
6104 z.L = T.ABC:lemoine_point()
6105 z.O = T.ABC.circumcenter
6106 z.G = T.ABC.centroid
6107 L.L = T.ABC:lemoine_axis()
6108 z.la, z.lb = L.L:get()
6109 L.B = T.ABC:brocard_axis()
6110 z.ba, z.bb = L.B:get()
6111 z.W = T.ABC:kimberling(39)
6112 CO.EL = T.ABC:lemoine_inellipse()
6113 curve = CO.EL:points(0, 1, 100)
6114 z.Ka, z.Kb, z.Kc = T.ABC:symmedian():get()
6115 z.Xa, z.Xb, z.Xc = T.ABC:lemoine():get()}
6116 \begin{tikzpicture}
6117 \tkzGetNodes
6118 \tkzDrawCoordinates[smooth,red](curve)
6119 \tkzDrawPolygons[cyan](A,B,C Xa,Xb,Xc)
6120 \tkzDrawLines[purple,
6121 add = 1 and 1](la,lb G,L)
6122 \tkzDrawLines[red,
6123 add = 1 and 1](ba,bb)
6124 \tkzDrawPoints(A,B,L,O,la,lb,W,Xa,Xb,Xc,G)
6125 \tkzLabelPoints(A,B,L,O,G)
6126 \tkzLabelPoints[above](C)
6127 \tkzLabelLine[sloped,above,
6128 purple](la,lb){Lemoine\_axis}
6129 \tkzLabelLine[sloped,above,red,
6130 pos=-.2](ba,bb){Brocard\_line}
6131 \end{tikzpicture}
6132 \end{minipage}
6133 \begin{minipage}{.5\textwidth}
6134 \begin{tkzexample}[code only]
6135 \directlua{
6136 init_elements()
6137 z.A = point(0, 0)
6138 z.B = point(5, 0)
6139 z.C = point(5.6, 3)
6140 T.ABC = triangle(z.A, z.B, z.C)
6141 z.L = T.ABC:lemoine_point()
6142 z.O = T.ABC.circumcenter
6143 z.G = T.ABC.centroid
6144 L.L = T.ABC:lemoine_axis()
6145 z.la, z.lb = L.L:get()
6146 L.B = T.ABC:brocard_axis()
6147 z.ba, z.bb = L.B:get()
6148 z.W = T.ABC:kimberling(39)
6149 CO.EL = T.ABC:lemoine_inellipse()
6150 curve = CO.EL:points(0, 1, 100)
6151 z.Ka, z.Kb, z.Kc = T.ABC:symmedian():get()
6152 z.Xa, z.Xb, z.Xc = T.ABC:lemoine():get()}
6153 \end{tkzexample}
6154 \end{minipage}
6155
6156 \subsubsection{Method \tkzMeth{triangle}{brocard\_inellipse}}
6157 \label{ssub:method_triangle_brocard__inellipse}
6158
6159 The \emph{Brocard inellipse} is the unique inconic of a triangle whose foci are the Brocard points and whose center is the Brocard midpoint.
6160
6161 \medskip
6162
6163 This ellipse is tangent to the sides of the reference triangle, and the triangle formed by its points of tangency is the \emph{symmedial triangle} of the reference triangle.
6164 \begin{flushright}
6165 \small
6166 \href{https://mathworld.wolfram.com/BrocardEllipse.html}{Weisstein, Eric W. \emph{“Brocard Ellipse.”} From MathWorld}
6167 \end{flushright}
6168
6169 \vspace{1em}
6170
6171 \begin{minipage}{.5\textwidth}
6172 \directlua{
6173 init_elements()
6174 z.A = point(0, 0)
6175 z.B = point(5, 0)
6176 z.C = point(5.6, 3)
6177 T.ABC = triangle(z.A, z.B, z.C)
6178 z.L = T.ABC:lemoine_point()
6179 z.O = T.ABC.circumcenter
6180 L.L = T.ABC:lemoine_axis()
6181 z.la, z.lb = L.L:get()
6182 L.B = T.ABC:brocard_axis()
6183 z.ba, z.bb = L.B:get()
6184 z.B1 = T.ABC:first_brocard_point()
6185 z.B2 = T.ABC:second_brocard_point()
6186 z.W = T.ABC:kimberling(39)
6187 CO.ELB = T.ABC:brocard_inellipse()
6188 curve = CO.ELB:points(0, 1, 100)
6189 z.Ka, z.Kb, z.Kc = T.ABC:symmedian():get()
6190 z.Xa, z.Xb, z.Xc = T.ABC:lemoine():get()}
6191 \begin{tikzpicture}
6192 \tkzGetNodes
6193 \tkzDrawCoordinates[smooth,red](curve)
6194 \tkzDrawPolygons[cyan](A,B,C Ka,Kb,Kc)
6195 \tkzDrawLines[purple,
6196 add = 1 and 1](la,lb B1,B2)
6197 \tkzDrawLines[red,add = 1 and 1](ba,bb)
6198 \tkzDrawPoints(A,B,L,O,la,lb)
6199 \tkzDrawPoints(B1,B2,W,Ka,Kb,Kc)
6200 \tkzLabelPoints(A,B,L,O,B1,B2)
6201 \tkzLabelPoints[above](C)
6202 \tkzLabelLine[sloped,above,
6203 purple](la,lb){Lemoine\_axis}
6204 \tkzLabelLine[sloped,above,
6205 red,pos=-.2](ba,bb){Brocard\_line}
6206 \end{tikzpicture}
6207 \end{minipage}
6208 \begin{minipage}{.5\textwidth}
6209 \begin{tkzexample}[code only]
6210 \directlua{
6211 init_elements()
6212 z.A = point(0, 0)
6213 z.B = point(5, 0)
6214 z.C = point(5.6, 3)
6215 T.ABC = triangle(z.A, z.B, z.C)
6216 z.L = T.ABC:lemoine_point()
6217 z.O = T.ABC.circumcenter
6218 L.L = T.ABC:lemoine_axis()
6219 z.la, z.lb = L.L:get()
6220 L.B = T.ABC:brocard_axis()
6221 z.ba, z.bb = L.B:get()
6222 z.B1 = T.ABC:first_brocard_point()
6223 z.B2 = T.ABC:second_brocard_point()
6224 z.W = T.ABC:kimberling(39)
6225 CO.ELB = T.ABC:brocard_inellipse()
6226 curve = CO.ELB:points(0, 1, 100)
6227 z.Ka, z.Kb, z.Kc = T.ABC:symmedian():get()
6228 z.Xa, z.Xb, z.Xc = T.ABC:lemoine():get()}
6229 \end{tkzexample}
6230 \end{minipage}
6231
6232 \subsubsection{Method \tkzMeth{triangle}{macbeath\_inellipse}}
6233 \label{ssub:method_triangle_macbeath__inellipse}
6234
6235 The \emph{MacBeath inconic} of a triangle is an ellipse tangent to the sides of the reference triangle.
6236
6237 \medskip
6238
6239 Its foci are the circumcenter $O$ and the orthocenter $H$, which implies that its center is the nine-point center $N$. The triangle formed by the points of tangency of the MacBeath ellipse with the triangle's sides is called the \emph{MacBeath triangle}.
6240 \begin{flushright}
6241 \small
6242 \href{https://mathworld.wolfram.com/MacBeathInconic.html}{Weisstein, Eric W. \emph{“MacBeath Inconic.”} From MathWorld}
6243 \end{flushright}
6244
6245 \vspace{1em}
6246
6247 \begin{tkzexample}[latex=.5\textwidth]
6248 \directlua{
6249 init_elements()
6250 z.A = point(.5, 3)
6251 z.B = point(0, 0)
6252 z.C = point(5, 0)
6253 T.ABC = triangle(z.A, z.B, z.C)
6254 z.MB = T.ABC:kimberling(264)
6255 z.Xa, z.Xb, z.Xc = T.ABC:macbeath():get()
6256 CO = T.ABC:macbeath_inellipse()
6257 curve = CO:points(0, 1, 100)}
6258 \begin{tikzpicture}
6259 \tkzGetNodes
6260 \tkzDrawPolygons(A,B,C Xa,Xb,Xc)
6261 \tkzDrawCoordinates[smooth,red](curve)
6262 \tkzDrawSegments(A,Xa B,Xb C,Xc)
6263 \tkzDrawPoints(A,B,C,MB,Xa,Xb,Xc)
6264 \tkzLabelPoints(B,C,MB)
6265 \tkzLabelPoints[above](A)
6266 \end{tikzpicture}
6267 \end{tkzexample}
6268
6269 \subsubsection{Method \tkzMeth{triangle}{mandart\_inellipse}}
6270 \label{ssub:method_triangle_mandart__inellipse}
6271
6272 The \emph{Mandart ellipse} is the inconic that touches the sides of the reference triangle at the vertices of the \emph{extouch triangle}, which is also its polar triangle.
6273
6274 \medskip
6275
6276 Its center is the \emph{mittenpunkt} $M$ of the triangle.
6277
6278 \vspace{1em}
6279
6280
6281 \begin{tkzexample}[latex=.5\textwidth]
6282 \directlua{
6283 init_elements()
6284 z.A = point(1.5, 3)
6285 z.B = point(0, 0)
6286 z.C = point(5, 0)
6287 T.ABC = triangle(z.A, z.B, z.C)
6288 z.M = T.ABC:mittenpunkt_point()
6289 T.exc = T.ABC:excentral()
6290 z.Ja, z.Jb, z.Jc = T.exc:get()
6291 z.Xa, _,_ = T.ABC:projections(z.Ja)
6292 z.Xb, z.Yb,_ = T.ABC:projections(z.Jb)
6293 z.Xc,_, z.Zc = T.ABC:projections(z.Jc)
6294 CO = T.ABC:mandart_inellipse()
6295 curve = CO:points(0, 1, 100)}
6296 \begin{tikzpicture}
6297 \tkzGetNodes
6298 \tkzInit[xmin=-2,xmax=6,ymin=-2,ymax = 4]
6299 \tkzClip
6300 \tkzDrawPolygons[](A,B,C Xa,Yb,Zc)
6301 \tkzDrawCoordinates[smooth,red](curve)
6302 \tkzDrawCircles[cyan](Ja,Xa Jb,Xb Jc,Xc)
6303 \tkzDrawPoints(A,B,C,Xa,M,Zc,Yb)
6304 \tkzLabelPoints(B,C,Xa,M)
6305 \tkzLabelPoints[above](A,Yb)
6306 \tkzLabelPoints[left](Zc)
6307 \end{tikzpicture}
6308 \end{tkzexample}
6309
6310 \subsubsection{Method \tkzMeth{triangle}{orthic\_inellipse}}
6311 \label{ssub:method_triangle_orthic__inellipse}
6312
6313 The \emph{orthic inellipse} is an inconic defined for acute triangles. It is tangent to the sides of the triangle at the vertices of the \emph{orthic triangle}, which also serves as its polar triangle.
6314
6315 \medskip
6316
6317 Its center is the \emph{symmedian point} $K$ of the reference triangle.
6318
6319 \vspace{1em}
6320
6321
6322 \begin{tkzexample}[latex=.5\textwidth]
6323 \directlua{
6324 z.A = point(0, 0)
6325 z.B = point(6, 0)
6326 z.C = point(1, 6)
6327 T.ABC = triangle(z.A, z.B, z.C)
6328 z.K = T.ABC:symmedian_point()
6329 z.Ha, z.Hb, z.Hc = T.ABC:orthic():get()
6330 CO =T.ABC:orthic_inellipse()
6331 curve = CO:points(0, 1, 100)}
6332 \begin{tikzpicture}
6333 \tkzGetNodes
6334 \tkzDrawCoordinates[smooth,red](curve)
6335 \tkzDrawPolygons[red](A,B,C)
6336 \tkzDrawPolygons[blue](Ha,Hb,Hc)
6337 \tkzDrawPoints(A,B,C,K,Ha,Hb,Hc)
6338 \tkzDrawSegments[red](C,Hc B,Hb A,Ha)
6339 \tkzLabelPoints(A,B,K)
6340 \tkzLabelPoints(Hc)
6341 \tkzLabelPoints[left](Hb)
6342 \tkzLabelPoints[above](Ha,C)
6343 \end{tikzpicture}
6344 \end{tkzexample}
6345
6346
6347 %%%%%%%%%%%%%%%%%%%
6348 %%% Misc.
6349 %%%%%%%%%%%%%%%%%%%%
6350
6351
6352 \subsection{The result is a square}
6353
6354 \subsubsection{Method \tkzMeth{triangle}{square\_inscribed(n)}}
6355 \label{ssub:method_triangle_square__inscribed}
6356
6357 This method constructs a square inscribed in the triangle.
6358
6359 \medskip
6360
6361 The optional argument \code{n} (an integer) determines which side of the triangle serves as the base of the square. The vertices of the triangle are cyclically ordered.
6362
6363 \begin{itemize}
6364 \item If \code{n = 0} or omitted, the base is the segment $(pa, pb)$;
6365 \item If \code{n = 1}, the base is $(pb, pc)$;
6366 \item If \code{n = 2}, the base is $(pc, pa)$.
6367 \end{itemize}
6368
6369
6370 The constructed square lies entirely within the triangle and shares one side with the chosen base.
6371
6372 \vspace{1em}
6373
6374 \begin{tkzexample}[latex=.5\textwidth]
6375 \directlua{
6376 z.A = point(3.8, 3.5)
6377 z.B = point(0, 0)
6378 z.C = point(5, 0)
6379 T.ABC = triangle(z.A,z.B,z.C)
6380 S = T.ABC:square_inscribed(1)
6381 z.b1,z.b2,z.b3,z.b4 = S:get()
6382 S = T.ABC:square_inscribed(0)
6383 z.a1,z.a2,z.a3,z.a4 = S:get()}
6384 \begin{tikzpicture}
6385 \tkzGetNodes
6386 \tkzDrawPolygons(A,B,C a1,a2,a3,a4)
6387 \tkzDrawPolygons(b1,b2,b3,b4)
6388 \tkzDrawPoints(A,B,C)
6389 \tkzLabelPoints(B,C)
6390 \tkzLabelPoints[above](A)
6391 \end{tikzpicture}
6392 \end{tkzexample}
6393
6394
6395 \subsubsection{Method \tkzMeth{triangle}{path()}}
6396 \label{ssub:method_tkzmeth_triangle_path}
6397
6398 This method builds a \tkzClass{path} object that follows the boundary of a triangle from point $p_1$ to point $p_2$, walking in counterclockwise (direct) orientation along the triangle's perimeter.
6399
6400 \texttt{Syntax: } \verb|PA.edge = T.ABC:path(zA, zC)|
6401
6402 \texttt{Arguments: }
6403
6404 \begin{itemize}
6405 \item \code{p1}, \code{p2} — two points located on the triangle’s sides
6406 \end{itemize}
6407
6408 \texttt{Details: }
6409
6410
6411 The method checks that both points lie on the triangle’s boundary using the segment method \tkzMeth{line}{in\_out\_segment}. If they belong to the same side, the resulting path is direct. Otherwise, the method follows the triangle in counterclockwise order, adding intermediate vertices as needed.
6412
6413 This function is useful for tracing polygonal arcs or combining triangle edges with other curves to build filled shapes.
6414
6415 \directlua{
6416 z.A = point(0, 0)
6417 z.B = point(6, 0)
6418 z.C = point(1, 4)
6419 T.ABC = triangle(z.A, z.B, z.C)
6420 z.M = T.ABC.bc.mid
6421 z.N = T.ABC.ca.mid
6422 PA.path = T.ABC:path(z.M,z.N,4)
6423 }
6424
6425 \begin{center}
6426 \begin{tikzpicture}[gridded]
6427 \tkzGetNodes
6428 \tkzDrawPolygon(A,B,C)
6429 \tkzDrawCoordinates[orange,thick](PA.path)
6430 \tkzDrawPoints(A,...,C,M,N)
6431 \tkzLabelPoints(A,...,C)
6432 \end{tikzpicture}
6433 \end{center}
6434 \endinput