texlive[73346] Master/texmf-dist: tkz-elements (7jan25)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 7 22:02:07 CET 2025


Revision: 73346
          https://tug.org/svn/texlive?view=revision&revision=73346
Author:   karl
Date:     2025-01-07 22:02:07 +0100 (Tue, 07 Jan 2025)
Log Message:
-----------
tkz-elements (7jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tkz-elements/README.md
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-circle.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-line.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-misc.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-parallelogram.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-point.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-quadrilateral.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-regular.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-square.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-triangle.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-convention.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-examples.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-indepthstudy.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-inversion.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-main.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-news.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-organization.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-presentation.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-transfers.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_1.pdf
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_1.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_2.pdf
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_2.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_3.pdf
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_3.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_4.pdf
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_4.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/tkz-elements.pdf
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz-elements.sty
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_class.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_ellipse.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_circles.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_intersections.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_lines.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_maths.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_matrices.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_regular.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_triangles.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_line.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_main.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_matrices.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_misc.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_parallelogram.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_point.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_quadrilateral.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_rectangle.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_square.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_triangle.lua
    trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_vector.lua

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-theorems.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/search_circle.lua
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.pdf
    trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.tex
    trunk/Master/texmf-dist/doc/latex/tkz-elements/search_circle.lua

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/README.md	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/README.md	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,10 +1,10 @@
 # tkz-elements — for euclidean geometry
 
-Release 3.00c 2024/11/23
+Release 3.10c 2025/01/01
 
 ## Description
 
-`tkz-elements v.3.00c` is the new version of a library written in lua, allowing to make all the necessary calculations to define the objects of a Euclidean geometry figure. You need to compile with `LuaLaTeX`. With `tkz-elements`, the definitions and calculations are only done with `Lua`. 
+`tkz-elements v.3.10c` is the new version of a library written in lua, allowing to make all the necessary calculations to define the objects of a Euclidean geometry figure. You need to compile with `LuaLaTeX`. With `tkz-elements`, the definitions and calculations are only done with `Lua`. 
 
  The main possibility of programmation  proposed is oriented "object programming" with object classes like point, line, triangle, circle and ellipse.  For the moment, once the calculations are done, it is `tkz-euclide` or `TikZ` which allows the drawings. You can use the option `mini` with `tkz-euclide` to load only the modules required for tracing.
 
@@ -55,13 +55,24 @@
 If you use the `xcolor` package, load that package before `tkz-euclide` to avoid
 package conflicts.
 
+It's possible to use the environment `tkzelements` istead of the directive `\directlua` but in this case, you need to load the package `luacode`.
+
 ## Examples
 
 Some  examples  will be stored on my site : [http://altermundus.fr](http://altermundus.fr). 
-An important example  `Golden Arbelos` using the package is on the site. All the files of the documentation
-are on the site.
+An important example  `Golden Arbelos` using the package is on the site. All the files of the documentation are on the site.
 
 ## History
+   - version 3.10c
+       - Most of the functions have been optimized, and some have been commented on.
+       - Object classes have been enhanced with new attributes. For a triangle, you can directly access the semiperimeter, area, inradius and circumradius. In some classes, the `exradius` attribute is replaced by `circumradius`.   
+       - For rectangle, square and circle, `perimeter` and `area` have been added.
+       - For line, new methods appear: `is_parallel`, `is_orthogonal` and `is_equidistant`. The latter allows you to determine whether a point is equidistant from the two points defining the line. The `swap` argument is available for all triangle creations. The result is now a single triangle, the second is obtained with `swap`.
+       - It is now possible to define an isosceles triangle from a straight line (segment) with length `isosceles_s`. You can use `isosceles_a` or the old `isosceles` method if you're using an angle. I've added a new test for triangles: `is_acute`. The `two_angles` method is identical to `asa`.
+       - The line , circle and triangle classes are complemented by methods with complicated names: `c_l_pp`, `c_ll_p`, `c_c_pp` and `c_cc_p`. These methods allow you to determine, from a line or circle, one or more circles tangent to lines or circles and passing through points. So `c_l_pp` means to create a circle tangent to a line (l) and passing through two points (pp). The first `c` reminds us that we're looking for a circle, the second group between `_` and `_` indicates the tangent objects (c or l) and the last indicates the points through which the circle passes.
+       - In the documentation, I've added a section on important geometry theorems (
+       Viviani, Reuschle, Thébault,Varignon, Wittenbauer, Soddy, Six circles ... to be completed ...). Examples of new methods and attributes have also been added.
+       
    - version 3.00c
        - It is now possible to use the `directlua` primitive to perform `lua` code. In this case, tables and scaling can be reset using the `init_elements` function. You can still use the `tkzelements` environment, but only if you load the `luacode` package.
        - Examples have been added to the `transfers` section.

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-circle.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-circle.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-circle.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -25,8 +25,10 @@
 \Iattr{circle}{south}   &  |C.AB.south|  &    |z.S = C.OA.south| \\
 \Iattr{circle}{east}    &  |C.AB.east|   &   |z.E = C.OA.east| \\
 \Iattr{circle}{west}    &  |C.AB.west|   &   |z.W = C.OA.west| \\
-\Iattr{circle}{opp}    &  |z.Ap = C.AB.opp|   & [\ref{ssub:example_circle_attributes}]  \\
+\Iattr{circle}{opp}     &  |z.Ap = C.AB.opp|   & [\ref{ssub:example_circle_attributes}]  \\
 \Iattr{circle}{ct}    &  |L = C.AB.ct|  [ \ref{ssub:example_circle_attributes} ]  \\
+\Iattr{circle}{perimeter}  & |p = C.AB.perimeter| [\ref{ssub:attributes_perimeter_and_area}]  \\
+\Iattr{circle}{area}  & |a = C.AB.area| [\ref{ssub:attributes_perimeter_and_area}]    \\
 \bottomrule %
 \end{tabular}
 \egroup
@@ -85,6 +87,41 @@
 
 \end{minipage}
 % subsubsection example_circle_attributes (end)
+
+\subsubsection{Attributes perimeter and area} % (fold)
+\label{ssub:attributes_perimeter_and_area}
+
+ \pgfkeys{/pgf/number format/.cd,std,precision=4}
+ \let\pmpn\pgfmathprintnumber
+ 
+\begin{mybox}
+\begin{Verbatim}
+  \directlua{
+  z.A = point : new (1, 2)
+  z.B = point : new (4, 3)
+  C.AB =  circle : new (z.A,z.B)
+  p = C.AB.perimeter
+  a = C.AB.area
+  }
+Let be two points $A$ and $B$. The circle of center $A$ passing 
+through $B$ has perimeter \pmpn{\tkzUseLua{p}} $cm$ 
+and area \pmpn{\tkzUseLua{a} }$cm^2$.
+
+\end{Verbatim}
+
+\end{mybox}
+
+\directlua{
+z.A = point : new (1, 2)
+z.B = point : new (4, 3)
+C.AB =  circle : new (z.A,z.B)
+p = C.AB.perimeter
+a = C.AB.area
+}
+Let be two points $A$ and $B$. 
+The circle of center $A$ passing through $B$ has perimeter \pmpn{\tkzUseLua{p}} $cm$ and area \pmpn{\tkzUseLua{a} }$cm^2$.
+
+% subsubsection attributes_perimeter_and_area (end)
 % subsection attributes_of_a_circle (end)
 
 \newpage
@@ -102,6 +139,19 @@
 \Igfct{circle}{radius(O,r)} & |C.OA = circle : radius (z.O,2)| & center $O$ radius =2 cm; [\ref{ssub:method_imeth_circle_radius}]\\
 \Igfct{circle}{diameter(A,B)} & |C.OA = circle :diameter(z.A,z.B)| & diameter $[AB]$; [\ref{ssub:method_imeth_circle_diameter}]  \\
 \midrule 
+ \textbf{Reals} &&\\
+\midrule 
+\Imeth{circle}{power (pt)}     &| r = C.OA: power (z.M)| &  [\ref{ssub:power_v1} ; \ref{ssub:power_v2} ; \ref{sub:apollonius_circle_v1_with_inversion} ] \\
+\midrule 
+ \textbf{Strings} &&\\
+ \midrule
+ \Imeth{circle}{circles\_position (C1)} & result = string & [\ref{ssub:circles_position}] \\
+ \midrule
+ \textbf{Booleans} &&\\
+\midrule 
+\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}]  \\
+\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}]  \\
+\Imeth{circle}{is\_tangent (L)} & |C.OA : is_tangent (L.CD)| & [\ref{ssub:method_imeth_circle_is__tangent}]  \\
  \textbf{Points} &&\\
 \midrule 
 \Imeth{circle}{antipode (pt)} & |z.C = C.OA: antipode (z.B)| &    $[BC]$ = diameter;  [\ref{ssub:method_imeth_circle_antipode}]   \\
@@ -126,14 +176,9 @@
 \Imeth{circle}{orthogonal\_through(pta,ptb)}&|C=C.OA:orthogonal_through (z.z1,z.z2)| &  [\ref{ssub:method_imeth_circle_orthogonal_through}]\\
 \Imeth{circle}{midcircle (C)}  & |C.inv = C.OA: midcircle (C.EF)|  & [\ref{ssub:midcircle}] \\
 \Imeth{circle}{radical\_circle (C1<,C2>)} & or only (C1) &  [\ref{ssub:radical_circle}] \\
-\midrule 
- \textbf{Miscellaneous} &&\\
-\midrule 
-\Imeth{circle}{power (pt)}     &| r = C.OA: power (z.M)| &  [\ref{ssub:power_v1} ; \ref{ssub:power_v2} ; \ref{sub:apollonius_circle_v1_with_inversion} ] \\
-\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}]  \\
-\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}]  \\
-\Imeth{circle}{draw ()} & for further use &\\
-\Imeth{circle}{circles\_position (C1)} & result = string & [\ref{ssub:circles_position}] \\
+\Imeth{circle}{c\_c\_pp(pt,pt)} &|C1,C2=C.A:c_cc_p (z.P,z.Q)| &  [\ref{ssub:method_c__c__pp}] \\
+\Imeth{circle}{c\_cc\_p(C,pt)} &|C1,C2=C.A:c_cc_p (C.B,z.P)| & [\ref{ssub:method_c_cc_p}]  \\
+\Imeth{circle}{c\_lc\_p(L,pt,<inside>)} &|C1,C2=C.A:c_cc_p (L.AB,z.P)| & [\ref{ssub:method_c_lc_p}]  \\
 \bottomrule 
 \end{tabular}
 \egroup
@@ -268,6 +313,60 @@
 \end{minipage}
 % subsubsection method_imeth_circle_diameter (end)
 
+\subsubsection{Method \Imeth{circle}{is\_tangent}} % (fold)
+\label{ssub:method_imeth_circle_is__tangent}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ z.A  = point:  new (0,0)
+ z.B  = point:  new (0,2)   
+ C.AB = circle: new (z.A,z.B)
+ z.C  = point:  new (2,-2)
+ z.D  = point:  new (2,3)
+ L.CD = line : new (z.C,z.D)
+ if C.AB : is_tangent (L.CD) 
+ then tex.print("L.CD tangent to C.AB") 
+  else 
+  tex.print("L.CD no tangent to C.AB")
+   end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircle(A,B)
+\tkzDrawLines(C,D)
+\tkzDrawPoints(A,...,D)
+\tkzLabelPoints[below left](A,C)
+\tkzLabelPoints[above right](B,D)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{
+   z.A  = point:  new (0,0)
+   z.B  = point:  new (0,2)   
+   C.AB = circle: new (z.A,z.B)
+   z.C  = point:  new (2,-2)
+   z.D  = point:  new (2,3)
+   L.CD = line : new (z.C,z.D)
+   if C.AB : is_tangent (L.CD) then
+    tex.print("L.CD tangent to C.AB") 
+    else 
+    tex.print("L.CD no tangent to C.AB") 
+    end
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawCircle(A,B)
+  \tkzDrawLines(C,D)
+  \tkzDrawPoints(A,...,D)
+  \tkzLabelPoints[below left](A,C)
+  \tkzLabelPoints[above right](B,D)
+  \end{tikzpicture}
+\end{minipage}
+
+
+% subsubsection method_imeth_circle_is__tangent (end)
 \subsubsection{Method \Imeth{circle}{antipode}} % (fold)
 \label{ssub:method_imeth_circle_antipode}
 This method is used to define a point that is diametrically opposed to a point on a given circle.
@@ -703,7 +802,7 @@
 \end{minipage}
 % subsubsection method_imeth_circle_external__similitude (end)
 
-
+\newpage
 \subsubsection{Method \Imeth{circle}{radical\_center (C1,C2)}} % (fold)
 \label{ssub:radical_center}
 
@@ -781,6 +880,7 @@
 \end{minipage}
 % subsubsection radical_center (end)
 
+\newpage
 \subsubsection{Method \Imeth{circle}{radical\_axis}(C)} % (fold)
 \label{ssub:method_imeth_circle_radical__axis_c}
 
@@ -787,32 +887,70 @@
 The radical line, also called the radical axis, is the locus of points of equal circle power with respect to two nonconcentric circles. By the chordal theorem, it is perpendicular to the line of centers (Dörrie 1965). [\href{https://mathworld.wolfram.com/RadicalLine.html}{Weisstein, Eric W. "Radical Line." From MathWorld--A Wolfram Web Resource.} ]
 
 \vspace{6pt}
-\paragraph{Radical axis v1} % (fold)
+Radical axis v1
 \label{par:radical_axis_v1}
 
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-scale    = .75
-z.X      = point : new (0,0)
-z.B      = point : new (2,2)
-z.Y      = point : new (7,1)
-z.Ap     = point : new (8,-1)
-L.XY     = line :    new (z.X,z.Y)
-C.XB     = circle : new (z.X,z.B)
-C.YAp    = circle : new (z.Y,z.Ap)
-z.E,z.F  = get_points (C.XB : radical_axis (C.YAp))
-z.A      = C.XB : point (0.4)
-T.ABAp   = triangle: new (z.A,z.B,z.Ap)
-z.O      = T.ABAp.circumcenter
-C.OAp    = circle : new (z.O,z.Ap)
-_,z.Bp   = intersection (C.OAp,C.YAp)
-L.AB     = line : new (z.A,z.B)
-L.ApBp   = line : new (z.Ap,z.Bp)
-z.M      = intersection (L.AB,L.ApBp)
-z.H      = L.XY : projection (z.M)
+scale  = .75
+z.X    = point: new (0,0)
+z.B    = point: new (2,2)
+z.Y    = point: new (7,1)
+z.Ap   = point: new (8,-1)
+L.XY   = line :    new (z.X,z.Y)
+C.XB   = circle : new (z.X,z.B)
+C.YAp  = circle : new (z.Y,z.Ap)
+z.E,z.F= get_points(C.XB:radical_axis(C.YAp))
+z.A    = C.XB : point (0.4)
+T.ABAp = triangle: new (z.A,z.B,z.Ap)
+z.O    = T.ABAp.circumcenter
+C.OAp  = circle : new (z.O,z.Ap)
+_,z.Bp = intersection (C.OAp,C.YAp)
+L.AB   = line : new (z.A,z.B)
+L.ApBp = line : new (z.Ap,z.Bp)
+z.M    = intersection (L.AB,L.ApBp)
+z.H    = L.XY : projection (z.M)
 }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
 \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawCircles(X,B Y,A')
+  \tkzDrawArc[dashed,delta=30](O,A')(A)
+  \tkzDrawPoints(A,B,A',B',M,H,X,Y,O,E,F)
+  \tkzDrawLines[red](A,M A',M X,Y E,F)
+  \tkzDrawLines[red,add=1 and 3](M,H)
+\end{tikzpicture}
+\end{Verbatim}
+  
+ \directlua{%
+ init_elements ()
+ scale    = .4
+ z.X      = point : new (0,0)
+ z.B      = point : new (2,2)
+ z.Y      = point : new (7,1)
+ z.Ap     = point : new (8,-1)
+ L.XY     = line :    new (z.X,z.Y)
+ C.XB     = circle : new (z.X,z.B)
+ C.YAp    = circle : new (z.Y,z.Ap)
+ z.E,z.F  = get_points (C.XB : radical_axis (C.YAp))
+ z.A      = C.XB : point (0.4)
+ T.ABAp   = triangle: new (z.A,z.B,z.Ap)
+ z.O      = T.ABAp.circumcenter
+ C.OAp    = circle : new (z.O,z.Ap)
+ _,z.Bp   = intersection (C.OAp,C.YAp)
+ L.AB     = line : new (z.A,z.B)
+ L.ApBp   = line : new (z.Ap,z.Bp)
+ z.M      = intersection (L.AB,L.ApBp)
+ z.H      = L.XY : projection (z.M)
+ }
+ \begin{center}
+   \begin{tikzpicture}
    \tkzGetNodes
    \tkzDrawCircles(X,B Y,A')
    \tkzDrawArc[dashed,delta=30](O,A')(A)
@@ -819,50 +957,20 @@
    \tkzDrawPoints(A,B,A',B',M,H,X,Y,O,E,F)
    \tkzDrawLines[red](A,M A',M X,Y E,F)
    \tkzDrawLines[red,add=1 and 3](M,H)
-\end{tikzpicture}
-\end{Verbatim}
+   \end{tikzpicture}
+ \end{center}
+\end{minipage}
 
-\directlua{%
-init_elements ()
-scale    = .75
-z.X      = point : new (0,0)
-z.B      = point : new (2,2)
-z.Y      = point : new (7,1)
-z.Ap     = point : new (8,-1)
-L.XY     = line :    new (z.X,z.Y)
-C.XB     = circle : new (z.X,z.B)
-C.YAp    = circle : new (z.Y,z.Ap)
-z.E,z.F  = get_points (C.XB : radical_axis (C.YAp))
-z.A      = C.XB : point (0.4)
-T.ABAp   = triangle: new (z.A,z.B,z.Ap)
-z.O      = T.ABAp.circumcenter
-C.OAp    = circle : new (z.O,z.Ap)
-_,z.Bp   = intersection (C.OAp,C.YAp)
-L.AB     = line : new (z.A,z.B)
-L.ApBp   = line : new (z.Ap,z.Bp)
-z.M      = intersection (L.AB,L.ApBp)
-z.H      = L.XY : projection (z.M)
-}
-
-\begin{center}
-  \begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawCircles(X,B Y,A')
-  \tkzDrawArc[dashed,delta=30](O,A')(A)
-  \tkzDrawPoints(A,B,A',B',M,H,X,Y,O,E,F)
-  \tkzDrawLines[red](A,M A',M X,Y E,F)
-  \tkzDrawLines[red,add=1 and 3](M,H)
-  \end{tikzpicture}
-\end{center}
-% paragraph radical_axis_v1 (end)
-
-\paragraph{Radical axis v2} % (fold)
+\vspace{6pt}
+Radical axis v2
 \label{par:radical_axis_v2}
 
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-scale       = 1.25
+scale       = .5
 z.O         = point : new (-1,0)
 z.Op        = point : new (4,-1)
 z.B         = point : new (0,2)
@@ -879,38 +987,42 @@
 _,z.K       = get_points (L.MK)
 _,z.Kp      = get_points (L.MKp)
 }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
 \begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(O,B O',D)
-   \tkzDrawLine(E,F)
-   \tkzDrawLine[add=.25 and .25](O,O')
-   \tkzDrawLines[add = 0 and .5](M,T M,T' M,K M,K')
-   \tkzDrawCircle(M,T)
-   \tkzDrawPoints(O,O',T,M,T',K,K')
-   \tkzLabelPoints(O,O',T,T',K,K',M)
+ \tkzGetNodes
+ \tkzDrawCircles(O,B O',D)
+ \tkzDrawLine(E,F)
+ \tkzDrawLine[add=.25 and .25](O,O')
+ \tkzDrawLines[add = 0 and .5](M,T M,T'
+   M,K M,K')
+ \tkzDrawCircle(M,T)
+ \tkzDrawPoints(O,O',T,M,T',K,K')
+ \tkzLabelPoints(O,O',T,T',K,K',M)
 \end{tikzpicture}
 \end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale =1.25
-z.O     = point : new (-1,0)
-z.Op    = point : new (4,-1)
-z.B     = point : new (0,2)
-z.D     = point : new (4,0)
-C.OB    = circle :    new (z.O,z.B)
-C.OpD   = circle :    new (z.Op,z.D)
-L.EF    = C.OB : radical_axis (C.OpD)
-z.E,z.F = get_points (L.EF)
-z.M     = L.EF : point (.75)
-L.MT,L.MTp  = C.OB : tangent_from (z.M)
-_,z.T = get_points (L.MT)
-_,z.Tp = get_points (L.MTp)
-L.MK,L.MKp  = C.OpD : tangent_from (z.M)
-_,z.K = get_points (L.MK)
-_,z.Kp = get_points (L.MKp)
-}
-
+  
+  \directlua{%
+  init_elements ()
+  scale =.5
+  z.O     = point : new (-1,0)
+  z.Op    = point : new (4,-1)
+  z.B     = point : new (0,2)
+  z.D     = point : new (4,0)
+  C.OB    = circle :    new (z.O,z.B)
+  C.OpD   = circle :    new (z.Op,z.D)
+  L.EF    = C.OB : radical_axis (C.OpD)
+  z.E,z.F = get_points (L.EF)
+  z.M     = L.EF : point (.75)
+  L.MT,L.MTp  = C.OB : tangent_from (z.M)
+  _,z.T = get_points (L.MT)
+  _,z.Tp = get_points (L.MTp)
+  L.MK,L.MKp  = C.OpD : tangent_from (z.M)
+  _,z.K = get_points (L.MK)
+  _,z.Kp = get_points (L.MKp)
+  }
 \begin{center}
   \begin{tikzpicture}
   \tkzGetNodes
@@ -923,41 +1035,49 @@
   \tkzLabelPoints(O,O',T,T',K,K',M)
   \end{tikzpicture}
 \end{center}
-% paragraph radical_axis_v2 (end)
+\end{minipage}
 
-\paragraph{Radical axis v3} % (fold)
+
+
+Radical axis v3
 \label{par:radical_axis_v3}
 
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
-   \directlua{%
+\directlua{%
 init_elements ()
-   z.O      = point : new (0,0)
-   z.B      = point : new (4,0)
-   z.Op     = point : new (6,0)
-   C.OB     = circle :    new (z.O,z.B)
-   C.OpB    = circle :    new (z.Op,z.B)
-   L.EF     = C.OB : radical_axis (C.OpB)
-   z.E,z.F  = get_points(L.EF)
-   z.M      = L.EF : point (0.2)
-   L        = C.OB : tangent_from (z.M)
-   _,z.T    = get_points (L)
-   L        = C.OpB : tangent_from (z.M)
-   _,z.Tp   = get_points (L)
+scale =.5
+z.O      = point : new (0,0)
+z.B      = point : new (4,0)
+z.Op     = point : new (6,0)
+C.OB     = circle :    new (z.O,z.B)
+C.OpB    = circle :    new (z.Op,z.B)
+L.EF     = C.OB : radical_axis (C.OpB)
+z.E,z.F  = get_points(L.EF)
+z.M      = L.EF : point (0.2)
+L        = C.OB : tangent_from (z.M)
+_,z.T    = get_points (L)
+L        = C.OpB : tangent_from (z.M)
+_,z.Tp   = get_points (L)
 }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
 \begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(O,B O',B)
-   \tkzDrawSegments(M,T M,T')
-   \tkzDrawSegments(E,F)
-   \tkzDrawLine[add=.5 and .5](O,O')
-   \tkzDrawPoints(O,B,O',E,F,M,T,T')
-   \tkzLabelPoints(O,O',B,E,F,T,T')
-   \tkzDrawArc(M,T')(T)
+ \tkzGetNodes
+ \tkzDrawCircles(O,B O',B)
+ \tkzDrawSegments(M,T M,T')
+ \tkzDrawSegments(E,F)
+ \tkzDrawLine[add=.5 and .5](O,O')
+ \tkzDrawPoints(O,B,O',E,F,M,T,T')
+ \tkzLabelPoints(O,O',B,E,F,T,T')
+ \tkzDrawArc(M,T')(T)
 \end{tikzpicture}
 \end{Verbatim}
-
 \directlua{%
 init_elements ()
+scale =.5
 z.O      = point : new (0,0)
 z.B      = point : new (4,0)
 z.Op     = point : new (6,0)
@@ -971,7 +1091,6 @@
 L        = C.OpB : tangent_from (z.M)
 _,z.Tp   = get_points (L)
 }
- 
 \begin{center}
   \begin{tikzpicture}
   \tkzGetNodes
@@ -984,42 +1103,49 @@
   \tkzDrawArc(M,T')(T)
   \end{tikzpicture}
 \end{center}
+\end{minipage}
 % paragraph radical_axis_v3 (end)
 
-\paragraph{Radical axis v4} % (fold)
+Radical axis v4
 \label{par:radical_axis_v4}
 
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   z.O     = point : new (0,0)
-   z.B     = point : new (5,0)
-   z.Op    = point : new (3,0)
-   C.OB    = circle :    new (z.O,z.B)
-   C.OpB   = circle :    new (z.Op,z.B)
-   L.EF    = C.OB : radical_axis (C.OpB)
-   z.E,z.F = get_points(L.EF)
-   z.H     = L.EF.mid
-   z.M     = L.EF : point (.8)
-   _,L     = C.OB : tangent_from (z.M)
-   _,z.T   = get_points (L)
-   _,L     = C.OpB : tangent_from (z.M)
-   _,z.Tp  = get_points (L)
-}
+scale =.5
+z.O     = point : new (0,0)
+z.B     = point : new (5,0)
+z.Op    = point : new (3,0)
+C.OB    = circle :    new (z.O,z.B)
+C.OpB   = circle :    new (z.Op,z.B)
+L.EF    = C.OB : radical_axis (C.OpB)
+z.E,z.F = get_points(L.EF)
+z.H     = L.EF.mid
+z.M     = L.EF : point (.8)
+_,L     = C.OB : tangent_from (z.M)
+_,z.T   = get_points (L)
+_,L     = C.OpB : tangent_from (z.M)
+_,z.Tp  = get_points (L)}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
 \begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(O,B O',B)
-   \tkzDrawSegments(M,T M,T')
-   \tkzDrawSegments(E,F)
-   \tkzDrawLine[add=.3 and .3](O,H)
-   \tkzDrawPoints(O,O',B,E,H,M)
-   \tkzLabelPoints[below right](O,O',E,F,M,T,T')
-   \tkzDrawArc(M,B)(T)
+  \tkzGetNodes
+  \tkzDrawCircles(O,B O',B)
+  \tkzDrawSegments(M,T M,T')
+  \tkzDrawSegments(E,F)
+  \tkzDrawLine[add=.3 and .3](O,H)
+  \tkzDrawPoints(O,O',B,E,H,M)
+  \tkzLabelPoints[below right](O,O',E,F,M,T,T')
+  \tkzDrawArc(M,B)(T)
 \end{tikzpicture}
 \end{Verbatim}
 
 \directlua{%
 init_elements ()
+scale =.5
    z.O     = point : new (0,0)
    z.B     = point : new (5,0)
    z.Op    = point : new (3,0)
@@ -1047,6 +1173,7 @@
      \tkzDrawArc(M,B)(T)
   \end{tikzpicture}
 \end{center}
+\end{minipage}
 % paragraph radical_axis_v4 (end)
 
 % subsubsection method_imeth_circle_radical__axis_c (end)
@@ -1189,62 +1316,66 @@
 
 This method determines a circle with a given centre, orthogonal to a circle that is also given.
 
-\begin{Verbatim}
-\directlua{%
-init_elements ()
-   scale    = .6
-   z.C_1    = point: new (0,0)
-   z.C_2    = point: new (8,0)
-   z.A      = point: new (5,0)
-   C        = circle: new (z.C_1,z.A)
-   z.S,z.T  = get_points (C: orthogonal_from (z.C_2))
-}
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(C_1,T C_2,T)
-   \tkzDrawSegments(C_1,T C_2,T)
-   \tkzDrawLine(C_1,C_2)
-   \tkzMarkRightAngle[fill=teal,%
-  opacity=.2,size=1](C_1,T,C_2)
-   \tkzDrawPoints(C_1,C_2,T)
-   \tkzLabelPoints(C_1,C_2)
-   \tkzLabelPoints[above](T)
-   \tkzLabelSegment[left](C_1,T){r}
-   \tkzLabelSegments[right](C_2,T){$\gamma$}
-   \tkzLabelSegment[below](C_1,C_2){d}
-   \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
-   \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale    = .6
-z.C_1    = point: new (0,0)
-z.C_2    = point: new (8,0)
-z.A  = point: new (5,0)
-C    = circle: new (z.C_1,z.A)
-z.S,z.T  = get_points (C: orthogonal_from (z.C_2))
-}
-
-\begin{center}
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+  \begin{Verbatim}
+  \directlua{%
+  init_elements ()
+     scale    = .6
+     z.C_1    = point: new (0,0)
+     z.C_2    = point: new (8,0)
+     z.A      = point: new (5,0)
+     C        = circle: new (z.C_1,z.A)
+     z.S,z.T  = get_points (C: orthogonal_from (z.C_2))
+  }
   \begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawCircles(C_1,T C_2,T)
-  \tkzDrawSegments(C_1,T C_2,T)
-  \tkzDrawLine(C_1,C_2)
-  \tkzMarkRightAngle[fill=teal,opacity=.2,size=.5](C_1,T,C_2)
-  \tkzDrawPoints(C_1,C_2,T)
-  \tkzLabelPoints(C_1,C_2)
-  \tkzLabelPoints[above](T)
-  \tkzLabelSegment[left](C_1,T){r}
-  \tkzLabelSegments[right](C_2,T){$\gamma$}
-  \tkzLabelSegment[below](C_1,C_2){d}
-  \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
-  \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
+     \tkzGetNodes
+     \tkzDrawCircles(C_1,T C_2,T)
+     \tkzDrawSegments(C_1,T C_2,T)
+     \tkzDrawLine(C_1,C_2)
+     \tkzMarkRightAngle[fill=teal,%
+    opacity=.2,size=1](C_1,T,C_2)
+     \tkzDrawPoints(C_1,C_2,T)
+     \tkzLabelPoints(C_1,C_2)
+     \tkzLabelPoints[above](T)
+     \tkzLabelSegment[left](C_1,T){r}
+     \tkzLabelSegments[right](C_2,T){$\gamma$}
+     \tkzLabelSegment[below](C_1,C_2){d}
+     \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
+     \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
   \end{tikzpicture}
-\end{center}
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{%
+  init_elements ()
+  scale    = .25
+  z.C_1    = point: new (0,0)
+  z.C_2    = point: new (8,0)
+  z.A  = point: new (5,0)
+  C    = circle: new (z.C_1,z.A)
+  z.S,z.T  = get_points (C: orthogonal_from (z.C_2))
+  }
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawCircles(C_1,T C_2,T)
+    \tkzDrawSegments(C_1,T C_2,T)
+    \tkzDrawLine(C_1,C_2)
+    \tkzMarkRightAngle[fill=teal,opacity=.2,size=.5](C_1,T,C_2)
+    \tkzDrawPoints(C_1,C_2,T)
+    \tkzLabelPoints(C_1,C_2)
+    \tkzLabelPoints[above](T)
+    \tkzLabelSegment[left](C_1,T){r}
+    \tkzLabelSegments[right](C_2,T){$\gamma$}
+    \tkzLabelSegment[below](C_1,C_2){d}
+    \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
+    \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
 
+
 % subsubsection method_imeth_circle_orthogonal__from_pt (end)
 
 \subsubsection{Method \Imeth{circle}{orthogonal\_through}} % (fold)
@@ -1294,7 +1425,7 @@
 \end{minipage}
 % subsubsection method_imeth_circle_orthogonal__through (end)
 
-\subsubsection{midcircle} % (fold)
+\subsubsection{Method \Imeth{circle}{mmidcircle}} % (fold)
 \label{ssub:midcircle}
 
 \begin{minipage}{0.95\linewidth }
@@ -1906,8 +2037,7 @@
    if position == "inside tangent" 
    then color = "orange" 
    else color = "blue" end
-}
-       
+}      
 \begin{tikzpicture}
    \tkzGetNodes
    \tkzDrawCircle(A,a)
@@ -1936,6 +2066,568 @@
 \end{minipage}
 % subsubsection circles__position (end)
 
+
+\subsubsection{Method \Imeth{circle}{c\_c\_pp}} % (fold)
+\label{ssub:method_c__c__pp}
+
+Find a circle tangent to a circle and passing through two given points. If one of the points is on the inside and the other on the outside, then there's no solution.
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ init_elements ()
+ scale =.75
+ z.A      = point: new (5,4)
+ z.B      = point: new (3,0)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzDrawPoints(O1,O2,T1,T2)
+  \tkzLabelPoints(O1,O2,T1,T2,A,B)
+  \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ scale =.75
+ z.A      = point: new (5,4)
+ z.B      = point: new (3,0)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzDrawPoints(O1,O2,T1,T2)
+  \tkzLabelPoints(O1,O2,T1,T2,A,B)
+  \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ init_elements ()
+ z.A      = point: new (3,0)
+ z.B      = point: new (0,-3)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+  \tkzDrawCircles[cyan](O1,T1 O2,T2)
+  \tkzDrawPoints(T1,T2)
+  \tkzLabelPoints(O1,O2,T1,T2,A,B)
+  \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ z.A      = point: new (3,0)
+ z.B      = point: new (0,-3)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+  \tkzDrawCircles[cyan](O1,T1 O2,T2)
+  \tkzDrawPoints(T1,T2)
+  \tkzLabelPoints(O1,O2,T1,T2,A,B)
+  \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+
+Special case: the two points are equidistant from the center of the circle
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ init_elements ()
+ scale =.5
+ z.A      = point: new (2,3)
+ z.B      = point: new (2,-3)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ scale =.5
+ z.A      = point: new (2,3)
+ z.B      = point: new (2,-3)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircles[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+\tkzDrawCircles[cyan](O1,T1 O2,T2)
+\tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+
+The line $(AB)$ is tangent to the circle. Only one circle answers the question.
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+  \directlua{
+   init_elements ()
+   scale =.5
+   z.A      = point: new (1,5)
+   z.B      = point: new (1,-3)
+   z.O      = point: new (0,0)
+   z.C      = point: new (1,0) 
+   L.AB     = line: new ( z.A,z.B )
+   C.OC     = circle: new (z.O,z.C)
+   C1,C2    = C.OC: c_c_pp (z.A,z.B)
+   z.O1     = C1.center
+   z.T1     = C1.through
+   z.O2     = C2.center
+   z.T2     = C2.through
+  }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ scale =.5
+ z.A      = point: new (1,5)
+ z.B      = point: new (1,-3)
+ z.O      = point: new (0,0)
+ z.C      = point: new (1,0) 
+ L.AB     = line: new ( z.A,z.B )
+ C.OC     = circle: new (z.O,z.C)
+ C1,C2    = C.OC: c_c_pp (z.A,z.B)
+ z.O1     = C1.center
+ z.T1     = C1.through
+ z.O2     = C2.center
+ z.T2     = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircles[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+\tkzDrawCircles[cyan](O1,T1 O2,T2)
+\tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+Another special case occurs when the straight line $(AB)$ is tangent to the initial circle, and it's even possible for points $A$ and $B$ to be equidistant from the center and for the straight line to be tangent to the circle. Here too, a single circle answers the question
+
+
+\begin{minipage}{.5\textwidth}
+  \begin{Verbatim}
+  \directlua{
+   init_elements ()
+   z.A      = point: new (1,3)
+   z.B      = point: new (1,-3)
+   z.O      = point: new (0,0)
+   z.C      = point: new (1,0) 
+   L.AB     = line: new ( z.A,z.B )
+   C.OC     = circle: new (z.O,z.C)
+   C1,C2    = C.OC: c_c_pp (z.A,z.B)
+   z.O1     = C1.center
+   z.T1     = C1.through
+   z.O2     = C2.center
+   z.T2     = C2.through
+  }
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+  \directlua{
+   init_elements ()
+   z.A      = point: new (1,3)
+   z.B      = point: new (1,-3)
+   z.O      = point: new (0,0)
+   z.C      = point: new (1,0) 
+   L.AB     = line: new ( z.A,z.B )
+   C.OC     = circle: new (z.O,z.C)
+   C1,C2    = C.OC: c_c_pp (z.A,z.B)
+   z.O1     = C1.center
+   z.T1     = C1.through
+   z.O2     = C2.center
+   z.T2     = C2.through
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines[red](A,B)
+  \tkzDrawCircles[red](O,C)
+  \tkzDrawPoints(A,B,C,O)
+  \tkzDrawCircles[cyan](O1,T1 O2,T2)
+  \tkzLabelPoints(O,C,A,B)
+  \end{tikzpicture}
+\end{minipage}
+
+% subsubsection method_c__c__pp (end)
+
+\subsubsection{Method \Imeth{circle}{c\_cc\_p}} % (fold)
+\label{ssub:method_c_cc_p}
+Circle  tangent to two circles passing through a point
+
+Let's begin with the general case. The two circles are disjoint, and point 
+$P$ lies outside both of them. Notice that the two solution circles intersect at two points, one of which is the given point $P$. To determine the second intersection point, I used a similitude. This approach leads to an intriguing special case known as the Arbelos configuration. In this arrangement, the solution circles are also tangent at point $P$. One of the circles, in this case, is the Pappus circle.
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale =.75
+z.A  = point : new ( 0  , 0  )
+z.TA = point : new ( 3  , 0  )
+z.B  = point : new (  6 , 2  )
+z.TB = point : new (  6 , 1  )
+z.P  = point : new (  3 , 6  )
+C.A  = circle : new (z.A,z.TA)
+C.B  = circle : new (z.B,z.TB)
+C1,C2= C.A :  c_cc_p (C.B,z.P) 
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}   
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A  = point : new ( 0  , 0  )
+z.TA = point : new ( 3  , 0  )
+z.B  = point : new (  6 , 2  )
+z.TB = point : new (  6 , 1  )
+z.P  = point : new (  3 , 6  )
+C.A  = circle : new (z.A,z.TA)
+C.B  = circle : new (z.B,z.TB)
+C1,C2= C.A :  c_cc_p (C.B,z.P) 
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}   
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+The first special case involves two given tangent circles. The point $P$ is not the point of tangency of the Pappus circle.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A  = point : new ( 0  , 0  )
+z.TA = point : new ( 2  , 0  )
+z.B  = point : new (  3 , 0  )
+z.TB = point : new (  2 , 0  )
+z.P  = point : new (  3 , 4 )
+C.A  = circle : new (z.A,z.TA)
+C.B  = circle : new (z.B,z.TB)
+C1,C2 =  C.A :  c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}   
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A  = point : new ( 0  , 0  )
+z.TA = point : new ( 2  , 0  )
+z.B  = point : new (  3 , 0  )
+z.TB = point : new (  2 , 0  )
+z.P  = point : new (  3 , 4 )
+C.A  = circle : new (z.A,z.TA)
+C.B  = circle : new (z.B,z.TB)
+C1,C2 =  C.A :  c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}   
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzDrawPoints[size = 3](P)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+
+Here's the Arbelos configuration
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A       = point : new ( 0  , 0  )
+z.TA      = point : new ( 2  , 0  )
+z.B       = point : new (  3 , 0  )
+z.TB      = point : new (  2 , 0  )
+C.A       = circle : new (z.A,z.TA)
+C.B       = circle : new (z.B,z.TB)
+z.I       = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD      = C.B : antipode(z.TB)
+z.TE      =  C.A : antipode(z.TA)
+z.O       = midpoint(z.TD,z.TE)
+C.O       = circle : new (z.O,z.TD)
+z.P       = C.O : tangent_from (z.I).pb
+C1,C2     = C.A :  c_cc_p (C.B,z.P)
+z.O1      = C1.center
+z.O2      = C2.center
+z.T1      = C1.through
+z.T2      = C2.through
+}   
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A       = point : new ( 0  , 0  )
+z.TA      = point : new ( 2  , 0  )
+z.B       = point : new (  3 , 0  )
+z.TB      = point : new (  2 , 0  )
+C.A       = circle : new (z.A,z.TA)
+C.B       = circle : new (z.B,z.TB)
+z.I       = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD      = C.B : antipode(z.TB)
+z.TE      =  C.A : antipode(z.TA)
+z.O       = midpoint(z.TD,z.TE)
+C.O       = circle : new (z.O,z.TD)
+z.P       = C.O : tangent_from (z.I).pb
+C1,C2     = C.A :  c_cc_p (C.B,z.P)
+z.O1      = C1.center
+z.O2      = C2.center
+z.T1      = C1.through
+z.T2      = C2.through
+}   
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+If the point $P$ is not the contact point of the Pappus circle, we return to the general case.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A       = point : new ( 0  , 0  )
+z.TA      = point : new ( 2  , 0  )
+z.B       = point : new (  3 , 0  )
+z.TB      = point : new (  2 , 0  )
+C.A       = circle : new (z.A,z.TA)
+C.B       = circle : new (z.B,z.TB)
+z.I       = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD      = C.B : antipode(z.TB)
+z.TE      =  C.A : antipode(z.TA)
+z.O       = midpoint(z.TD,z.TE)
+C.O       = circle : new (z.O,z.TD)
+z.P       = C.O : tangent_from (z.I).pb
+C1,C2     = C.A :  c_cc_p (C.B,z.P)
+z.O1      = C1.center
+z.O2      = C2.center
+z.T1      = C1.through
+z.T2      = C2.through
+}   
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A       = point : new ( 0  , 0  )
+z.TA      = point : new ( 2  , 0  )
+z.B       = point : new (  3 , 0  )
+z.TB      = point : new (  2 , 0  )
+C.A       = circle : new (z.A,z.TA)
+C.B       = circle : new (z.B,z.TB)
+z.I       = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD      = C.B : antipode(z.TB)
+z.TE      =  C.A : antipode(z.TA)
+z.O       = midpoint(z.TD,z.TE)
+C.O       = circle : new (z.O,z.TD)
+z.P       = C.O : tangent_from (z.I).pb
+C1,C2     = C.A :  c_cc_p (C.B,z.P)
+z.O1      = C1.center
+z.O2      = C2.center
+z.T1      = C1.through
+z.T2      = C2.through
+}   
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection method_c_cc_p (end)
+
+\subsubsection{Method c\_lc\_p} % (fold)
+\label{ssub:method_c_lc_p}
+
+Circle tangent to a line and a circle passing through a given point.
+
+First, let's look at the general case. The point and the circle are in the same half-plane with respect to the line.
+The point is neither on the line nor on the circle.
+
+There are 4 circles verifying the conditions. Two are tangent externally, and two internally to the initial circle. The latter two are obtained with the \code{inside} argument.
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+  \directlua{
+  z.A   = point : new (0 , 0)
+  z.B   = point : new (4 , 0 )
+  L.AB  = line  : new (z.A,z.B)
+  z.O   = point : new (3 , 3)
+  z.T   = point : new (3 , 2)
+  z.P   = point : new (2 , .25)
+  C.OT  = circle : new (z.O , z.T)
+  C1,C2 = C.OT : c_lc_p (L.AB , z.P)
+  z.O1  = C1.center
+  z.O2  = C2.center
+  C3,C4 = C.OT : c_lc_p (L.AB , z.P,inside)
+  z.O3  = C3.center
+  z.O4  = C4.center 
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawCircles[thick](O,T)
+  \tkzDrawCircles[red](O1,P O2,P)
+  \tkzDrawCircles[cyan](O3,P O4,P)
+   \tkzDrawLines[thick](A,B)
+    \tkzDrawPoints[size = 2](P)
+   \tkzDrawPoints(A,B,O,O1,O2,O3,O4)
+   \tkzLabelPoints(A,B,O,O1,O2,O3,O4)
+    \tkzLabelPoints[above](P)
+  \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+  \directlua{
+  init_elements()
+  z.A   = point : new (0 , 0)
+  z.B   = point : new (4 , 0 )
+  L.AB  = line  : new (z.A,z.B)
+  z.O   = point : new (3 , 3)
+  z.T   = point : new (3 , 2)
+  z.P   = point : new (2 , .25)
+  C.OT  = circle : new (z.O , z.T)
+  C1,C2 = C.OT : c_lc_p (L.AB , z.P)
+  z.O1  = C1.center
+  z.O2  = C2.center
+  C3,C4 = C.OT : c_lc_p (L.AB , z.P,inside)
+  z.O3  = C3.center
+  z.O4  = C4.center
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawCircles[thick](O,T)
+  \tkzDrawCircles[red](O1,P O2,P)
+  \tkzDrawCircles[cyan](O3,P O4,P)
+   \tkzDrawLines[thick](A,B)
+    \tkzDrawPoints[size = 2](P)
+   \tkzDrawPoints(A,B,O,O1,O2,O3,O4)
+   \tkzLabelPoints(A,B,O,O1,O2,O3,O4)
+    \tkzLabelPoints[above](P)
+  \end{tikzpicture}
+\end{minipage}
+% subsubsection method_c_lc_p (end)
 % subsection methods_of_the_class_circle (end)
 % section class_circle (end)
 

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-line.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-line.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-line.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -30,11 +30,11 @@
 \Iattr{line}{slope} & Slope of the line & [\ref{ssub:example_class_line}] \\
 \Iattr{line}{length} &|l = L.AB.length|& [\ref{sub:transfer_from_lua_to_tex} ; \ref{ssub:example_class_line}] \\  
 \Iattr{line}{north\_pa}   & & [\ref{ssub:example_class_line}]  \\
-\Iattr{line}{north\_pb}   & &\\
-\Iattr{line}{south\_pa}   & &\\
-\Iattr{line}{south\_pb}   & & [\ref{ssub:example_class_line}]  \\
-\Iattr{line}{east}   & &\\
-\Iattr{line}{west}   & &\\
+\Iattr{line}{north\_pb}   & & \\
+\Iattr{line}{south\_pa}   & & \\
+\Iattr{line}{south\_pb}   & & \\
+\Iattr{line}{east}        & & \\
+\Iattr{line}{west}        & & \\
 \Iattr{line}{vec}   & |V.AB = L.AB.vec|& defines $\overrightarrow{AB}$  [\ref{sec:class_vector}] \\
 \bottomrule
 \end{tabular}
@@ -53,8 +53,8 @@
 z.w = L.ab.west
 z.e = L.ab.east
 z.r = L.ab.north_pa
-z.s  = L.ab.south_pb
-sl   = L.ab.slope
+z.s = L.ab.south_pb
+sl  = L.ab.slope
 len = L.ab.length
 }
 
@@ -172,6 +172,17 @@
 \midrule 
 \Igfct{line}{new(pt, pt)}      & |L.AB = line : new(z.A,z.B)| & Create line $(AB)$ ;  [\ref{sub:altshiller}] \\
 \midrule 
+\textbf{Real} &&\\
+\midrule 
+\Imeth{line}{distance (pt)}   & |d = L.AB : distance (z.C)|  &   [\ref{ssub:method_imeth_line_distance}; \ref{ssub:example_distance_and_projection}] \\
+\Imeth{line}{slope ()} &   |a = L.AB : slope()| & better is L.AB.slope; [\ref{ssub:example_class_line}]\\ 
+\textbf{Boolean} &&\\
+\midrule 
+\Imeth{line}{in\_out (pt)}  & |b = L.AB: in_out(z.C)|  & b=true if $C\in (AB)$ ;  [\ref{ssub:method_imeth};\ref{ssub:in_out_for_a_line}] \\
+\Imeth{line}{in\_out\_segment(pt)} &   |b = L.AB:in_out_segment(z.C)| & b=true if $C\in [AB$] [\ref{ssub:method_imeth_line_in__in__out__segment}] \\ 
+\Imeth{line}{is\_parallel(L)}  & &  \\
+\Imeth{line}{is\_orthogonal(L)}  & &  \\
+\Imeth{line}{is\_equidistant(pt)}  & &  \\\midrule 
 \textbf{Points} &&\\
 \midrule 
 \Imeth{line}{gold\_ratio ()}  & |z.C=L.AB : gold_ratio()|   &  [\ref{sub:gold_ratio_with_segment} ; \ref{sub:the_figure_pappus_circle} ; \ref{sub:bankoff_circle} ]  \\
@@ -193,6 +204,7 @@
 \Imeth{line}{report(d,pt)}    &|z.M=L.AB: report(2,z.N)| &|MN=2|; $AB\parallel MN$ ;  [ex. \ref{ssub:method_report}]\\
 \Imeth{line}{colinear\_at(pt,k)}    &|z.D=L.AB: colinear_at(z.C,2)| &|CD=2AB|; $AB\parallel CD$ ;  [ex. \ref{ssub:method_imeth_line_colinear__at}]\\
 \midrule 
+
 \textbf{Lines} &&\\
 \midrule  
 \Imeth{line}{ll\_from ( pt )}  &|L.CD=L.AB: ll_from(z.C)| &$(CD) \parallel (AB)$;  [\ref{ssub:new_line_from_a_defined_line}] \\
@@ -199,19 +211,19 @@
 \Imeth{line}{ortho\_from ( pt )} &|L.CD=L.AB: ortho_from(z.C)|&$(CD) \perp (AB)$;  [\ref{ssub:newline_ortho_from}] \\
  \Imeth{line}{mediator ()} & |L.uv=L.AB: mediator()| & perpendicular bisector of $(A,B)$ \footnote{You can use |perpendicular_bisector| intead of \tkzname{mediator}.}; [\ref{ssub:method_imeth_line_mediator}]\\
 \midrule 
+
 \textbf{Triangles}&&\\
 \midrule  
 \Imeth{line}{equilateral (<swap>)}  & |T.ABC=L.AB:equilateral()|   & $(\overrightarrow{AB},\overrightarrow{AC})>0$ or $<0$ with swap \footnote{Triangles are defined in the direct sense of rotation, unless the "swap" option is present.}; [\ref{ssub:object_rotation}]  \\
 \Imeth{line}{isosceles (an<,swap>)}&|T.ABC=L.AB:isosceles(math.pi/6)|& [\ref{ssub:method_imeth_line_isosceles}]\\
+\Imeth{line}{isosceles\_a (an<,swap>)}& same as |isosceles| & \\
+\Imeth{line}{isosceles\_s (an<,swap>)}&|T.ABC=L.AB:isosceles_s(4)| AC=BC = 4& \\
 \Imeth{line}{two\_angles (an,an)} &|T.ABC=L.AB:two_angles(an,an)|&note \footnote{The given side is between the two angles} [\ref{ssub:triangle_with_two__angles}] \\
 \Imeth{line}{school ()}  & 30°,60°, 90°  & \\
-\Imeth{line}{sss (r,r)}  & $AC=r$ $BC=r$ & [\ref{ssub:triangle_with_three_given_sides}] \\
-\Imeth{line}{sas (r,an)}  & $AC =r$ $\widehat{BAC} = an$ & [\ref{ssub:triangle_with_three_given_sides}]  \\
-\Imeth{line}{ssa (r,an)}  & $AC =r$ $\widehat{ABC} = an$&  [\ref{ssub:triangle_with_three_given_sides}]\\
-\midrule 
-\textbf{Squares}&&\\
-\midrule  
-\Imeth{line}{square ()} &|S.AB=L.AB : square () | &  create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}; [\ref{ssub:object_rotation}] \\
+\Imeth{line}{half (<swap>)}  & T.ABC = L.AB:half() $\widehat{B}$ = 90° and 2BC = AB& \\
+\Imeth{line}{sss (r,r<,swap>)}  & $AC=r$ $BC=r$ & [\ref{ssub:triangle_with_three_given_sides}] \\
+\Imeth{line}{sas (r,an<,swap>)}  & $AC =r$ $\widehat{BAC} = an$ & [\ref{ssub:triangle_with_three_given_sides}]  \\
+\Imeth{line}{ssa (r,an<,swap>)}  & $AC =r$ $\widehat{ABC} = an$&  [\ref{ssub:triangle_with_three_given_sides}]\\
 \bottomrule
 \end{tabular}
 \egroup
@@ -227,6 +239,10 @@
 \toprule
 \textbf{Methods} & \textbf{Comments} & \\
 \midrule 
+\textbf{Squares}&&\\
+\midrule  
+\Imeth{line}{square ()} &|S.AB=L.AB : square () | &  create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}; [\ref{ssub:object_rotation}] \\
+\midrule 
 \textbf{Sacred triangles}&&\\
 \midrule  
 \Imeth{line}{gold (<swap>)}    &|T.ABC=L.AB:gold()| & right in $B$ and $AC = \varphi \times AB $; [\ref{line:met}] \\
@@ -233,14 +249,20 @@
 \Imeth{line}{euclide (<swap>)} &|T.ABC=L.AB:euclide()| &$AB=AC$ ; $(\overrightarrow{AB},\overrightarrow{AC}) = \pi/5$; [\ref{line:met}] \\
 \Imeth{line}{golden (<swap>)}  &|T.ABC=L.AB:golden()|   &
     $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times \pi/5$ ;  [\ref{line:met}] \\
-\Imeth{line}{divine ()}  & &   [\ref{line:met}] \\  
-\Imeth{line}{egyptian ()} & & [\ref{line:met}] \\
-\Imeth{line}{cheops ()}  & & [\ref{line:met}] \\
+\Imeth{line}{sublime (<swap>)} & = golden & [\ref{line:met}] \\
+\Imeth{line}{divine (<swap>)}  & &   [\ref{line:met}] \\  
+\Imeth{line}{golden\_gnomon (<swap>)}  & = devine &   [\ref{line:met}] \\  
+\Imeth{line}{egyptian (<swap>)} & & [\ref{line:met}] \\
+\Imeth{line}{pythagoras (<swap>)} & = egyptian & [\ref{line:met}] \\
+\Imeth{line}{isis (<swap>)} & = egyptian & [\ref{line:met}] \\
+\Imeth{line}{cheops (<swap>)}  &  & [\ref{line:met}] \\
 \midrule 
 \textbf{Circles} &&\\
 \midrule 
 \Imeth{line}{circle ()}  & |C.AB = L.AB : circle ()| &  center pa through pb \\
 \Imeth{line}{apollonius (r)}  & |C.apo = L.AB : apollonius (2)|&  Set of points tq. |MA/MB = 2|; [\ref{ssub:apollonius_circle_ma_mb_k}] \\
+\Imeth{line}{c\_l\_pp (pt,pt)} & |C1,C2  = L.AB : c_l_pp(z.M,z.N)| & [\ref{ssub:c_l_pp}]  \\ 
+\Imeth{line}{c\_ll\_p (pt,pt)} & |C1,C2  = L.AB : c_ll_p(z.C,z.P)| & [\ref{ssub:method_c__ll__p}]  \\ 
 \midrule 
 \textbf{Transformations} &&\\
 \midrule 
@@ -248,51 +270,380 @@
 \Imeth{line}{translation ( obj )} & |new obj = L.AB : translation (obj)|& [\ref{ssub:example_translation}] \\
 \Imeth{line}{projection ( obj )}  & |z.H = L.AB : projection (z.C)| & $CH \perp (AB)$ and $H\in (AB)$; [\ref{ssub:example_projection_of_several_points}; \ref{ssub:example_combination_of_methods}]\\
 ...  & &  [ \ref{ssub:example_projection_of_several_points}; \ref{ssub:example_combination_of_methods}]\\
-\midrule 
-\textbf{Miscellaneous} &&\\
-\midrule 
-\Imeth{line}{distance (pt)}   & |d = L.Ab : distance (z.C)|  &   [\ref{ssub:example_distance_and_projection}] \\
-\Imeth{line}{in\_out (pt)}  & |b = L.AB: in_out(z.C)|  & b=true if $C\in (AB)$ ;  [\ref{ssub:in_out_for_a_line}] \\
-\Imeth{line}{slope ()} &   |a = L.AB : slope()| & better is L.AB.slope; [\ref{ssub:example_class_line}]\\ 
-\Imeth{line}{in\_out\_segment (pt)} &   |b = L.AB : in_out_segment(z.C)| & b=true if $C\in [AB$]  \\ 
 \bottomrule
 \end{tabular}
 \egroup
 \end{minipage}
 
+\subsubsection{Method \Imeth{line}{distance}} % (fold)
+\label{ssub:method_imeth_line_distance}
+
+This method gives the distance from a point to a straight line.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+function calc_distance (L,p)
+ if L : in_out (p) 
+ then
+  return  point.abs(p-L.pa)/L.length
+ else 
+   return 0
+ end 
+end
+z.A     = point: new (0,0)
+z.B     = point: new (2,4)
+z.X     = point: new (3,6)
+z.Y     = point: new (2,0)
+L.AB    = line :  new (z.A,z.B)
+dx      = calc_distance (L.AB,z.X)
+dy      = calc_distance (L.AB,z.Y)
+}
+\tkzUseLua{k}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{dx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{dy}}
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+   z.A            = point : new (0 , 0)
+   z.B            = point : new (4 , 3)
+   z.C            = point : new (1 , 5)
+   L.AB           = line : new (z.A,z.B)
+   d              = L.AB : distance (z.C)
+   l              = L.AB.length
+   z.H            = L.AB : projection (z.C)
+}
+\begin{center}
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines(A,B C,H)
+  \tkzDrawPoints(A,B,C,H)
+  \tkzLabelPoints(A,B,C,H)
+  \tkzLabelSegment[above right=2em,draw](C,H){$CH = \tkzUseLua{d}$}
+  \tkzLabelSegment[below right=1em,draw](A,B){$AB = \tkzUseLua{l}$}
+  \end{tikzpicture}
+\end{center}
+
+\end{minipage}
+% subsubsection method_imeth_line_distance (end)
+
+\subsubsection{Method \Imeth{line}{in\_out}} % (fold)
+\label{ssub:method_imeth}
+
+This method shows whether a point belongs to a straight line.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+function calc_ratio (L,p)
+ if L : in_out (p) 
+ then
+  return  point.abs(p-L.pa)/L.length
+ else 
+   return 0
+ end 
+end
+z.A     = point: new (0,0)
+z.B     = point: new (2,4)
+z.X     = point: new (3,6)
+z.Y     = point: new (2,0)
+L.AB    = line :  new (z.A,z.B)
+dx      = calc_ratio (L.AB,z.X)
+dy      = calc_ratio (L.AB,z.Y)
+}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{dx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{dy}}
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+function calc_distance (L,p)
+ if L : in_out (p) 
+ then
+  return  point.abs(p-L.pa)/L.length
+ else 
+   return 0
+ end 
+end
+z.A     = point: new (0,0)
+z.B     = point: new (2,4)
+z.X     = point: new (3,6)
+z.Y     = point: new (2,0)
+L.AB    = line :  new (z.A,z.B)
+dx      = calc_distance (L.AB,z.X)
+dy      = calc_distance (L.AB,z.Y)
+}
+\begin{center}
+  \begin{tikzpicture}
+   \tkzGetNodes
+   \tkzDrawLine(A,B)
+   \tkzDrawPoints(A,B,X,Y)
+   \tkzLabelPoints(A,B)
+   \tkzLabelPoint(X){X : \tkzUseLua{dx}}
+   \tkzLabelPoint(Y){Y : \tkzUseLua{dy}}
+  \end{tikzpicture}
+\end{center}
+\end{minipage}
+
+% subsubsection method_imeth (end)
+
+\subsubsection{Method \Imeth{line}{in\_in\_out\_segment}} % (fold)
+\label{ssub:method_imeth_line_in__in__out__segment}
+
+Variant of the previous method; indicates whether a point is on or off a segment.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+  \directlua{
+  function foo (L,p)
+   if L : in_out_segment (p) 
+   then
+    return  "in"
+   else 
+     return "out"
+   end 
+  end
+  z.A     = point: new (0,0)
+  z.B     = point: new (2,4)
+  z.X     = point: new (-1,-2)
+  z.Y     = point: new (1,2)
+  L.AB    = line :  new (z.A,z.B)
+  bx      = foo(L.AB,z.X)
+  by      = foo(L.AB,z.Y)
+  }
+    \begin{tikzpicture}
+        \tkzGetNodes
+         \tkzDrawLine(A,B)
+         \tkzDrawPoints(A,B,X,Y)
+         \tkzLabelPoints(A,B)
+         \tkzLabelPoint(X){X : \tkzUseLua{bx}}
+         \tkzLabelPoint(Y){Y : \tkzUseLua{by}}
+    \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{
+  function foo (L,p)
+   if L : in_out_segment (p) 
+   then
+    return  "in"
+   else 
+     return "out"
+   end 
+  end
+  z.A     = point: new (0,0)
+  z.B     = point: new (2,4)
+  z.X     = point: new (-1,-2)
+  z.Y     = point: new (1,2)
+  L.AB    = line :  new (z.A,z.B)
+  bx      = foo(L.AB,z.X)
+  by      = foo(L.AB,z.Y)
+  }
+  \begin{center}
+    \begin{tikzpicture}
+        \tkzGetNodes
+         \tkzDrawLine(A,B)
+         \tkzDrawPoints(A,B,X,Y)
+         \tkzLabelPoints(A,B)
+         \tkzLabelPoint(X){X : \tkzUseLua{bx}}
+         \tkzLabelPoint(Y){Y : \tkzUseLua{by}}
+    \end{tikzpicture}
+  \end{center}
+
+\end{minipage}
+
+% subsubsection method_imeth_line_in__in__out__segment (end)
+
+\subsubsection{Method \Imeth{line}{is\_parallel}} % (fold)
+\label{ssub:method_imeth_line_is__parallel}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A = point : new ( 0  , 0  )
+z.B = point : new ( 4  , 2  )
+L.AB = line : new (z.A,z.B)
+z.C = point : new ( 1  , 2  )
+z.D = point : new ( 5  , 4  )
+L.CD = line : new (z.C,z.D)
+if L.AB:is_parallel (L.CD) 
+then tex.print("parallel") 
+else tex.print("no parallel") 
+end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B,C,D)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{
+  z.A = point : new ( 0  , 0  )
+  z.B = point : new ( 4  , 2  )
+  L.AB = line : new (z.A,z.B)
+  z.C = point : new ( 1  , 2  )
+  z.D = point : new ( 5  , 4  )
+  L.CD = line : new (z.C,z.D)
+  if L.AB:is_parallel (L.CD) then tex.print("parallel") else tex.print("no parallel") end
+  }
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawLines(A,B C,D)
+    \tkzDrawPoints(A,B,C,D)
+    \tkzLabelPoints(A,B,C,D)
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
+
+% subsubsection method_imeth_line_is__parallel (end)
+
+\subsubsection{Method \Imeth{line}{is\_orthogonal}} % (fold)
+\label{ssub:method_imeth_line_is__orthogonal}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+  \directlua{
+  z.A = point : new (0 , 0 )
+  z.B = point : new (0 , 4 )
+  L.AB = line : new (z.A,z.B)
+  z.C = point : new (3 , 4 )
+  L.BC = line : new (z.B,z.C)
+  if L.AB:is_orthogonal (L.BC)
+   then tex.print("orthogonal") 
+   else tex.print("no orthogonal")
+    end
+  }
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawLines(A,B B,C A,C)
+    \tkzDrawPoints(A,B,C)
+    \tkzLabelPoints(A,B,C)
+    \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{
+  z.A = point : new ( 0  , 0 )
+  z.B = point : new ( 0  , 4 )
+  L.AB = line : new (z.A,z.B)
+  z.C = point : new ( 3  , 4 )
+  L.BC = line : new (z.B,z.C)
+  if L.AB:is_orthogonal (L.BC) then 
+   tex.print("orthogonal") else 
+   tex.print("no orthogonal") 
+   end
+  }
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawLines(A,B B,C A,C)
+    \tkzDrawPoints(A,B,C)
+    \tkzLabelPoints(A,B,C)
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
+% subsubsection method_imeth_line_is__orthogonal (end)
+
+\subsubsection{Method \Imeth{line}{is\_equidistant}} % (fold)
+\label{ssub:method_imeth_line_is__equidistant}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+  z.A = point : new (0 , 0 )
+  z.B = point : new (0 , 4 )
+  z.C = point : new (4 , 4 )
+  L.AC = line : new (z.A,z.C)
+   if L.AC:is_equidistant (z.B) 
+    then tex.print("equidistant")
+    else tex.print("no equidistant")
+    end
+  }
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawLines(A,B B,C A,C)
+    \tkzDrawPoints(A,B,C)
+    \tkzLabelPoints(A,B,C)
+    \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+  z.A = point : new (0 , 0 )
+  z.B = point : new (0 , 4 )
+  z.C = point : new (4 , 4 )
+  L.AC = line : new (z.A,z.C)
+   if L.AC:is_equidistant (z.B) 
+    then tex.print("equidistant")
+    else tex.print("no equidistant")
+    end
+  }
+  \begin{center}
+      \begin{tikzpicture}
+      \tkzGetNodes
+      \tkzDrawLines(A,B B,C A,C)
+      \tkzDrawPoints(A,B,C)
+      \tkzLabelPoints(A,B,C)
+      \end{tikzpicture}
+  \end{center}
+\end{minipage}
+
+% subsubsection method_imeth_line_is__equidistant (end)
+
 \subsubsection{Method \Imeth{line}{report}} % (fold)
 \label{ssub:method_report}
 
 |report (d,pt)| If the point is absent, the transfer is made from the first point that defines the line.
 
+\vspace{6pt}
 \begin{minipage}{.5\textwidth}
   \begin{Verbatim}
   \directlua{%
 init_elements ()
-  z.A  = point : new (1,-1)
-  z.B  = point : new (5,0)
-  L.AB = line : new ( z.A , z.B ) 
-  z.M  = point : new (2,3)
-  z.N  = L.AB :  report (3,z.M)
-  z.O  = L.AB :  report (3)
-  }
-  \begin{tikzpicture}
+z.A  = point : new (0,0)
+z.B  = point : new (4,3)
+L.AB = line : new ( z.A , z.B )
+z.M  = point : new (0,2)
+z.N  = L.AB :  report (2.5,z.M)
+z.O  = L.AB :  report (2.5)
+}
+\begin{tikzpicture}
   \tkzGetNodes
   \tkzDrawSegments(A,B M,N)
   \tkzDrawPoints(A,B,M,N,O)
   \tkzLabelPoints(A,B,M,N,O)
-  \end{tikzpicture}
-  \end{Verbatim}
+\end{tikzpicture}
+\end{Verbatim}
 \end{minipage}
 \begin{minipage}{.5\textwidth}
   \directlua{%
 init_elements ()
-z.A  = point : new (1,-1)
-z.B  = point : new (5,0)
-L.AB = line : new ( z.A , z.B ) 
-z.M  = point : new (2,3)
-z.N  = L.AB :  report (3,z.M)
-z.O  = L.AB :  report (3)
+z.A  = point : new (0,0)
+z.B  = point : new (4,3)
+L.AB = line : new ( z.A , z.B )
+z.M  = point : new (0,2)
+z.N  = L.AB :  report (2.5,z.M)
+z.O  = L.AB :  report (2.5)
 }
 \begin{tikzpicture}
 \tkzGetNodes
@@ -320,7 +671,7 @@
 }
 \begin{tikzpicture}
    \tkzGetNodes
-   \tkzDrawPolygons(A,B,C) 
+   \tkzDrawPolygons(A,B,C)
    \tkzDrawPoints(A,B,C)
    \tkzLabelPoints(A,B)
    \tkzLabelPoints[above](C)
@@ -344,7 +695,7 @@
    \begin{center}
      \begin{tikzpicture}
         \tkzGetNodes
-        \tkzDrawPolygons(A,B,C) 
+        \tkzDrawPolygons(A,B,C)
         \tkzDrawPoints(A,B,C)
         \tkzLabelPoints(A,B)
         \tkzLabelPoints[above](C)
@@ -374,7 +725,7 @@
    T.SY           = T.abc : symmedian ()
    z.Ka,z.Kb,z.Kc = get_points (T.SY)
    L.Kb          = T.abc : symmedian_line (1)
-  _,z.Kb        = get_points(L.Kb) 
+  _,z.Kb        = get_points(L.Kb)
 }
 \begin{tikzpicture}
 \tkzGetNodes
@@ -400,7 +751,7 @@
    z.Ka,z.Kb,
    z.Kc       = get_points (T.SY)
    L.Kb       = T.abc : symmedian_line (1)
-  _,z.Kb      = get_points(L.Kb) 
+  _,z.Kb      = get_points(L.Kb)
 }
 \begin{tikzpicture}
 \tkzGetNodes
@@ -434,10 +785,10 @@
   z.D = T.ABD.pc
   z.E = T.ABE.pc
 }
-\hspace{\fill}  
+\hspace{\fill}
 \begin{tikzpicture}[gridded]
   \tkzGetNodes
-  \tkzDrawPolygons(A,B,C A,B,D A,B,E) 
+  \tkzDrawPolygons(A,B,C A,B,D A,B,E)
   \tkzDrawPoints(A,B,C,D,E)
   \tkzLabelPoints(A,B)
   \tkzLabelPoints[above](C,D,E)
@@ -461,7 +812,7 @@
 \begin{center}
   \begin{tikzpicture}[gridded]
     \tkzGetNodes
-    \tkzDrawPolygons(A,B,C A,B,D A,B,E) 
+    \tkzDrawPolygons(A,B,C A,B,D A,B,E)
     \tkzDrawPoints(A,B,C,D,E)
     \tkzLabelPoints(A,B)
     \tkzLabelPoints[above](C,D,E)
@@ -474,7 +825,6 @@
 \subsubsection{Triangle with side between side and angle} % (fold)
 \label{ssub:triangle_with_side_between_side_and_angle}
 
-In some cases, two solutions are possible.
 
 \begin{minipage}{.4\textwidth}
 \begin{Verbatim}
@@ -484,13 +834,14 @@
    z.A   = point : new ( 0 , 0 )
    z.B   = point : new ( 5 , 0 )
    L.AB  = line : new ( z.A , z.B )
-   T.ABC,T.ABD =   L.AB : ssa (value(3),math.pi/6)
+   T.ABC =   L.AB : ssa (value(3),math.pi/6)
+   T.ABD =   L.AB : ssa (value(3),math.pi/6,swap)
    z.C   = T.ABC.pc
    z.D   = T.ABD.pc
 }
 \begin{tikzpicture}[gridded]
    \tkzGetNodes
-   \tkzDrawPolygons(A,B,C A,B,D) 
+   \tkzDrawPolygons(A,B,C A,B,D)
    \tkzDrawPoints(A,B,C,D)
    \tkzLabelPoints(A,B)
    \tkzLabelPoints[above](C,D)
@@ -507,7 +858,8 @@
       z.A = point : new ( 0 , 0 )
       z.B = point : new ( 5 , 0 )
       L.AB = line : new ( z.A , z.B )
-      T.ABC,T.ABD =   L.AB : ssa (value(3),math.pi/6)
+      T.ABC  =   L.AB : ssa (value(3),math.pi/6)
+      T.ABD =   L.AB : ssa (value(3),math.pi/6,swap)
       z.C = T.ABC.pc
       z.D = T.ABD.pc
    }
@@ -515,7 +867,7 @@
 \begin{center}
   \begin{tikzpicture}[gridded]
         \tkzGetNodes
-        \tkzDrawPolygons(A,B,C A,B,D) 
+        \tkzDrawPolygons(A,B,C A,B,D)
         \tkzDrawPoints(A,B,C,D)
         \tkzLabelPoints(A,B)
         \tkzLabelPoints[above](C,D)
@@ -537,10 +889,10 @@
 \begin{tabular}{ll}
 \toprule
 \textbf{Name} & \textbf{definition}  \\
-\midrule 
+\midrule
 \Imeth{line}{gold (<swap>)}     & Right triangle with $a=\varphi$, $b=1$ and $c=\sqrt{\varphi}$\\
 \Imeth{line}{golden (<swap>)}   & Right triangle $b=\varphi$, $c=1$ ; half of gold rectangle   \\
-\Imeth{line}{divine ()}  & Isosceles $a=\varphi$, $b=c=1$ and $\beta = \gamma=\pi/5$ \\   
+\Imeth{line}{divine ()}  & Isosceles $a=\varphi$, $b=c=1$ and $\beta = \gamma=\pi/5$ \\
 \Imeth{line}{pythagoras ()}  & $a=5$, $b=4$, $c=3$ and other names: isis or egyptian\\
 \Imeth{line}{sublime ()}  & Isosceles $a=1$, $b=c=\varphi$  and $\beta =\gamma=2\pi/5$ ; other name: euclid\\
 \Imeth{line}{cheops ()}  &  Isosceles $a=2$, $b=c=\varphi$  and height = $\sqrt{\varphi}$ \\
@@ -569,7 +921,7 @@
 }
 \begin{tikzpicture}
    \tkzGetNodes
-   \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H) 
+   \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
    \tkzDrawPoints(A,...,H)
    \tkzLabelPoints(A,...,H)
 \end{tikzpicture}
@@ -596,7 +948,7 @@
 }
 \begin{tikzpicture}
    \tkzGetNodes
-   \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H) 
+   \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
    \tkzDrawPoints(A,...,H)
    \tkzLabelPoints(A,...,H)
 \end{tikzpicture}
@@ -891,7 +1243,7 @@
 \subsubsection{Method \Imeth{line}{mediator}} % (fold)
 \label{ssub:method_imeth_line_mediator}
 
-In Mathworld, the mediator is the plane through the midpoint of a line segment and perpendicular to that segment, also called a mediating plane. The term "mediator" was introduced by J. Neuberg (Altshiller-Court 1979, p. 298). Here, I have adopted the French term and the mediator or 
+In Mathworld, the mediator is the plane through the midpoint of a line segment and perpendicular to that segment, also called a mediating plane. The term "mediator" was introduced by J. Neuberg (Altshiller-Court 1979, p. 298). Here, I have adopted the French term and the mediator or
 the perpendicular bisector  of a line segment, is a line segment perpendicular to the segment and passing through the midpoint of this segment.
 \begin{minipage}{.5\textwidth}
 \begin{Verbatim}
@@ -1166,10 +1518,10 @@
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   z.A = point : new ( 0 , 0 ) 
+   z.A = point : new ( 0 , 0 )
    z.B = point : new ( 4 , 1 )
-   z.E = point : new ( 0 , 2 ) 
-   z.F = point : new ( 3 , 3 )  
+   z.E = point : new ( 0 , 2 )
+   z.F = point : new ( 3 , 3 )
    z.G = point : new ( 4 , 2 )
    L.AB = line : new ( z.A , z.B )
    T.EFG = triangle : new (z.E,z.F,z.G)
@@ -1188,10 +1540,10 @@
 \begin{minipage}{.5\textwidth}
 \directlua{%
 init_elements ()
-   z.A = point : new ( 0 , 0 ) 
+   z.A = point : new ( 0 , 0 )
    z.B = point : new ( 4 , 1 )
-   z.E = point : new ( 0 , 2 ) 
-   z.F = point : new ( 3 , 3 )  
+   z.E = point : new ( 0 , 2 )
+   z.F = point : new ( 3 , 3 )
    z.G = point : new ( 4 , 2 )
    L.AB = line : new ( z.A , z.B )
    T.EFG = triangle : new (z.E,z.F,z.G)
@@ -1256,8 +1608,6 @@
   \tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
   \end{tikzpicture}
 \end{center}
-
-
 \end{minipage}
 
 % \caption{Method distance with line object}
@@ -1271,10 +1621,10 @@
 \directlua{%
 init_elements ()
    z.A = point : new ( 0 , 0 )
-   z.B = point : new ( 6 , 0 )  
+   z.B = point : new ( 6 , 0 )
    L.AB =line: new (z.A,z.B)
    C.apo = L.AB : apollonius (2)
-   z.O,z.C = get_points (   C.apo   ) 
+   z.O,z.C = get_points (   C.apo   )
    z.D = C.apo : antipode (z.C)
    z.P = C.apo : point  (0.30)
 }
@@ -1299,10 +1649,10 @@
 \directlua{%
 init_elements ()
 z.A = point : new ( 0 , 0 )
-z.B = point : new ( 6 , 0 )  
+z.B = point : new ( 6 , 0 )
 L.AB =line: new (z.A,z.B)
 C.apo = L.AB : apollonius (2)
-z.O,z.C = get_points (	C.apo	) 
+z.O,z.C = get_points (  C.apo  )
 z.D = C.apo : antipode (z.C)
 z.P = C.apo : point  (0.30)
 }
@@ -1330,6 +1680,488 @@
 Remark: |\tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}| = \tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}
 % subsubsection apollonius_circle_ma_mb_k (end)
 
+\subsubsection{Method \Imeth{line}{c\_l\_pp}} % (fold)
+\label{ssub:c_l_pp}
+Circle tangent to a line passing through two points.
+
+First, consider the general case: a straight line $(AB)$ and two points, $M$ and $N$. We are tasked with finding the circle that is tangent to the line and passes through the two points. We will focus on the straight line $(AB)$ and apply a specific method designed for such cases.
+The method takes into account the following special cases:
+\begin{itemize}
+  \item line $(MN)$ is perpendicular to the line $(AB)$;
+  \item line $(MN)$ is parallel to line $(AB)$;
+  \item these points are on either side of the line $(AB)$;
+  \item one of the points lies on the line $(AB)$.
+\end{itemize}
+
+\vspace{6pt}
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+  \directlua{
+  init_elements ()
+  scale = .75
+  z.A    = point : new ( 0  , 0  )
+  z.B    = point : new ( 8  , 0  )
+  z.M    = point : new ( 1  , 1 )
+  z.N    = point : new ( 2  , 5 )
+  L.AB   = line:new(z.A,z.B)
+  C1,C2  = L.AB : c_l_pp (z.M,z.N)
+  z.O1   = C1.center
+  z.O2   = C2.center
+  z.T1   = C1.through
+  z.T2   = C2.through
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines(A,B M,N)
+  \tkzDrawCircles(O1,T1 O2,T2)
+  \tkzDrawPoints(A,B,M,N)
+  \tkzLabelPoints(A,B,M,N)
+  \tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+  \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.6\textwidth}
+\directlua{
+init_elements ()
+scale =.75
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 6  , 0  )
+z.M    = point : new ( 1  , 1 )
+z.N    = point : new ( 2  , 5 )
+L.AB   = line:new(z.A,z.B)
+C1,C2  = L.AB : c_l_pp(z.M,z.N)
+z.O1   = C1.center
+z.O2   = C2.center
+z.T1   = C1.through
+z.T2   = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+Let's look at the impossible case: the points are on either side of the line. The method returns \code{nil} and \code{nil}.
+
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+scale =.75
+z.A    = point :new (0, 0)
+z.B    = point :new (6, 0)
+z.M    = point :new (1, 1)
+z.N    = point :new (3 ,-5)
+L.AB   = line:new(z.A,z.B)
+L.MN   = line:new(z.M,z.N)
+z.I    = intersection(L.AB,L.MN)
+C1,C2  =  L.AB : c_l_pp(z.M,z.N)
+if C1 == nil
+ then
+   tex.print('\\message{Error: Argument is nil}')
+   tex.print('Error: Argument is nil')
+else
+   z.C    = C1.center
+   z.Cp   = C2.center
+   z.T    = C1.through
+   z.Tp   = C2.through
+end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.6\textwidth}
+\directlua{
+init_elements ()
+scale =.75
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 6  , 0  )
+z.M    = point : new ( 1 ,  1 )
+z.N    = point : new ( 3  , -5 )
+L.AB   = line:new(z.A,z.B)
+L.MN   = line:new(z.M,z.N)
+z.I    = intersection(L.AB,L.MN)
+C1,C2  =  L.AB : c_l_pp(z.M,z.N)
+if C1 == nil
+ then
+   tex.print('\\message{Error: Argument is nil}')
+   tex.print('Error: Argument is nil')
+else
+   z.C    = C1.center
+   z.Cp   = C2.center
+   z.T    = C1.through
+   z.Tp   = C2.through
+end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+Let's look at the case where the line $(MN)$ is parallel to the initial line.
+
+
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+  \directlua{
+  init_elements ()
+  z.A    = point : new ( 0  , 0  )
+  z.B    = point : new ( 8  , 0  )
+  z.M    = point : new ( 0  , 3 )
+  z.N    = point : new ( 5  , 3 )
+  L.AB   = line:new(z.A,z.B)
+  C1,C2  = L.AB : c_l_pp(z.M,z.N)
+  z.O1   = C1.center
+  z.O2   = C2.center
+  z.T1   = C1.through
+  z.T2   = C2.through
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines(A,B M,N)
+  \tkzDrawCircles(O1,T1)
+  \tkzDrawPoints(A,B,M,N)
+  \tkzDrawPoints(A,B,M,N)
+  \tkzLabelPoints(A,B,M,N)
+  \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.4\textwidth}
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.M    = point : new ( 0  , 3 )
+z.N    = point : new ( 5  , 3 )
+L.AB   = line:new(z.A,z.B)
+C1,C2  = L.AB : c_l_pp(z.M,z.N)
+z.O1   = C1.center
+z.O2   = C2.center
+z.T1   = C1.through
+z.T2   = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1)
+\tkzDrawPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\end{tikzpicture}
+\end{minipage}
+
+
+\vspace{6pt}
+Where the line is perpendicular to the initial line.
+
+\vspace{6pt}
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+scale = .75
+z.A   = point : new(0, 0 )
+z.B   = point : new(6, 0 )
+z.M   = point : new(1, 1 )
+z.N   = point : new(1, 5 )
+L.AB  = line:new(z.A,z.B)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1  = C1.center
+z.O2  = C2.center
+z.T1  = C1.through
+z.T2  = C2.through
+}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.6\textwidth}
+\directlua{
+init_elements ()
+scale = .75
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 6  , 0  )
+z.M    = point : new ( 1  , 1 )
+z.N    = point : new ( 1  , 5 )
+L.AB   = line:new(z.A,z.B)
+C1,C2  = L.AB : c_l_pp(z.M,z.N)
+z.O1   = C1.center
+z.O2   = C2.center
+z.T1   = C1.through
+z.T2   = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{minipage}
+
+The last special case is when one of the points is on the initial line. In this case, there's only one solution.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 5  , 0  )
+z.M    = point : new ( 1 ,  0 )
+z.N    = point : new ( 3  , 5 )
+L.AB   = line:new(z.A,z.B)
+L.MN   = line:new(z.M,z.N)
+z.I    = intersection(L.AB,L.MN)
+C1,C2  =  L.AB : c_l_pp(z.M,z.N)
+z.O1   = C1.center
+z.O2   = C2.center
+z.T1   = C1.through
+z.T2   = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 5  , 0  )
+z.M    = point : new ( 1 ,  0 )
+z.N    = point : new ( 3  , 5 )
+L.AB   = line:new(z.A,z.B)
+L.MN   = line:new(z.M,z.N)
+z.I    = intersection(L.AB,L.MN)
+C1,C2  =  L.AB : c_l_pp(z.M,z.N)
+z.O1   = C1.center
+z.O2   = C2.center
+z.T1   = C1.through
+z.T2   = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection c_l_pp (end)
+
+\subsubsection{Method \Imeth{line}{c\_ll\_p}} % (fold)
+\label{ssub:method_c__ll__p}
+
+
+
+Let's consider two straight lines $(AB)$ and $(AC)$ and a point $P$ not belonging to these lines.
+Is there a circle through $P$ tangent to these two lines?
+
+The following example shows that there are two solutions using the method linked to the line. A more natural method, linked to the $ABC$ triangle, can also be used.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+  \directlua{
+  init_elements()
+  scale =.75
+    z.A   = point : new ( 0  , 0  )
+    z.B   = point : new ( 6  , 0  )
+    L.AB  = line : new ( z.A,z.B )
+    z.C   = point : new ( 6 ,  4  )
+    L.AC  = line : new ( z.A,z.C )
+    T     = triangle : new (z.A,z.B,z.C)
+    z.P = point : new ( 3 ,  1  )
+    C1,C2 = L.AB : c_ll_p (z.C,z.P)
+    z.O1  = C1.center
+    z.T1  = C1.through
+    z.O2  = C2.center
+    z.T2  = C2.through
+  }
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines[thick](A,B A,C)
+   \tkzDrawCircles[red](O1,T1 O2,T2)
+   \tkzDrawPoints(A,B,C,P)
+   \tkzLabelPoints(A,B,C,P)
+  \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+ scale = .75
+  z.A   = point : new ( 0  , 0  )
+  z.B   = point : new ( 6  , 0  )
+  L.AB  = line : new ( z.A,z.B )
+  z.C   = point : new ( 6 ,  4  )
+  L.AC  = line : new ( z.A,z.C )
+  T     = triangle : new (z.A,z.B,z.C)
+  z.P = point : new ( 3 ,  1  )
+  C1,C2 = L.AB : c_ll_p (z.C,z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+\begin{center}
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines[thick](A,B A,C)
+   \tkzDrawCircles[red](O1,T1 O2,T2)
+   \tkzDrawPoints(A,B,C,P)
+   \tkzLabelPoints(A,B,C,P)
+  \end{tikzpicture}
+\end{center}
+\end{minipage}
+
+\vspace{6pt}
+
+The first special case is where the point $P$ lies on the bisector of $A$.
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale =.75
+  z.A   = point : new (0 , 0)
+  z.B   = point : new (6 , 0)
+  L.AB  = line : new ( z.A,z.B)
+  z.C   = point : new ( 6 , 4)
+  L.AC  = line : new ( z.A,z.C )
+  T     = triangle : new (z.A,z.B,z.C)
+  L.bi  = bisector(z.A,z.B,z.C)
+  z.P   = L.bi :point (0.4)
+  C1,C2 = L.AB : c_ll_p (z.C,z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B A,C A,P)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+  z.A   = point : new (0 , 0)
+  z.B   = point : new (6 , 0)
+  L.AB  = line : new ( z.A,z.B)
+  z.C   = point : new ( 6 , 4)
+  L.AC  = line : new ( z.A,z.C )
+  T     = triangle : new (z.A,z.B,z.C)
+  L.bi  = bisector(z.A,z.B,z.C)
+  z.P   = L.bi :point (0.4)
+  C1,C2 = L.AB : c_ll_p (z.C,z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+\begin{center}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B A,C A,P)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+\end{center}
+\end{minipage}
+
+
+\vspace{6pt}
+A first special case is when the point $P$ lies on one of the lines
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale =.75
+  z.A   = point:new(0, 0)
+  z.B   = point:new(6, 0)
+  L.AB  = line:new(z.A,z.B)
+  z.C   = point:new(6, 4)
+  L.AC  = line:new(z.A,z.C)
+  T     = triangle:new(z.A,z.B,z.C)
+  z.P   = point:new(3, 2)
+  L.bi  = bisector(z.A,z.B,z.C)
+  z.I   = L.bi:point(0.4)
+  C1,C2 = L.AB : c_ll_p (z.C,z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B A,C A,I)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P,I)
+ \tkzLabelPoints(A,B,C,P,I)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+  z.A   = point : new ( 0  , 0  )
+  z.B   = point : new ( 6  , 0  )
+  L.AB  = line : new ( z.A,z.B )
+  z.C   = point : new ( 6 ,  4  )
+  L.AC  = line : new ( z.A,z.C )
+  T     = triangle : new (z.A,z.B,z.C)
+  z.P   = point : new ( 3 ,  2  )
+  L.bi  = bisector(z.A,z.B,z.C)
+  z.I   =   L.bi.pb
+  C1,C2 = L.AB : c_ll_p (z.C,z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+\begin{center}
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawLines(A,B A,C A,I)
+   \tkzDrawCircles(O1,T1 O2,T2)
+   \tkzDrawPoints(A,B,C,P,I)
+   \tkzLabelPoints(A,B,C,P,I)
+  \end{tikzpicture}
+\end{center}
+\end{minipage}
+
+%subsubsection method_c__ll__p (end)
+
 % subsection methods_from_class_line (end)
 
 % section class_line (end)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-misc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-misc.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-misc.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -21,9 +21,9 @@
 \Igfct{math}{islinear (z1,z2,z3) }   & Are the points aligned? (z2-z1) $\parallel$ (z3-z1) ?  \\
 \Igfct{math}{isortho (z1,z2,z3)} &  (z2-z1) $\perp$ (z3-z1)  ? boolean\\
 \Igfct{math}{get\_angle (z1,z2,z3)} & the vertex is z1 [\ref{sub:get_angle}] \\
-\Igfct{math}{bisector (z1,z2,z3)} & L.Aa = bisector (z.A,z.B,z.C) from A [\ref{sub:get_angle}] \\
-\Igfct{math}{bisector\_ext (z1,z2,z3)} & L.Aa = bisector_ext (z.A,z.B,z.C) from A \\
-\Igfct{math}{altitude (z1,z2,z3)} & altitude from z1 \\
+\Igfct{misc}{bisector (z1,z2,z3)} & L.Aa = bisector (z.A,z.B,z.C) from A [\ref{sub:get_angle}] \\
+\Igfct{misc}{bisector\_ext (z1,z2,z3)} & L.Aa = bisector_ext (z.A,z.B,z.C) from A \\
+\Igfct{misc}{altitude (z1,z2,z3)} & altitude from z1 \\
 \Igfct{package}{set\_lua\_to\_tex (list)}   & set\_lua\_to\_tex('a','n') defines |\a| and |\n|   \\
 %parabola (a,b,c)   & to get   \\
 \Igfct{math}{value (v) }     &  apply |scale * value |    \\
@@ -31,6 +31,8 @@
 \Igfct{math}{angle\_normalize (an) }   &  to get a value between 0 and $2\pi$ \\
 \Igfct{misc}{barycenter (\{z1,n1\},\{z2,n2\}, ...)} & barycenter of list of points  \\
 \Igfct{math}{solve\_quadratic (a,b,c) }   & gives the solution of $ax^2+bx+c =0$  a,b,c real or complex  [\ref{ssub:function_solve__quadratic}] \\
+\Igfct{misc}{midpoint (z1,z2)} & midpoint of the segment [\ref{ssub:euler_ellipse}] \\
+\Igfct{misc}{midpoints (z1,z2,...,zn)} & midpoints of z1z2, z2z3 etc. z1zn [\ref{sub:varignon_s_theorem}]\\
 \bottomrule
 \end{tabular}
 \egroup
@@ -38,10 +40,34 @@
 \subsection{Length of a segment} % (fold)
 \label{sub:length_of_a_segment}
 |length(z.A,z.B)| is a shortcut for |point.abs(z.A-z.B)|. This avoids the need to use complexes.
+It's also a shortcut for L.AB = line:new(z.A,z.B) and l = L.AB.length. Depending on the context, you'll need to choose the most appropriate method.
 
 % subsection length_of_a_segment (end)
 
+\subsection{Midpoint and midpoints} % (fold)
+\label{sub:midpoint_and_midpoints}
+As with length, a shortcut is available, e.g. |z.M = midpoint(z.A,z.B)|. If a straight line is required, then use: |z.M = L.AB.mid|.
 
+The aim here is to determine the midpoints of a polygon. For example, considering a triangle $abc$, we can obtain the middles of the sides, after defining the triangle |T.abc = triangle:new(z.a,z.b,z.c)|, the middles are the vertices of the medial triangle |z.ma,z.mb,z.mc = T.abc : medial()|.
+
+\code{midpoints} is a shortcut for defining midpoints without using triangles:
+
+ |z.mc,z.ma,z.mb = midpoints(z.a,z.b,z.c)|. 
+ 
+ The medial triangle can be omitted with |z.mc,z.ma,z.mb = midpoints(get_points(T.abc))|.
+% subsection midpoint_and_midpoints (end)
+
+\subsection{Bisector} % (fold)
+\label{sub:bisector}
+As shown in the previous table, |bisector (z1,z2,z3)| defines the bisector of vertex |z1|.
+% subsection bisector (end)
+
+\subsection{Barycenter} % (fold)
+\label{sub:misc_barycenter}
+
+Explanations are given here: \ref{sub:barycenter}
+% subsection barycenter (end)
+
 \subsection{Harmonic division with tkzphi } % (fold)
 \label{sub:harmonic_division_with_tkzphi}
 \begin{Verbatim}
@@ -80,7 +106,7 @@
  \hspace*{\fill}
 % subsection harmonic_division_with_tkzphi (end)
 
-\subsection{Function islinear} % (fold)
+\subsection{Function islinear or is\_linear} % (fold)
 \label{sub:function_islinear}
 \begin{minipage}{0.5\textwidth}
 \begin{Verbatim}
@@ -210,14 +236,9 @@
    tex.print('slope normalized of (ac) : '..tostring(angle\_normalize(angle))..'\\\\')
    angle    = point.arg (z.d-z.a)
    tex.print('slope of (ad) : '..tostring(angle)..'\\\\')
-   tex.print('slope normalized of (acd) : '..tostring(angle\_normalize(angle))..'\\\\')
+   tex.print('slope normalized of (ad) : '..tostring(angle\_normalize(angle))..'\\\\')
 }
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawLines[red](a,b a,c a,d)
-   \tkzDrawPoints(a,b,c,d)
-   \tkzLabelPoints(a,b,c,d)
-\end{tikzpicture}
+
 \end{Verbatim}
 \directlua{%
 init_elements ()
@@ -237,15 +258,31 @@
 tex.print('slope normalized of (ad) : '..tostring(angle_normalize(angle))..'\\\\')
 }
 
-  \hspace*{\fill}
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawLines[red](a,b a,c a,d)
-   \tkzDrawPoints(a,b,c,d)
-   \tkzLabelPoints(a,b,c,d)
-\end{tikzpicture}
- \hspace*{\fill}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+  \begin{tikzpicture}
+     \tkzGetNodes
+     \tkzDrawLines[red](a,b a,c a,d)
+     \tkzDrawPoints(a,b,c,d)
+     \tkzLabelPoints(a,b,c,d)
+  \end{tikzpicture}
+\end{Verbatim}
 
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \begin{center}
+    \begin{tikzpicture}
+       \tkzGetNodes
+       \tkzDrawLines[red](a,b a,c a,d)
+       \tkzDrawPoints(a,b,c,d)
+       \tkzLabelPoints(a,b,c,d)
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
+
+
+
+
 % subsection normalized_angles (end)
 
 \subsection{Get angle} % (fold)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-parallelogram.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-parallelogram.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-parallelogram.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -105,7 +105,7 @@
 \end{tabular}
 \egroup
 
-\subsubsection{parallelogram with fourth method} % (fold)
+\subsubsection{Parallelogram with fourth method} % (fold)
 \label{ssub:parallelogram_with_fourth_method}
 
 % subsubsection parallelogram_with_fourth_method (end)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-point.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-point.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-point.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -3,7 +3,7 @@
 \section{Class \Iclass{point}} % (fold)
 \label{sec:class_point}
 
-The foundation of the entire framework is the \Iclass{point} class. This class is hybrid in the sense that it deals with both points in a plane and complex numbers. The principle is as follows: the plane is equipped with an orthonormal basis, which allows us to determine the position of a point using its abscissa and ordinate coordinate. Similarly, any complex number can be viewed simply as a pair of real numbers (its real part and its imaginary part).  We can then designate the plane as the complex plane, and the complex number $x+iy$ is represented by the point of the plane with coordinates $(x,y)$. Thus the point $A$ will have coordinates stored in the object $z.A$. Coordinates are attributes of the "point" object,  along with type, argument, and modulus.
+The foundation of the entire framework is the \Iclass{point} class. This class is hybrid in the sense that it deals with both points in a plane and complex numbers. The principle is as follows: the plane is equipped with an orthonormal basis, which allows us to determine the position of a point using its abscissa and ordinate coordinate. Similarly, any complex number can be viewed simply as a pair of real numbers (its real part and its imaginary part).  We can then designate the plane as the complex plane, and the complex number $x+iy$ is represented by the point of the plane with coordinates $(x,y)$. Thus the point $A$ will have coordinates stored in the object $z.A$. Coordinates are attributes of the \code{point} object,  along with type, argument, and modulus.
 
 
 
@@ -19,7 +19,7 @@
        
        \tikz\node[minimum width=\size,font=\small,
     draw, fill=cyan!10,
-    rectangle split, rectangle split parts=5
+    rectangle split, rectangle split parts=6
   ] {
     \texttt{re (real)}
     \nodepart{two}\texttt{im (real)}
@@ -26,6 +26,7 @@
     \nodepart{three}\texttt{type = 'point'}
     \nodepart{four}\texttt{argument (rad)}
      \nodepart{five}\texttt{modulus (cm)}
+       \nodepart{six}\texttt{mtx (matrix)}
   };
   
     \hspace{\fill}  \texttt{Methods}\hspace{\fill}
@@ -51,7 +52,7 @@
        
         \tikz\node[minimum width=\size,font=\small,
     draw, fill=cyan!10,
-    rectangle split, rectangle split parts=5
+    rectangle split, rectangle split parts=6
   ] {
     \texttt{re = 1}
     \nodepart{two}\texttt{im = 2}
@@ -58,6 +59,7 @@
     \nodepart{three}\texttt{type = 'point'}
     \nodepart{four}\texttt{argument = atan(2)}
      \nodepart{five}\texttt{modulus = $\sqrt{5}$}
+      \nodepart{six}\texttt{mtx = \{\{1\},\{2\}\}}
   };
   
     \hspace{\fill}  \texttt{Methods}\hspace{\fill}
@@ -106,6 +108,7 @@
   \Iattr{point}{type}     &  |z.A.type = 'point'|  & \\  
   \Iattr{point}{argument} &  |z.A.argument| $\approx$ |0.78539816339745| &  [\ref{ssub:example_point_attributes}] \\
   \Iattr{point}{modulus}  & |z.A.modulus| $\approx$ |2.2360...| =$\sqrt{5}$ &  [\ref{ssub:example_point_attributes}] \\
+  \Iattr{point}{mtx}  & |z.A.mtx =  = {{1},{2}}|  &  [\ref{ssub:example_point_attributes}] \\
   \bottomrule
   \end{tabular}
   \egroup
@@ -181,9 +184,9 @@
      \item \texttt{z.M.type} = 'point'
      \item \texttt{z.M.argument} = $\theta \approx \pmpn{\tkzUseLua{z.M.argument}}$ rad
      \item \texttt{z.M.modulus} = $|z_M| =\sqrt{5}\approx \pmpn{\tkzUseLua{z.M.modulus}}$ cm
+     \item \texttt{z.M.mtx} =  \tkzUseLua{z.M.mtx : print ()}
      \end{itemize}
    \end{mybox}
-
        };
    \end{scope}
    \end{tikzpicture}
@@ -191,10 +194,33 @@
 
  \MakeShortVerb{\|}
 
-%  \caption{Class Point}
+\subsubsection{Attribute \Iattr{point}{mtx}} % (fold)
+\label{ssub:attribute_iattr_point_mtx}
+
+This method allows the point to be used in conjunction with matrices.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+  \directlua{
+  z.A = point : new (2,-1)
+  z.A.mtx : print () 
+  }
+\end{Verbatim}
+\end{minipage}
+  \begin{minipage}{.5\textwidth}
+    \begin{center}
+      \directlua{
+      z.A = point : new (2,-1)
+      z.A.mtx : print () 
+      }
+    \end{center}
+  \end{minipage}
+% subsubsection attribute_iattr_point_mtx (end)
 % subsubsection example_point_attributes (end)
 % subsection attributes_of_a_point (end)
 
+
 \subsubsection{Argand diagram} % (fold)
 \label{ssub:argand_diagram}
 \normalsize
@@ -445,7 +471,7 @@
 \subsubsection{Method \Imeth{point}{orthogonal (d)}} % (fold)
 \label{ssub:orthogonal_method}
 
-Let $O$ be the origin of the plane. The "orthogonal (d)" method is used to obtain a point $B$ from a point $A$ such that $\overrightarrow{OB}\perp \overrightarrow{OA}$ with $OB=OA$ if $d$ is empty, otherwise $OB = d$.
+Let $O$ be the origin of the plane. The \code{orthogonal (d)} method is used to obtain a point $B$ from a point $A$ such that $\overrightarrow{OB}\perp \overrightarrow{OA}$ with $OB=OA$ if $d$ is empty, otherwise $OB = d$.
 
 \begin{minipage}{.6\textwidth}
 \begin{Verbatim}
@@ -588,22 +614,24 @@
 \directlua{%
 init_elements ()
   scale = .75
-   z.O   = point : new ( -1 , -1 )
-   z.A   = point : new ( 2 , 0 )
-   z.B   = point : new ( 5 , 0 )
-   L.AB  = line : new (z.A,z.B)
-   T.ABC = L.AB : equilateral ()
-   S.fig = L.AB : square ()
-   _,_,z.E,z.F = get_points (   S.fig   )
-   S.new = z.O : rotation (math.pi/3,S.fig)
-   _,_,z.Ep,z.Fp = get_points (   S.new   )
+   z.O   = point: new(-1, -1)
+   z.A   = point: new(2, 0)
+   z.B   = point: new(5, 0)
+   L.AB  = line: new(z.Az.B)
+   T.ABC = L.AB: equilateral()
+   S.fig = L.AB: square ()
+   _,_,
+   z.E,z.F = get_points(S.fig)
+   S.new = z.O : rotation(math.pi/3,S.fig)
+   _,_,z.Ep,z.Fp = get_points( S.new )
    z.C = T.ABC.pc
-   T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
+   T.ApBpCp = z.O : rotation(math.pi/3,T.ABC)
    z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
 }
 \begin{tikzpicture}
    \tkzGetNodes
-   \tkzDrawPolygons(A,B,C A',B',C' A,B,E,F A',B',E',F')
+   \tkzDrawPolygons(A,B,C A',B',C'%
+          A,B,E,F A',B',E',F')
    \tkzDrawPoints (A,B,C,A',B',C',O)
    \tkzLabelPoints (A,B,C,A',B',C',O)
    \tkzDrawArc[delta=0,->](O,A)(A')

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-quadrilateral.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-quadrilateral.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-quadrilateral.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -161,4 +161,5 @@
 \end{minipage}
 % subsubsection inscribed_quadrilateral (end)
 
+
 % subsection quadrilateral_methods (end)
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-regular.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-regular.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-regular.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,7 +1,7 @@
 \newpage
 \section{Class \Iclass{regular polygon}} % (fold)
 
-\subsection{regular\_polygon attributes} % (fold)
+\subsection{Regular\_polygon attributes} % (fold)
 \label{sub:regular_polygon_attributes}
 
 \begin{mybox}
@@ -21,7 +21,7 @@
 \Iattr{regular}{circle}  & defines the circle with center I passing through A \\
 \Iattr{regular}{type}    & |RP.IA.type= 'regular\_polygon'|   \\
 \Iattr{regular}{side}    & |s = RP.IA.side| ; s = length of side\\
-\Iattr{regular}{exradius}&  |S.AB.exradius| ; radius of the circumscribed circle \\
+\Iattr{regular}{circumradius}&  |S.AB.circumradius| ; radius of the circumscribed circle \\
 \Iattr{regular}{inradius}&  |S.AB.inxradius| ; radius of the inscribed circle   \\
 \Iattr{regular}{proj}    &  |RP.IA.proj| ; projection of the center on one side   \\
 \Iattr{regular}{angle}   &  |RP.IA.angle| ; angle formed by the center and 2 consecutive vertices   \\
@@ -80,7 +80,7 @@
 % subsubsection pentagon (end)
 % subsection regular_polygon_attributes (end)
 
-\subsection{regular\_polygon methods} % (fold)
+\subsection{Regular\_polygon methods} % (fold)
 \label{sub:regular_polygon_methods}
 
 \bgroup

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-square.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-square.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-square.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -24,7 +24,7 @@
 \Iattr{square}{type}       & |S.AB.type= 'square'| &  \\
 \Iattr{square}{side}       & |s = S.AB.center|     & s = length of side   \\
 \Iattr{square}{center}     & |z.I = S.AB.center|   & center of the square \\
-\Iattr{square}{exradius}   & |S.AB.exradius|       & radius of the circumscribed circle \\
+\Iattr{square}{circumradius}   & |S.AB.circumradius|       & radius of the circumscribed circle \\
 \Iattr{square}{inradius}   & |S.AB.inxradius|      & radius of the inscribed circle   \\
 \Iattr{square}{proj}       & |S.AB.proj|           & projection of the center on one side \\
 \Iattr{square}{ab}         & |S.AB.ab|             &  line passing through two vertices   \\
@@ -59,7 +59,7 @@
 \tkzLabelPoints(A,B,H,I)
 \tkzLabelPoints[above](C,D)
 \tkzDrawSegments(I,B I,H)
-\tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.exradius}}}
+\tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.circumradius}}}
 \tkzLabelSegment[sloped](I,H){\pmpn{\tkzUseLua{S.new.inradius}}}
 \tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
 \end{tikzpicture}
@@ -85,7 +85,7 @@
    \tkzLabelPoints(A,B,H,I)
    \tkzLabelPoints[above](C,D)
    \tkzDrawSegments(I,B I,H)
-   \tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.exradius}}}
+   \tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.circumradius}}}
    \tkzLabelSegment[sloped](I,H){\pmpn{\tkzUseLua{S.new.inradius}}}
    \tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
    \end{tikzpicture}
@@ -162,6 +162,7 @@
 \end{tikzpicture}
 \end{minipage}
 % subsubsection square_with_side_method (end)
+
 % subsubsection example_square_attributes (end)
 
 % subsection square_methods (end)
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-triangle.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-triangle.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-classes-triangle.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -37,6 +37,10 @@
 \Iattr{triangle}{ab}& Line defined by the first two points of the triangle\\
 \Iattr{triangle}{bc}& Line defined by the last two points \\
 \Iattr{triangle}{ca}&  Line defined by the last and the first points of the triangle\\
+\Iattr{triangle}{semiperimeter}& semiperimeter of the triangle \\
+\Iattr{triangle}{area}& area of the triangle \\
+\Iattr{triangle}{inradius}& radius of the incircle\\
+\Iattr{triangle}{circumradius}& radius of the circumcircle \\
 \bottomrule %
 \end{tabular}
 \egroup
@@ -170,6 +174,17 @@
 \midrule
 \Imeth{triangle}{new} (a, b ,c) & |T.ABC = triangle : new (z.A,z.B,z.C)|& [\ref{sub:triangle_attributes_angles}] \footnote{|T| or |T.name| with what you want for name, is possible.}  \\
 \midrule 
+\textbf{Booleans}&&\\
+\midrule
+\Imeth{triangle}{in\_out (pt)}  & Boolean. Test if |pt| is inside the triangle\\
+\Imeth{triangle}{check\_equilateral ()} & Boolean. Test if the triangle is equilateral\\
+\Imeth{triangle}{check\_acutangle ()} & Boolean. Test if the triangle is acutangle\\
+\midrule
+ \textbf{Reals} &&\\
+ \midrule 
+ \Imeth{triangle}{area ()}   & $ \mathcal{A}$| = T.ABC: area ()| better T.ABC.area\\
+ \Imeth{triangle}{barycentric\_coordinates(pt)} & Triples of numbers corresponding to masses placed at the vertices\\
+ \midrule
  \textbf{Points} &&\\
 \midrule 
 \Imeth{triangle}{lemoine\_point ()} &  |T.ABC : lemoine_point ()| intersection of the symmedians & [\ref{ssub:method_imeth_line_isosceles}]\\
@@ -203,6 +218,7 @@
 \Imeth{triangle}{nine\_points () }   & 9 Points of the euler circle & [\ref{ssub:method_imeth_triangle_nine__points}] \\
 
 \Imeth{triangle}{parallelogram ()} & |z.D = T.ABC : parallelogram ()| \tkzar ABCD parallelogram& [\ref{sub:director_circle}]\\
+
 \midrule
  \textbf{Lines} &&\\
 \midrule 
@@ -220,6 +236,7 @@
 
 \Imeth{triangle}{antiparallel(pt,n)} & n=0 antiparallel through pt to $(BC)$, n=1 to $(AC)$ etc.& [\ref{sub:antiparallel_through_lemoine_point}]\\
 \midrule 
+
  \textbf{Circles} &&\\
 \midrule 
 \Imeth{triangle}{euler\_circle ()} & C.|NP = T.ABC : euler_circle ()| \tkzar $N$ euler point 
@@ -248,6 +265,8 @@
 \Imeth{triangle}{pedal\_circle ()} & Circumscribed circle of the podar triangle & [\ref{ssub:method_imeth_triangle_pedal}]\\
 
 \Imeth{triangle}{conway\_circle ()} & Circumscribed circle of Conway points  & [\ref{ssub:method_imeth_triangle_conway}]\\
+
+\Imeth{triangle}{c\_ll\_p (pt)}  & circle tgt to two side through pt [\ref{ssub:tr_method_c__ll__p}]\\
 \bottomrule
 \end{tabular}
 \end{minipage}
@@ -304,13 +323,6 @@
 \Imeth{triangle}{steiner\_circumellipse ()}   & [ex. \ref{ssub:steiner_inellipse_and_circumellipse}] \\ 
 
 \Imeth{triangle}{euler\_ellipse ()}   &  [ex. (\ref{ssub:euler_ellipse}]\\ 
- \midrule 
- \textbf{Miscellaneous} &\\
-\midrule 
-\Imeth{triangle}{area ()}   & $ \mathcal{A}$| = T.ABC: area ()|\\
-\Imeth{triangle}{barycentric\_coordinates(pt)}& Triples of numbers corresponding to masses placed at the vertices\\
-\Imeth{triangle}{in\_out (pt)}  & Boolean. Test if |pt| is inside the triangle\\
-\Imeth{triangle}{check\_equilateral ()} & Boolean. Test if the triangle is equilateral\\
 \bottomrule
 \end{tabular}
 \end{center}
@@ -2484,8 +2496,67 @@
 \end{Verbatim}
 % subsubsection harmonic_division_and_bisector (end)
 
+\subsubsection{Method \Imeth{triangle}{c\_ll\_p}} % (fold)
+\label{ssub:tr_method_c__ll__p}
 
-%
+See [\ref{ssub:method_c__ll__p}] for special cases. Please note that the arguments are not the same as for the \code{line} class.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+  \begin{Verbatim}
+\directlua{
+init_elements()
+  z.A   = point : new ( 0  , 0  )
+  z.B   = point : new ( 8  , 0  )
+  L.AB  = line : new ( z.A,z.B )
+  z.C   = point : new ( 6 ,  4  )
+  L.AC  = line : new ( z.A,z.C )
+  T     = triangle : new (z.A,z.B,z.C)
+  z.P   = point : new ( 3 ,  1  )
+  C1,C2 = T : c_ll_p (z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+ \tkzDrawLines[thick](A,B A,C B,C)
+ \tkzDrawCircles[red](O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+init_elements()
+  z.A   = point : new ( 0  , 0  )
+  z.B   = point : new ( 8  , 0  )
+  L.AB  = line : new ( z.A,z.B )
+  z.C   = point : new ( 6 ,  4  )
+  L.AC  = line : new ( z.A,z.C )
+  T     = triangle : new (z.A,z.B,z.C)
+  z.P   = point : new ( 3 ,  1  )
+  C1,C2 = T : c_ll_p (z.P)
+  z.O1  = C1.center
+  z.T1  = C1.through
+  z.O2  = C2.center
+  z.T2  = C2.through
+}
+  \begin{center}
+\begin{tikzpicture}
+\tkzGetNodes
+ \tkzDrawLines[thick](A,B A,C B,C)
+ \tkzDrawCircles[red](O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+  \end{center}
+
+\end{minipage}
+
+% subsubsection method_c__ll__p (end)
 % % subsection methods_of_the_class_triangle (end)
 % % section class_triangle (end)
 \endinput

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-convention.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-convention.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-convention.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -39,7 +39,7 @@
 As for the conventions for designating |name| you must adhere to Lua conventions in particular cases.
 \begin{enumerate}
 
-   \item  The use of prime can be problematic. If the point name contains more than one symbol and ends with |p|  then when passing into \pkg{TikZ} or \pkg{tkz-euclide}, the letters |p|  will be replaced by |'| using the macro \tkzcname{tkzGetNodes}; \index{prime}
+   \item  The use of prime can be problematic. If the point name contains more than one symbol and ends with |p|  then when passing into \pkg{tkz-euclide}, the letters |p|  will be replaced by |'| using the macro \tkzcname{tkzGetNodes}; \index{prime}
 
    \item  Alternatively, for a more explicit code, suppose you want to designate a point as  "euler". You could, for example,  write |euler = ...|, and at the end of the code for the transfer, |z.E = euler|. It is also possible to use a temporary name |euler| and to replace it in \TIKZ{}. Either at the time of placing the labels, or for example by using |pgfnodealias{E}{euler}|. This possibility also applies in other cases: prime, double prime, etc.
 \end{enumerate}

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-examples.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-examples.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-examples.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1320,6 +1320,7 @@
 \subsection{Gold division} % (fold)
 \label{sub:gold_division}
 
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
@@ -1339,50 +1340,54 @@
 z.C         = intersection  (L.EG,L.AB)
 z.O         = C.AB: antipode (z.B)
 }
-   \begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawArc[delta=5](O,B)(G)
-   \tkzDrawCircles(A,B B,A)
-   \tkzDrawSegments(A,E B,E O,I)
-   \tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
-   \tkzMarkSegments[mark=s||](A,E B,E O,A)
-   \tkzDrawPoints(A,B,C,E,I,J,G,O,K)
-   \tkzLabelPoints(A,B,C,E,I,J,G,O,K)
-   \end{tikzpicture}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawArc[delta=5](O,B)(G)
+\tkzDrawCircles(A,B B,A)
+\tkzDrawSegments(A,E B,E O,I)
+\tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
+\tkzMarkSegments[mark=s||](A,E B,E O,A)
+\tkzDrawPoints(A,B,C,E,I,J,G,O,K)
+\tkzLabelPoints(A,B,C,E,I,J,G,O,K)
+\end{tikzpicture}
 \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{%
+  init_elements ()
+  scale = .75
+  z.A     = point:  new (0,0)
+  z.B     = point:  new (2.5,0)
+  L.AB    = line:   new (z.A,z.B)
+  C.AB    = circle: new (z.A,z.B)
+  C.BA    = circle: new (z.B,z.A)
+  z.J     = L.AB: midpoint ()
+  L.JB    = line:new (z.J,z.B)
+  z.F,z.E = intersection (C.AB , C.BA)
+  z.I,_   = intersection (L.AB , C.BA)
+  z.K     = L.JB : midpoint ()
+  L.mediator  = L.JB: mediator ()
+  z.G   = intersection (L.mediator,C.BA)
+  L.EG    = line:new (z.E,z.G)
+  z.C     = intersection  (L.EG,L.AB)
+  z.O     = C.AB: antipode (z.B)
+  }
 
-\directlua{%
-init_elements ()
-z.A     = point:  new (0,0)
-z.B     = point:  new (2.5,0)
-L.AB    = line:   new (z.A,z.B)
-C.AB    = circle: new (z.A,z.B)
-C.BA    = circle: new (z.B,z.A)
-z.J     = L.AB: midpoint ()
-L.JB    = line:new (z.J,z.B)
-z.F,z.E = intersection (C.AB , C.BA)
-z.I,_   = intersection (L.AB , C.BA)
-z.K     = L.JB : midpoint ()
-L.mediator  = L.JB: mediator ()
-z.G   = intersection (L.mediator,C.BA)
-L.EG    = line:new (z.E,z.G)
-z.C     = intersection  (L.EG,L.AB)
-z.O     = C.AB: antipode (z.B)
-}
 
+  \begin{center}
+    \begin{tikzpicture}
+       \tkzGetNodes
+       \tkzDrawArc[delta=5](O,B)(G)
+       \tkzDrawCircles(A,B B,A)
+       \tkzDrawSegments(A,E B,E O,I)
+       \tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
+       \tkzMarkSegments[mark=s||](A,E B,E O,A)
+       \tkzDrawPoints(A,B,C,E,I,J,G,O,K)
+       \tkzLabelPoints(A,B,C,E,I,J,G,O,K)
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
 
-\begin{center}
-  \begin{tikzpicture}
-     \tkzGetNodes
-     \tkzDrawArc[delta=5](O,B)(G)
-     \tkzDrawCircles(A,B B,A)
-     \tkzDrawSegments(A,E B,E O,I)
-     \tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
-     \tkzMarkSegments[mark=s||](A,E B,E O,A)
-     \tkzDrawPoints(A,B,C,E,I,J,G,O,K)
-     \tkzLabelPoints(A,B,C,E,I,J,G,O,K)
-  \end{tikzpicture}
-\end{center}
 
 
 % subsection gold_division (end)
@@ -1562,7 +1567,7 @@
 
 \subsection{Euler relation} % (fold)
 \label{sub:euler_relation}
-\begin{minipage}{.5\textwidth}
+
 \begin{Verbatim}
 \directlua{%
 init_elements ()
@@ -1593,8 +1598,7 @@
    \tkzMarkRightAngles[fill=gray!20,opacity=.4](C,H,I A,K,J)
    \end{tikzpicture}
 \end{Verbatim}
-\end{minipage}
-\begin{minipage}{.5\textwidth}
+
 \directlua{%
 init_elements ()
 z.A   = point: new (0 , 0)
@@ -1626,8 +1630,6 @@
   \end{tikzpicture}
 \end{center}
 
-
-\end{minipage}
 % subsection euler_relation (end)
 
 \subsection{External angle} % (fold)
@@ -1636,7 +1638,7 @@
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-  scale  = .75
+  scale  = .5
   z.A    = point: new (0 , 0)
   z.B    = point: new (5 , 0)
   z.C    = point: new (-2 , 4)
@@ -1689,8 +1691,6 @@
   \tkzLabelPoints(A,B,D)
   \end{tikzpicture}
 \end{center}
-
-
 \end{minipage}
 % subsection external_angle (end)
 
@@ -1762,35 +1762,36 @@
 
 \subsection{Feuerbach theorem} % (fold)
 \label{sub:nine_points}
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+
+
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   scale     =  1.5
-   z.A       = point: new (0 , 0)
-   z.B       = point: new (5 , -.5)
-   z.C       = point: new (-.5 , 3)
-   T.ABC     = triangle: new (z.A,z.B,z.C)
-   z.O       = T.ABC.circumcenter
-   z.N       = T.ABC.eulercenter
-   z.I,z.K   = get_points(T.ABC: in_circle())
-   z.H       = T.ABC.ab : projection (z.I)
-   z.Ap,
-   z.Bp,
-   z.Cp      = get_points (T.ABC : medial ())
-   C.IH      = circle:new (z.I,z.H)
-   C.NAp     = circle:new (z.N,z.Ap)
-   C.OA      = circle:new (z.O,z.A)
-   z.U       = C.OA.south
-   z.L       = C.NAp.south
-   z.M       = C.NAp.north
-   z.X       = T.ABC.ab: projection (z.C)
-   L.CU      = line: new (z.C,z.U)
-   L.ML      = line: new (z.M,z.L)
-   z.P       = L.CU: projection (z.A)
-   z.Q       = L.CU: projection (z.B)
-   L.LH      = line: new (z.L,z.H)
-   z.F       = intersection (L.LH,C.IH) % feuerbach
+scale = .75
+ z.A     = point: new (0 , 0)
+ z.B     = point: new (5 , -.5)
+ z.C     = point: new (-.5 , 3)
+ T.ABC   = triangle: new (z.A,z.B,z.C)
+ z.O     = T.ABC.circumcenter
+ z.N     = T.ABC.eulercenter
+ z.I,z.K = get_points(T.ABC: in_circle())
+ z.H     = T.ABC.ab : projection (z.I)
+ z.Ap,
+ z.Bp,
+ z.Cp  = get_points (T.ABC : medial ())
+ C.IH  = circle:new (z.I,z.H)
+ C.NAp = circle:new (z.N,z.Ap)
+ C.OA  = circle:new (z.O,z.A)
+ z.U   = C.OA.south
+ z.L   = C.NAp.south
+ z.M   = C.NAp.north
+ z.X   = T.ABC.ab: projection (z.C)
+ L.CU  = line: new (z.C,z.U)
+ L.ML  = line: new (z.M,z.L)
+ z.P   = L.CU: projection (z.A)
+ z.Q   = L.CU: projection (z.B)
+ L.LH  = line: new (z.L,z.H)
+ z.F   = intersection (L.LH,C.IH) % feuerbach
 }
 
 \begin{tikzpicture}
@@ -1805,11 +1806,10 @@
    \tkzLabelPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I)
 \end{tikzpicture}
 \end{Verbatim}
-\end{minipage}
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+
 \directlua{%
 init_elements ()
-scale  =  1
+scale =1.25
 z.A    = point: new (0 , 0)
 z.B    = point: new (5 , -.5)
 z.C    = point: new (-.5 , 3)
@@ -1848,7 +1848,7 @@
   \end{tikzpicture}
 \end{center}
    
-\end{minipage}
+
 % subsection nine_points (end)
 
 \subsection{Gold ratio with segment} % (fold)
@@ -2529,11 +2529,11 @@
    z.Jc,z.Xc   = get_points (C.exC)
    L.OL        = line: new (z.O,z.L)
    L.NS        = line: new (z.N,z.S)
-   z.o         = intersection (L.OL,L.NS) -- center of Apollonius circle
+   z.o         = intersection (L.OL,L.NS) % center of Apollonius circle
    L.NMa       = line: new (z.N,z.Ma)
    L.ox        = L.NMa: ll_from (z.o)
    L.MaS       = line: new (z.Ma,z.S)
-   z.t         = intersection (L.ox,L.MaS) -- through
+   z.t         = intersection (L.ox,L.MaS) % through
 }
 
 \begin{tikzpicture}
@@ -2571,11 +2571,11 @@
 z.Jc,z.Xc  = get_points (C.exC)
 L.OL   = line: new (z.O,z.L)
 L.NS   = line: new (z.N,z.S)
-z.o    = intersection (L.OL,L.NS) -- center of Apollonius circle
+z.o    = intersection (L.OL,L.NS) % center of Apollonius circle
 L.NMa  = line: new (z.N,z.Ma)
 L.ox   = L.NMa: ll_from (z.o)
 L.MaS  = line: new (z.Ma,z.S)
-z.t    = intersection (L.ox,L.MaS) -- through
+z.t    = intersection (L.ox,L.MaS) % through
 }
 
 \begin{center}
@@ -2582,7 +2582,7 @@
   \begin{tikzpicture}
   \tkzGetNodes
   \tkzDrawLines[add=1 and 1](A,B A,C B,C)
-  \tkzDrawCircles(Ja,Xa Jb,Xb Jc,Xc o,t N,Ma) %
+  \tkzDrawCircles(Ja,Xa Jb,Xb Jc,Xc o,t N,Ma) 
   \tkzClipCircle(o,t)
   \tkzDrawLines[red](o,L N,o Ma,t)
   \tkzDrawLines[cyan,add=4 and 4](Ma,N o,t)
@@ -2598,103 +2598,109 @@
 \subsection{Orthogonal circles} % (fold)
 \label{sub:orthogonal_circles_v2}
 
-\begin{Verbatim}
-\directlua{%
-init_elements ()
-scale    = .75
-z.O      = point: new (2,2)
-z.Op     = point: new (-4,1)
-z.P      = point: polar (4,0)
-C.OP     = circle: new (z.O,z.P)
-C.Oz1    =  C.OP : orthogonal_from (z.Op)
-z.z1     = C.Oz1.through
-L.OP     = line : new (z.O,z.P)
-C.Opz1   = circle: new (z.Op,z.z1)
-L.T,L.Tp = C.Opz1 : tangent_from (z.O)
-z.T      = L.T.pb
-z.Tp     = L.Tp.pb
-L.OOp    = line : new (z.O,z.Op)
-z.M      = L.OOp.mid
-}
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircle[red](O,P)
-   \tkzDrawCircle[purple](O',z1)
-   \tkzDrawCircle[cyan](M,T)
-   \tkzDrawSegments(O',T O,T' O',T')
-   \tkzDrawSegment[purple](O',T)
-   \tkzDrawSegments[red](O,T O,O')
-   \tkzDrawPoints(O,O',T,T',M)
-   \tkzMarkRightAngle[fill=gray!10](O',T,O)
-   \tkzLabelPoint[below](O){$O$}
-   \tkzLabelPoint[above](T){$T$}
-   \tkzLabelPoint[above](M){$M$}
-   \tkzLabelPoint[below](T'){$T'$}
-   \tkzLabelPoint[above left](O'){$O'$}
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale = .75
-z.O      = point: new (2,2)
-z.Op     = point: new (-4,1)
-z.P      = point: polar (4,0)
-C.OP     = circle: new (z.O,z.P)
-C.Oz1    =  C.OP : orthogonal_from (z.Op)
-z.z1     = C.Oz1.through
-L.OP     = line : new (z.O,z.P)
-C.Opz1   = circle: new (z.Op,z.z1)
-L.T,L.Tp = C.Opz1 : tangent_from (z.O)
-z.T      = L.T.pb
-z.Tp     = L.Tp.pb
-L.OOp    = line : new (z.O,z.Op)
-z.M      = L.OOp.mid
-}
-
-\begin{center}
+\begin{minipage}{.5\textwidth}
+  \begin{Verbatim}
+  \directlua{%
+  init_elements ()
+  scale    = .5
+  z.O      = point: new (2,2)
+  z.Op     = point: new (-4,1)
+  z.P      = point: polar (4,0)
+  C.OP     = circle: new (z.O,z.P)
+  C.Oz1    =  C.OP : orthogonal_from (z.Op)
+  z.z1     = C.Oz1.through
+  L.OP     = line : new (z.O,z.P)
+  C.Opz1   = circle: new (z.Op,z.z1)
+  L.T,L.Tp = C.Opz1 : tangent_from (z.O)
+  z.T      = L.T.pb
+  z.Tp     = L.Tp.pb
+  L.OOp    = line : new (z.O,z.Op)
+  z.M      = L.OOp.mid
+  }
   \begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawCircle[red](O,P)
-  \tkzDrawCircle[purple](O',z1)
-  \tkzDrawCircle[cyan](M,T)
-  \tkzDrawSegments(O',T O,T' O',T')
-  \tkzDrawSegment[purple](O',T)
-  \tkzDrawSegments[red](O,T O,O')
-  \tkzDrawPoints(O,O',T,T',M)
-  \tkzMarkRightAngle[fill=gray!10](O',T,O)
-  \tkzLabelPoint[below](O){$O$}
-  \tkzLabelPoint[above](T){$T$}
-  \tkzLabelPoint[above](M){$M$}
-  \tkzLabelPoint[below](T'){$T'$}
-  \tkzLabelPoint[above left](O'){$O'$}
+     \tkzGetNodes
+     \tkzDrawCircle[red](O,P)
+     \tkzDrawCircle[purple](O',z1)
+     \tkzDrawCircle[cyan](M,T)
+     \tkzDrawSegments(O',T O,T' O',T')
+     \tkzDrawSegment[purple](O',T)
+     \tkzDrawSegments[red](O,T O,O')
+     \tkzDrawPoints(O,O',T,T',M)
+     \tkzMarkRightAngle[fill=gray!10](O',T,O)
+     \tkzLabelPoint[below](O){$O$}
+     \tkzLabelPoint[above](T){$T$}
+     \tkzLabelPoint[above](M){$M$}
+     \tkzLabelPoint[below](T'){$T'$}
+     \tkzLabelPoint[above left](O'){$O'$}
   \end{tikzpicture}
-\end{center}
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{%
+  init_elements ()
+  scale = .5
+  z.O      = point: new (2,2)
+  z.Op     = point: new (-4,1)
+  z.P      = point: polar (4,0)
+  C.OP     = circle: new (z.O,z.P)
+  C.Oz1    =  C.OP : orthogonal_from (z.Op)
+  z.z1     = C.Oz1.through
+  L.OP     = line : new (z.O,z.P)
+  C.Opz1   = circle: new (z.Op,z.z1)
+  L.T,L.Tp = C.Opz1 : tangent_from (z.O)
+  z.T      = L.T.pb
+  z.Tp     = L.Tp.pb
+  L.OOp    = line : new (z.O,z.Op)
+  z.M      = L.OOp.mid
+  }
 
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawCircle[red](O,P)
+    \tkzDrawCircle[purple](O',z1)
+    \tkzDrawCircle[cyan](M,T)
+    \tkzDrawSegments(O',T O,T' O',T')
+    \tkzDrawSegment[purple](O',T)
+    \tkzDrawSegments[red](O,T O,O')
+    \tkzDrawPoints(O,O',T,T',M)
+    \tkzMarkRightAngle[fill=gray!10](O',T,O)
+    \tkzLabelPoint[below](O){$O$}
+    \tkzLabelPoint[above](T){$T$}
+    \tkzLabelPoint[above](M){$M$}
+    \tkzLabelPoint[below](T'){$T'$}
+    \tkzLabelPoint[above left](O'){$O'$}
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
 
+
+
 % subsection orthogonal_circles_v2 (end)
 %
 \subsection{Orthogonal circle to two circles} % (fold)
 \label{sub:orthogonal_circle_to_two_circles}
 
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   z.O         = point :   new (-1,0)
-   z.B         = point :   new (0,2)
-   z.Op        = point :   new (4,-1)
-   z.D         = point :   new (4,0)
-   C.OB        = circle :  new (z.O,z.B)
-   C.OpD       = circle :  new (z.Op,z.D)
-   z.E,z.F     = get_points (C.OB : radical_axis (C.OpD))
-   L.EF        = line : new (z.E,z.F)
-   z.M         = L.EF : point (.25)
-   L.T,L.Tp    = C.OB : tangent_from (z.M)
-   L.K,L.Kp    = C.OpD : tangent_from (z.M)
-   z.T         = L.T.pb
-   z.K         = L.K.pb
-   z.Tp        = L.Tp.pb
-   z.Kp        = L.Kp.pb
+scale =.75
+ z.O      = point :   new (-1,0)
+ z.B      = point :   new (0,2)
+ z.Op     = point :   new (4,-1)
+ z.D      = point :   new (4,0)
+ C.OB     = circle :  new (z.O,z.B)
+ C.OpD    = circle :  new (z.Op,z.D)
+ z.E,z.F  = get_points (C.OB : radical_axis (C.OpD))
+ L.EF     = line : new (z.E,z.F)
+ z.M      = L.EF : point (.25)
+ L.T,L.Tp = C.OB : tangent_from (z.M)
+ L.K,L.Kp = C.OpD : tangent_from (z.M)
+ z.T      = L.T.pb
+ z.K      = L.K.pb
+ z.Tp     = L.Tp.pb
+ z.Kp     = L.Kp.pb
 }
 \begin{tikzpicture}
    \tkzGetNodes
@@ -2706,11 +2712,12 @@
    \tkzDrawPoints(O,O',T,M,T',K,K')
    \tkzLabelPoints(O,O',T,T',M,K,K')
 \end{tikzpicture}
-\end{Verbatim}
-
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
 \directlua{%
 init_elements ()
-   scale = 1.25
+   scale = .75
 z.O   = point :   new (-1,0)
 z.B   = point :   new (0,2)
 z.Op  = point :   new (4,-1)
@@ -2727,8 +2734,6 @@
 z.Tp = L.Tp.pb
 z.Kp = L.Kp.pb
 }
-
-
 \begin{center}
   \begin{tikzpicture}
   \tkzGetNodes
@@ -2741,8 +2746,8 @@
   \tkzLabelPoints(O,O',T,T',M,K,K')
   \end{tikzpicture}
 \end{center}
+\end{minipage}
 
-
 % subsection Orthogonal to two circles (fold)
 
 \subsection{Midcircles} % (fold)
@@ -2934,16 +2939,6 @@
    z.xp,z.yp   = get_points (C.C0A : orthogonal_from (z.M_1))
    z.O         = L.BA.mid
 }
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(C_0,A C_1,A C_3,A C_5,A)
-   \tkzDrawCircles[thick,color=red](M_0,x M_1,x')
-   \tkzDrawCircles[thick,color=blue](O,A)
-   \tkzDrawLines(C_0,C_1 B,M_1)
-   \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,x,y)
-   \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,x,y)
-   \tkzLabelLine[pos=1.25,right]( M_0,M_1){$(\Delta)$}
-\end{tikzpicture}
 \end{Verbatim}
 
 \directlua{%
@@ -2977,6 +2972,18 @@
   \end{tikzpicture}
 \end{center}
 
+\begin{Verbatim}
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawCircles(C_0,A C_1,A C_3,A C_5,A)
+  \tkzDrawCircles[thick,color=red](M_0,x M_1,x')
+  \tkzDrawCircles[thick,color=blue](O,A)
+  \tkzDrawLines(C_0,C_1 B,M_1)
+  \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,x,y)
+  \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,x,y)
+  \tkzLabelLine[pos=1.25,right]( M_0,M_1){$(\Delta)$}
+  \end{tikzpicture}
+\end{Verbatim}
 
 % subsection pencil_v1 (end)
 
@@ -3003,15 +3010,6 @@
    z.v         = C.orth1.through
    z.t         = C.orth2.through
 }
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(C_0,A C_1,B)
-   \tkzDrawCircles[thick,color=red](M_0,u M_1,v M_2,t)
-   \tkzDrawLines[add= .75 and .75](C_0,C_1 M_0,M_1)
-   \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,M_2)
-   \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,M_2)
-   \tkzLabelLine[pos=2,right]( M_0,M_1){$(\Delta)$}
-\end{tikzpicture}
 \end{Verbatim}
 
 \directlua{%
@@ -3047,235 +3045,258 @@
   \end{tikzpicture}
 \end{center}
 
+\begin{Verbatim}
+\begin{tikzpicture}
+   \tkzGetNodes
+   \tkzDrawCircles(C_0,A C_1,B)
+   \tkzDrawCircles[thick,color=red](M_0,u M_1,v M_2,t)
+   \tkzDrawLines[add= .75 and .75](C_0,C_1 M_0,M_1)
+   \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,M_2)
+   \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,M_2)
+   \tkzLabelLine[pos=2,right]( M_0,M_1){$(\Delta)$}
+\end{tikzpicture}
+\end{Verbatim}
+
 %subsection pencil_v2 (end)
 
 
 \subsection{Reim v1} % (fold)
 \label{sub:reim_v1}
+
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   z.A     = point: new (0,0)
-   z.E     = point: new (-2,2)
-   C.AE    = circle :   new (z.A,z.E)
-   z.C     = C.AE : point (0.65)
-   z.D     = C.AE : point (0.5)
-   z.F     = C.AE : point (0.30)
-   L.EC    = line: new (z.E,z.C)
-   z.H     = L.EC : point (1.5)
-   T.CDH   = triangle : new (z.C,z.D,z.H)
-   z.B     = T.CDH.circumcenter
-   C.BD    = circle : new (z.B,z.D)
-   L.FD    = line: new (z.F,z.D)
-   z.G     = intersection (L.FD,C.BD)
-   z.O     = intersection (L.EC,L.FD)
+ z.A   = point: new (0,0)
+ z.E   = point: new (-2,2)
+ C.AE  = circle : new (z.A,z.E)
+ z.C   = C.AE : point (0.65)
+ z.D   = C.AE : point (0.5)
+ z.F   = C.AE : point (0.30)
+ L.EC  = line: new (z.E,z.C)
+ z.H   = L.EC : point (1.5)
+ T.CDH = triangle : new (z.C,z.D,z.H)
+ z.B   = T.CDH.circumcenter
+ C.BD  = circle : new (z.B,z.D)
+ L.FD  = line: new (z.F,z.D)
+ z.G   = intersection (L.FD,C.BD)
+ z.O   = intersection (L.EC,L.FD)
 }
 \begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(A,E B,H)
-   \tkzDrawSegments(E,D C,F)
-   \tkzDrawLines(E,O F,O)
-   \tkzDrawLines[red](E,F H,G)
-   \tkzDrawPoints(A,...,H,O)
-   \tkzLabelPoints(A,B,D,F,G,O)
-   \tkzLabelPoints[above](E,C,H)
-   \tkzMarkAngles[size=.5](E,C,F E,D,F)
-   \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
-   \tkzMarkAngles[size=.5](F,C,H G,D,E)
-   \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
+ \tkzGetNodes
+ \tkzDrawCircles(A,E B,H)
+ \tkzDrawSegments(E,D C,F)
+ \tkzDrawLines(E,O F,O)
+ \tkzDrawLines[red](E,F H,G)
+ \tkzDrawPoints(A,...,H,O)
+ \tkzLabelPoints(A,B,D,F,G,O)
+ \tkzLabelPoints[above](E,C,H)
+ \tkzMarkAngles[size=.5](E,C,F E,D,F)
+ \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
+ \tkzMarkAngles[size=.5](F,C,H G,D,E)
+ \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
 \end{tikzpicture}
 \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{%
+  init_elements ()
+  scale = .5
+     z.A     = point: new (0,0)
+     z.E     = point: new (-2,2)
+     C.AE    = circle :   new (z.A,z.E)
+     z.C     = C.AE : point (0.65)
+     z.D     = C.AE : point (0.5)
+     z.F     = C.AE : point (0.30)
+     L.EC    = line: new (z.E,z.C)
+     z.H     = L.EC : point (1.5)
+     T.CDH   = triangle : new (z.C,z.D,z.H)
+     z.B     = T.CDH.circumcenter
+     C.BD    = circle : new (z.B,z.D)
+     L.FD    = line: new (z.F,z.D)
+     z.G     = intersection (L.FD,C.BD)
+     z.O     = intersection (L.EC,L.FD)
+  }
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawCircles(A,E B,H)
+    \tkzDrawSegments(E,D C,F)
+    \tkzDrawLines(E,O F,O)
+    \tkzDrawLines[red](E,F H,G)
+    \tkzDrawPoints(A,...,H,O)
+    \tkzLabelPoints(A,B,D,F,G,O)
+    \tkzLabelPoints[above](E,C,H)
+    \tkzMarkAngles[size=.5](E,C,F E,D,F)
+    \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
+    \tkzMarkAngles[size=.5](F,C,H G,D,E)
+    \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
 
-\directlua{%
-init_elements ()
-   z.A     = point: new (0,0)
-   z.E     = point: new (-2,2)
-   C.AE    = circle :   new (z.A,z.E)
-   z.C     = C.AE : point (0.65)
-   z.D     = C.AE : point (0.5)
-   z.F     = C.AE : point (0.30)
-   L.EC    = line: new (z.E,z.C)
-   z.H     = L.EC : point (1.5)
-   T.CDH   = triangle : new (z.C,z.D,z.H)
-   z.B     = T.CDH.circumcenter
-   C.BD    = circle : new (z.B,z.D)
-   L.FD    = line: new (z.F,z.D)
-   z.G     = intersection (L.FD,C.BD)
-   z.O     = intersection (L.EC,L.FD)
-}
 
 
-\begin{center}
-  \begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawCircles(A,E B,H)
-  \tkzDrawSegments(E,D C,F)
-  \tkzDrawLines(E,O F,O)
-  \tkzDrawLines[red](E,F H,G)
-  \tkzDrawPoints(A,...,H,O)
-  \tkzLabelPoints(A,B,D,F,G,O)
-  \tkzLabelPoints[above](E,C,H)
-  \tkzMarkAngles[size=.5](E,C,F E,D,F)
-  \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
-  \tkzMarkAngles[size=.5](F,C,H G,D,E)
-  \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
-  \end{tikzpicture}
-\end{center}
-
-
 % subsection reim_v1 (end)
 
 \subsection{Reim v2} % (fold)
 \label{sub:reim_v2}
+
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   scale    = .6
-   z.A      = point: new (0,0)
-   z.B      = point: new (10,0)
-   z.C      = point: new (4,0)
-   C.AC     = circle: new (z.A,z.C)
-   z.c,z.cp = get_points (C.AC: tangent_at (z.C))
-   z.M      = C.AC: point (0.6)
-   L.MC     = line: new (z.M,z.C)
-   C.BC     = circle: new (z.B,z.C)
-   z.N      = intersection (L.MC,C.BC)
-   z.m,z.mp = get_points (C.AC: tangent_at (z.M))
-   z.n,z.np = get_points (C.BC: tangent_at (z.N))
+ scale    = .4
+ z.A      = point: new (0,0)
+ z.B      = point: new (10,0)
+ z.C      = point: new (4,0)
+ C.AC     = circle: new (z.A,z.C)
+ z.c,z.cp = get_points (C.AC: tangent_at (z.C))
+ z.M      = C.AC: point (0.6)
+ L.MC     = line: new (z.M,z.C)
+ C.BC     = circle: new (z.B,z.C)
+ z.N      = intersection (L.MC,C.BC)
+ z.m,z.mp = get_points (C.AC: tangent_at (z.M))
+ z.n,z.np = get_points (C.BC: tangent_at (z.N))
 }
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircles(A,C B,C)
-   \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
-   \tkzDrawSegment(M,N)
-   \tkzDrawPoints(A,B,C,M,N)
-   \tkzLabelPoints[below right](A,B,C,M,N)
-   \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
-   \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
-   \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
-\end{tikzpicture}
-\end{Verbatim}
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{%
+  init_elements ()
+  scale = .25
+  z.A     = point: new (0,0)
+  z.B     = point: new (10,0)
+  z.C     = point: new (4,0)
+  C.AC    = circle: new (z.A,z.C)
+  z.c,z.cp    = get_points (C.AC: tangent_at (z.C))
+  z.M      = C.AC: point (0.6)
+  L.MC    = line: new (z.M,z.C)
+  C.BC    = circle: new (z.B,z.C)
+  z.N     = intersection (L.MC,C.BC)
+  z.m,z.mp    = get_points (C.AC: tangent_at (z.M))
+  z.n,z.np    = get_points (C.BC: tangent_at (z.N))
+  }
 
-\directlua{%
-init_elements ()
-scale = .4
-z.A     = point: new (0,0)
-z.B     = point: new (10,0)
-z.C     = point: new (4,0)
-C.AC    = circle: new (z.A,z.C)
-z.c,z.cp    = get_points (C.AC: tangent_at (z.C))
-z.M      = C.AC: point (0.6)
-L.MC    = line: new (z.M,z.C)
-C.BC    = circle: new (z.B,z.C)
-z.N     = intersection (L.MC,C.BC)
-z.m,z.mp    = get_points (C.AC: tangent_at (z.M))
-z.n,z.np    = get_points (C.BC: tangent_at (z.N))
-}
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawCircles(A,C B,C)
+    \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
+    \tkzDrawSegment(M,N)
+    \tkzDrawPoints(A,B,C,M,N)
+    \tkzLabelPoints[below right](A,B,C,M,N)
+    \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
+    \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
+    \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
 
 
-\begin{center}
+\begin{Verbatim}
   \begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawCircles(A,C B,C)
-  \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
-  \tkzDrawSegment(M,N)
-  \tkzDrawPoints(A,B,C,M,N)
-  \tkzLabelPoints[below right](A,B,C,M,N)
-  \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
-  \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
-  \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
+     \tkzGetNodes
+     \tkzDrawCircles(A,C B,C)
+     \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
+     \tkzDrawSegment(M,N)
+     \tkzDrawPoints(A,B,C,M,N)
+     \tkzLabelPoints[below right](A,B,C,M,N)
+     \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
+     \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
+     \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
   \end{tikzpicture}
-\end{center}
+\end{Verbatim}
 
-
 % subsection reim_v2 (end)
 
 \subsection{Reim v3} % (fold)
 \label{sub:reim_v3}
-\begin{Verbatim}
-\directlua{%
-init_elements ()
-   z.A     = point: new (0,0)
-   z.B     = point: new (8,0)
-   z.C     = point: new (2,6)
-   L.AB    = line : new (z.A,z.B)
-   L.AC    = line : new (z.A,z.C)
-   L.BC    = line : new (z.B,z.C)
-   z.I     = L.BC : point (0.75)
-   z.J     = L.AC : point (0.4)
-   z.K     = L.AB : point (0.5)
-   T.AKJ   = triangle : new (z.A,z.K,z.J)
-   T.BIK   = triangle : new (z.B,z.I,z.K)
-   T.CIJ   = triangle : new (z.C,z.I,z.J)
-   z.x     = T.AKJ.circumcenter
-   z.y     = T.BIK.circumcenter
-   z.z     = T.CIJ.circumcenter
-   C.xK    = circle: new (z.x,z.K)
-   C.yK    = circle: new (z.y,z.K)
-   z.O,_   = intersection (C.xK,C.yK)
-   C.zO    = circle: new (z.z,z.O)
-   L.KO    = line: new (z.K,z.O)
-   z.D     = intersection (L.KO,C.zO)
-}
 
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawSegments(K,D D,C)
-   \tkzDrawPolygon[teal](A,B,C)
-   \tkzDrawCircles[orange](x,A y,B z,C)
-   \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
-   \tkzLabelPoints[below](A,B,J,K,O)
-   \tkzLabelPoints[above](C,D,I)
-   \tkzDrawPoints[fill=black](O)
-   \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
-   \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
-   \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-   scale = .75
-   z.A     = point: new (0,0)
-   z.B     = point: new (8,0)
-   z.C     = point: new (2,6)
-   L.AB    = line : new (z.A,z.B)
-   L.AC    = line : new (z.A,z.C)
-   L.BC    = line : new (z.B,z.C)
-   z.I     = L.BC : point (0.75)
-   z.J     = L.AC : point (0.4)
-   z.K     = L.AB : point (0.5)
-   T.AKJ   = triangle : new (z.A,z.K,z.J)
-   T.BIK   = triangle : new (z.B,z.I,z.K)
-   T.CIJ   = triangle : new (z.C,z.I,z.J)
-   z.x     = T.AKJ.circumcenter
-   z.y     = T.BIK.circumcenter
-   z.z     = T.CIJ.circumcenter
-   C.xK    = circle: new (z.x,z.K)
-   C.yK    = circle: new (z.y,z.K)
-   z.O,_   = intersection (C.xK,C.yK)
-   C.zO    = circle: new (z.z,z.O)
-   L.KO    = line: new (z.K,z.O)
-   z.D     = intersection (L.KO,C.zO)
-}
-
-\begin{center}
+\begin{minipage}{.5\textwidth}
+  \begin{Verbatim}
+  \directlua{%
+  init_elements ()
+     z.A     = point: new (0,0)
+     z.B     = point: new (8,0)
+     z.C     = point: new (2,6)
+     L.AB    = line : new (z.A,z.B)
+     L.AC    = line : new (z.A,z.C)
+     L.BC    = line : new (z.B,z.C)
+     z.I     = L.BC : point (0.75)
+     z.J     = L.AC : point (0.4)
+     z.K     = L.AB : point (0.5)
+     T.AKJ   = triangle : new (z.A,z.K,z.J)
+     T.BIK   = triangle : new (z.B,z.I,z.K)
+     T.CIJ   = triangle : new (z.C,z.I,z.J)
+     z.x     = T.AKJ.circumcenter
+     z.y     = T.BIK.circumcenter
+     z.z     = T.CIJ.circumcenter
+     C.xK    = circle: new (z.x,z.K)
+     C.yK    = circle: new (z.y,z.K)
+     z.O,_   = intersection (C.xK,C.yK)
+     C.zO    = circle: new (z.z,z.O)
+     L.KO    = line: new (z.K,z.O)
+     z.D     = intersection (L.KO,C.zO)
+  }
   \begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawSegments(K,D D,C)
-  \tkzDrawPolygon[teal](A,B,C)
-  \tkzDrawCircles[orange](x,A y,B z,C)
-  \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
-  \tkzLabelPoints[below](A,B,J,K,O)
-  \tkzLabelPoints[above](C,D,I)
-  \tkzDrawPoints[fill=black](O)
-  \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
-  \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
-  \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
+     \tkzGetNodes
+     \tkzDrawSegments(K,D D,C)
+     \tkzDrawPolygon[teal](A,B,C)
+     \tkzDrawCircles[orange](x,A y,B z,C)
+     \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
+     \tkzLabelPoints[below](A,B,J,K,O)
+     \tkzLabelPoints[above](C,D,I)
+     \tkzDrawPoints[fill=black](O)
+     \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
+     \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
+     \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
   \end{tikzpicture}
-\end{center}
+  \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+  \directlua{%
+  init_elements ()
+     scale = .75
+     z.A     = point: new (0,0)
+     z.B     = point: new (8,0)
+     z.C     = point: new (2,6)
+     L.AB    = line : new (z.A,z.B)
+     L.AC    = line : new (z.A,z.C)
+     L.BC    = line : new (z.B,z.C)
+     z.I     = L.BC : point (0.75)
+     z.J     = L.AC : point (0.4)
+     z.K     = L.AB : point (0.5)
+     T.AKJ   = triangle : new (z.A,z.K,z.J)
+     T.BIK   = triangle : new (z.B,z.I,z.K)
+     T.CIJ   = triangle : new (z.C,z.I,z.J)
+     z.x     = T.AKJ.circumcenter
+     z.y     = T.BIK.circumcenter
+     z.z     = T.CIJ.circumcenter
+     C.xK    = circle: new (z.x,z.K)
+     C.yK    = circle: new (z.y,z.K)
+     z.O,_   = intersection (C.xK,C.yK)
+     C.zO    = circle: new (z.z,z.O)
+     L.KO    = line: new (z.K,z.O)
+     z.D     = intersection (L.KO,C.zO)
+  }
+  \begin{center}
+    \begin{tikzpicture}
+    \tkzGetNodes
+    \tkzDrawSegments(K,D D,C)
+    \tkzDrawPolygon[teal](A,B,C)
+    \tkzDrawCircles[orange](x,A y,B z,C)
+    \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
+    \tkzLabelPoints[below](A,B,J,K,O)
+    \tkzLabelPoints[above](C,D,I)
+    \tkzDrawPoints[fill=black](O)
+    \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
+    \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
+    \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
+    \end{tikzpicture}
+  \end{center}
+\end{minipage}
 
-
 % subsection reim_v3 (end)
 
 \subsection{Tangent and circle} % (fold)
@@ -3385,19 +3406,19 @@
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   scale       = .8
-   z.A         = point: new (0 , 0)
-   z.B         = point: new (6 , 0)
-   z.C         = point: new (1 , 5)
-   z.Bp        = point: new (2 , 0)
-   T.ABC       = triangle: new (z.A,z.B,z.C)
-   L.AB        = line: new (z.A,z.B)
-   z.O         = T.ABC.circumcenter
-   C.OA        = circle: new (z.O,z.A)
-   z.D         = C.OA: point (4.5)
-   L.AO        = line: new (z.A,z.O)
-   z.b1,z.b2   = get_points (C.OA: tangent_at (z.B))
-   z.H         = L.AB: projection (z.O)
+ scale     = .75
+ z.A       = point: new (0 , 0)
+ z.B       = point: new (6 , 0)
+ z.C       = point: new (1 , 5)
+ z.Bp      = point: new (2 , 0)
+ T.ABC     = triangle: new (z.A,z.B,z.C)
+ L.AB      = line: new (z.A,z.B)
+ z.O       = T.ABC.circumcenter
+ C.OA      = circle: new (z.O,z.A)
+ z.D       = C.OA: point (4.5)
+ L.AO      = line: new (z.A,z.O)
+ z.b1,z.b2 = get_points(C.OA: tangent_at(z.B))
+ z.H       = L.AB: projection (z.O)
 }
 \begin{tikzpicture}
    \tkzGetNodes
@@ -3415,7 +3436,7 @@
 \begin{minipage}{.5\textwidth}
 \directlua{%
 init_elements ()
-scale = 0.75
+scale   = 0.75
 z.A     = point: new (0 , 0)
 z.B     = point: new (6 , 0)
 z.C     = point: new (1 , 5)
@@ -3426,11 +3447,9 @@
 C.OA    = circle: new (z.O,z.A)
 z.D     = C.OA: point (4.5)
 L.AO    = line: new (z.A,z.O)
-z.b1,z.b2   = get_points (C.OA: tangent_at (z.B))
+z.b1,z.b2  = get_points (C.OA: tangent_at (z.B))
 z.H     = L.AB: projection (z.O)
 }
-
-
 \begin{center}
   \begin{tikzpicture}
   \tkzGetNodes
@@ -3437,7 +3456,7 @@
   \tkzDrawCircle(O,A)
   \tkzDrawPolygon(A,B,C)
   \tkzDrawSegments[new](A,O B,O O,H A,D D,B)
-  \tkzDrawLine(b1,b2)
+  \tkzDrawSegment(b1,b2)
   \tkzDrawPoints(A,B,C,D,H,O)
   \tkzFillAngles[green!20,opacity=.3](H,O,B A,C,B  A,B,b1)
   \tkzFillAngles[teal!20,opacity=.3](A,D,B b2,B,A)
@@ -3452,7 +3471,6 @@
 \subsection{Three chords} % (fold)
 \label{sub:three_chords}
 
-\begin{Verbatim}
 \directlua{%
 init_elements ()
 z.O  = point: new (0 , 0)
@@ -3483,9 +3501,9 @@
 z.Ep,_   = intersection (L.GE,C.xF)
 z.Cp,_   = intersection (L.GD,C.xD)
 }
-\end{Verbatim}
 
-
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
 \directlua{%
 init_elements ()
 z.O  = point: new (0 , 0)
@@ -3516,30 +3534,9 @@
 z.Ep,_   = intersection (L.GE,C.xF)
 z.Cp,_   = intersection (L.GD,C.xD)
 }
-
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
-\begin{Verbatim}
-\begin{tikzpicture}
-  \tkzGetNodes
-  \tkzDrawCircles(O,B)
-  \tkzDrawCircles[cyan](P,B)
-  \tkzDrawCircles[red](w,E)
-  \tkzDrawCircles[new](x,F)
-  \tkzDrawSegments(A,G E,G C,G)
-  \tkzDrawPolygons[new](A,E,C A',E',C')
-  \tkzDrawPoints(A,...,G,A',E',C',O,P)
-  \begin{scope}[font=\scriptsize]
-  \tkzLabelPoints(A,...,F)
-  \tkzLabelPoints[above left](G,A',E',C')
-  \tkzLabelCircle[left](O,B)(30){$(\beta)$}
-  \tkzLabelCircle[below](P,A)(40){$(\gamma)$}
-  \tkzLabelCircle[right](w,C)(90){$(\alpha)$}
-  \tkzLabelCircle[left](x,B)(-230){$((\delta))$}
-  \end{scope}
-\end{tikzpicture}
 \end{Verbatim}
 \end{minipage}
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{minipage}{.5\textwidth}
 \begin{center}
   \begin{tikzpicture}[scale=.75]
   \tkzGetNodes
@@ -3561,6 +3558,29 @@
   \end{tikzpicture}
 \end{center}
 \end{minipage}
+
+\begin{Verbatim}
+\begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawCircles(O,B)
+  \tkzDrawCircles[cyan](P,B)
+  \tkzDrawCircles[red](w,E)
+  \tkzDrawCircles[new](x,F)
+  \tkzDrawSegments(A,G E,G C,G)
+  \tkzDrawPolygons[new](A,E,C A',E',C')
+  \tkzDrawPoints(A,...,G,A',E',C',O,P)
+  \begin{scope}[font=\scriptsize]
+  \tkzLabelPoints(A,...,F)
+  \tkzLabelPoints[above left](G,A',E',C')
+  \tkzLabelCircle[left](O,B)(30){$(\beta)$}
+  \tkzLabelCircle[below](P,A)(40){$(\gamma)$}
+  \tkzLabelCircle[right](w,C)(90){$(\alpha)$}
+  \tkzLabelCircle[left](x,B)(-230){$((\delta))$}
+  \end{scope}
+\end{tikzpicture}
+\end{Verbatim}
+
+
 % subsection three_chords (end)
 
 \subsection{Three tangents} % (fold)
@@ -3768,7 +3788,8 @@
 
 [\href{https://mathworld.wolfram.com/FirstLemoineCircle.html}{Weisstein, Eric W. "First Lemoine Circle." From MathWorld--A Wolfram Web Resource.}]
 
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\vspace{6pt}
+\begin{minipage}[t]{.35\textwidth}\vspace{0pt}%
 \directlua{%
 init_elements ()
    z.A      = point:  new (1,1)
@@ -3795,23 +3816,21 @@
 \end{tikzpicture}
 \end{center}
 \end{minipage}
-
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{minipage}[t]{.65\textwidth}\vspace{0pt}%
 \begin{Verbatim}
 \directlua{%
 init_elements ()
-   z.A      = point:  new (1,1)
-   z.B      = point:  new (5,1)
-   z.C      = point:  new (2.2,4)
-   T        = triangle: new (z.A,z.B,z.C) 
-   z.O = T.circumcenter
-   C.first_lemoine = T:first_lemoine_circle()
-  z.o,z.w  = get_points( C.first_lemoine )
-   z.y1,z.y2         = intersection (T.ab,C.first_lemoine)
-   z.y5,z.y6         = intersection (T.bc,C.first_lemoine)
-   z.y3,z.y4         = intersection (T.ca,C.first_lemoine)
-   z.L      = T : lemoine_point ()
-}
+ z.A  = point:  new (1,1)
+ z.B  = point:  new (5,1)
+ z.C  = point:  new (2.2,4)
+ T    = triangle:new(z.A,z.B,z.C) 
+ z.O  = T.circumcenter
+ C.first_lemoine = T:first_lemoine_circle()
+ z.o,z.w  = get_points( C.first_lemoine )
+ z.y1,z.y2= intersection (T.ab,C.first_lemoine)
+ z.y5,z.y6= intersection (T.bc,C.first_lemoine)
+ z.y3,z.y4= intersection (T.ca,C.first_lemoine)
+ z.L      = T:lemoine_point ()
 \begin{tikzpicture}
    \tkzGetNodes
    \tkzDrawPolygons(A,B,C)
@@ -4046,177 +4065,6 @@
 \end{minipage}
 % subsection antiparallel_through_lemoine_point (end)
 
-\subsection{Soddy circle without function} % (fold)
-\label{sub:soddy}
-
-\begin{Verbatim}
-\directlua{%
-init_elements ()
-z.A = point : new ( 0  , 0  )
-z.B = point : new ( 5  , 0  )
-z.C = point : new ( 0.5 ,  4  )
-T.ABC = triangle : new ( z.A,z.B,z.C )
-z.I = T.ABC.incenter
-z.E,z.F,z.G = T.ABC : projection (z.I)
-C.ins = circle : new (z.I,z.E)
-T.orthic = T.ABC : orthic ()
-z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-C.CF = circle : new ( z.C , z.F )
-C.AG = circle : new ( z.A , z.G )
-C.BE = circle : new ( z.B , z.E )
-L.Ah = line : new ( z.A , z.Ha )
-L.Bh = line : new ( z.B , z.Hb )
-L.Ch = line : new ( z.C , z.Hc )
-z.X,z.Xp = intersection (L.Ah,C.AG)
-z.Y,z.Yp = intersection (L.Bh,C.BE)
-z.Z,z.Zp = intersection (L.Ch,C.CF)
-L.XpE = line   : new (z.Xp,z.E)
-L.YpF = line   : new (z.Yp,z.F)
-L.ZpG = line   : new (z.Zp,z.G)
-z.S = intersection (L.XpE,L.YpF)
-z.Xi = intersection(L.XpE,C.AG)
-z.Yi = intersection(L.YpF,C.BE)
-_,z.Zi = intersection(L.ZpG,C.CF)
-z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
-C.soddy_int = circle : new (z.S,z.Xi)
-C.soddy_ext = C.ins : inversion (C.soddy_int)
-z.w = C.soddy_ext.center
-z.s = C.soddy_ext.through
-z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
-}
-
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
-\tkzDrawPoints(Xi',Yi',Zi',S)
-\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
-\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
-\tkzDrawLines(X',Ha Y',Hb Z',Hc)
-\tkzDrawLines(X',E Y',F Z',G)
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-z.A = point : new ( 0  , 0  )
-z.B = point : new ( 5  , 0  )
-z.C = point : new ( 0.5 ,  4  )
-T.ABC = triangle : new ( z.A,z.B,z.C )
-z.I = T.ABC.incenter
-z.E,z.F,z.G = T.ABC : projection (z.I)
-C.ins = circle : new (z.I,z.E)
-T.orthic = T.ABC : orthic ()
-z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-C.CF = circle : new ( z.C , z.F )
-C.AG = circle : new ( z.A , z.G )
-C.BE = circle : new ( z.B , z.E )
-L.Ah = line : new ( z.A , z.Ha )
-L.Bh = line : new ( z.B , z.Hb )
-L.Ch = line : new ( z.C , z.Hc )
-z.X,z.Xp = intersection (L.Ah,C.AG)
-z.Y,z.Yp = intersection (L.Bh,C.BE)
-z.Z,z.Zp = intersection (L.Ch,C.CF)
-L.XpE = line   : new (z.Xp,z.E)
-L.YpF = line   : new (z.Yp,z.F)
-L.ZpG = line   : new (z.Zp,z.G)
-z.S = intersection (L.XpE,L.YpF)
-z.Xi = intersection(L.XpE,C.AG)
-z.Yi = intersection(L.YpF,C.BE)
-_,z.Zi = intersection(L.ZpG,C.CF)
-z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
-C.soddy_int = circle : new (z.S,z.Xi)
-C.soddy_ext = C.ins : inversion (C.soddy_int)
-z.w = C.soddy_ext.center
-z.s = C.soddy_ext.through
-z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
-}
-
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
-\tkzDrawPoints(Xi',Yi',Zi',S)
-\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
-\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
-\tkzDrawLines(X',Ha Y',Hb Z',Hc)
-\tkzDrawLines(X',E Y',F Z',G)
-\end{tikzpicture}
-% subsection soddy (end)
-
-\subsection{Soddy circle with function} % (fold)
-\label{sub:soddy_circle_with_function}
-
-\directlua{%
-init_elements ()
-z.A = point : new ( 0  , 0  )
-z.B = point : new ( 5  , 0  )
-z.C = point : new (4 ,  4  )
-T.ABC = triangle : new ( z.A,z.B,z.C )
-z.I = T.ABC.incenter
-z.E,z.F,z.G = T.ABC : projection (z.I)
-T.orthic = T.ABC : orthic ()
-z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-C.ins = circle : new (z.I,z.E)
-z.s,z.xi,z.yi,z.zi = T.ABC : soddy_center ()
-C.soddy_int = circle : new (z.s,z.xi)
-C.soddy_ext = C.ins : inversion (C.soddy_int)
-z.w = C.soddy_ext.center
-z.t = C.soddy_ext.through
-z.Xip,z.Yip,z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
-}
-
-\begin{minipage}{.5\textwidth}
-  \begin{Verbatim}
-  \directlua{%
-init_elements ()
-  z.A = point : new ( 0  , 0  )
-  z.B = point : new ( 5  , 0  )
-  z.C = point : new (4 ,  4  )
-  T.ABC = triangle : new ( z.A,z.B,z.C )
-  z.I = T.ABC.incenter
-  z.E,z.F,z.G = T.ABC : projection (z.I)
-  T.orthic = T.ABC : orthic ()
-  z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-  C.ins = circle : new (z.I,z.E)
-  z.s,z.xi,z.yi,
-  z.zi = T.ABC : soddy_center ()
-  C.soddy_int = circle : new (z.s,z.xi)
-  C.soddy_ext = C.ins : inversion (C.soddy_int)
-  z.w = C.soddy_ext.center
-  z.t = C.soddy_ext.through
-  z.Xip,z.Yip,
-  z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
-  }
-\end{Verbatim}
-\end{minipage}
-\begin{minipage}{.5\textwidth}
-\begin{tikzpicture}[scale=.6]
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
-\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
-\tkzLabelPoints(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
-\tkzDrawPoints(Xi',Yi',Zi')
-\tkzLabelPoints(A,B,C,E,F,G)
-\end{tikzpicture}
-\end{minipage}
-
-\begin{Verbatim}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
-\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
-\tkzLabelPoints(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
-\tkzDrawPoints(Xi',Yi',Zi')
-\tkzLabelPoints(A,B,C,E,F,G)
-\end{tikzpicture}
-\end{Verbatim}
-% subsection soddy_circle_with_function (end)
-
 \subsection{Pappus chain} % (fold)
 \label{sub:pappus_chain}
 
@@ -4368,8 +4216,7 @@
 \end{minipage}
 % subsection three_circles (end)
 
-\subsection{p
-Pentagons in a golden arbelos} % (fold)
+\subsection{Pentagons in a golden arbelos} % (fold)
 \label{sub:golden_arbelos}
 
 \directlua{%

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-indepthstudy.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-indepthstudy.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-indepthstudy.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -300,7 +300,7 @@
    z.e  = z.a * z.b
     z.f  = z.a / z.b
     z.ap = point.conj (z.a)
-    -- = z.a : conj ()
+    % = z.a : conj ()
    z.g = z.b* point(math.cos(math.pi/2),
                    math.sin(math.pi/2))
 }
@@ -329,7 +329,7 @@
  z.e  = z.a * z.b
   z.f  = z.a / z.b
   z.ap = point.conj (z.a)
-  -- = z.a : conj ()
+  % = z.a : conj ()
  z.g = z.b* point(math.cos(math.pi/2),math.sin(math.pi/2))
 }
    
@@ -472,8 +472,235 @@
 \end{tikzpicture}
 \end{minipage}
 
+\begin{Verbatim}
+  \begin{tikzpicture}
+  \pgfkeys{/pgf/number format/.cd,use comma}
+  \let\pmpn\pgfmathprintnumber
+  \tkzGetNodes
+  \tkzDrawPolygon[cyan](A_1,A_...,A_\tkzUseLua{max})
+  \tkzDrawCircle[red](O,A_1)
+  \tkzDrawPoints[color=black](A_1,A_...,A_\tkzUseLua{max},O)
+  \tkzDrawSegments(O,A_1 O,A_2)
+  \tkzMarkAngle[size=2](A_1,O,A_2)
+  \tkzLabelAngle[pos=3.4](A_1,O,A_2){$\pmpn{\tkzUseLua{a}}^\circ$}
+  \end{tikzpicture}
+\end{Verbatim}
+
+
+
 % subsection loop_and_table_notation (end)
 
+\subsection{Use of tables} % (fold)
+\label{sub:use_of_tables}
+
+\subsubsection{Working with tables} % (fold)
+\label{ssub:working_with_tables}
+In this example, we search for circles that are tangent to both a given circle and a line, demonstrating that their centers lie on a parabola.
+
+The \code{points} table contains the coordinates of the centers of the identified circles. \TIKZ only requires a list of coordinate pairs enclosed in brackets.
+The table that defines the circles is slightly more complex. It contains the centers and the tangency points between the circles and the given elements. These are sequences of four coordinates, stored in the table. Finally, the sequences are concatenated into a string using a comma (",") as the separator. Coordinates are read with the \tkzcname{foreach} macro, utilizing the |expand list| option.
+
+
+\begin{Verbatim}
+\makeatletter
+\def\tkzPlotCoordinates{\pgfutil at ifnextchar[{\tkz at PlotCoordinates}{\tkz at PlotCoordinates[]}}
+\def\tkz at PlotCoordinates[#1]#2{%
+\draw[#1] plot coordinates {\directlua{tex.print(#2)}};}
+\makeatother
+
+
+\directlua{
+scale =.5
+z.O = point : new (0,0)
+z.P = point : new (0,6)
+z.M = point : new (0,3)
+z.I = point : new (1,0)
+C.PM = circle : new (z.P,z.M)
+list = {}
+points = {}
+ for t = -0.24, 0.24, 0.004 do
+ if (t> - 0.002 and t< 0.002) then else
+     z.A = C.PM : point (t)
+     L.OI = line : new (z.O,z.I)
+     L.PA = line : new (z.P,z.A)
+     z.C = intersection (L.OI,L.PA)
+     L.tgt = C.PM : tangent_at (z.A)
+     z.X = intersection (L.tgt,L.OI)
+     z.o = bisector (z.X,z.A,z.C).pb
+     table.insert (points, "("..z.o.re..","..z.o.im..")")
+     table.insert (list,z.o.re.."/"..z.o.im.."/"..z.A.re.."/"..z.A.im)
+   end
+   end
+    list = table.concat(list,",")
+ }
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzPlotCoordinates[smooth,blue]{points}
+   \foreach[expand list] \r/\s/\u/\v in {\tkzUseLua{list}}
+{
+  \tkzDefPoint(\u,\v){A}
+  \tkzDefPoint(\r,\s){o}
+  \tkzDrawCircle(o,A)
+  \tkzDrawPoints[red,size=.2pt](o,A)
+}
+\tkzDrawCircles(P,M)
+\tkzDrawPoints(P,M)
+\end{tikzpicture}
+\end{Verbatim}
+
+\makeatletter
+\def\tkzPlotCoordinates{\pgfutil at ifnextchar[{\tkz at PlotCoordinates}{\tkz at PlotCoordinates[]}}
+\def\tkz at PlotCoordinates[#1]#2{%
+\draw[#1] plot coordinates {\directlua{tex.print(#2)}};}
+\makeatother
+
+
+\directlua{
+scale =.5
+z.O = point : new (0,0)
+z.P = point : new (0,6)
+z.M = point : new (0,3)
+z.I = point : new (1,0)
+C.PM = circle : new (z.P,z.M)
+list = {}
+points = {}
+ for t = -0.24, 0.24, 0.004 do
+ if (t> - 0.002 and t< 0.002) then else
+     z.A = C.PM : point (t)
+     L.OI = line : new (z.O,z.I)
+     L.PA = line : new (z.P,z.A)
+     z.C = intersection (L.OI,L.PA)
+     L.tgt = C.PM : tangent_at (z.A)
+     z.X = intersection (L.tgt,L.OI)
+     z.o = bisector (z.X,z.A,z.C).pb
+     table.insert (points, "("..z.o.re..","..z.o.im..")")
+     table.insert (list,z.o.re.."/"..z.o.im.."/"..z.A.re.."/"..z.A.im)
+   end
+   end
+    list = table.concat(list,",")
+ }
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzPlotCoordinates[smooth,blue]{points}
+   \foreach[expand list] \r/\s/\u/\v in {\tkzUseLua{list}}
+{
+  \tkzDefPoint(\u,\v){A}
+  \tkzDefPoint(\r,\s){o}
+  \tkzDrawCircle(o,A)
+  \tkzDrawPoints[red,size=.2pt](o,A)
+}
+\tkzDrawCircles(P,M)
+\tkzDrawPoints(P,M)
+\end{tikzpicture}
+
+% subsubsection working_with_tables (end)
+
+
+\subsubsection{Plotting a curve} % (fold)
+\label{ssub:plotting_a_curve}
+In this example, we'll use lua to plot the representative curve of the function 
+\[ y = f(x) = x*exp(-x^2)+1\].
+
+We'll use a table called “points” to store the coordinates of the points on the curve. 
+
+
+\makeatletter\let\percentchar\@percentchar\makeatother
+\directlua{
+function checknumber(x)
+   if string.find(x, "e") then
+      return string.format("\percentchar.12f",x)
+   else
+      return x
+   end
+end
+}
+
+\def\val#1{%
+\directlua{%
+    local expr = [[\tkzfct]] 
+  local f = load (("
+        return function (x)
+            return (\percentchar s)
+        end"):format (expr), nil, 't', math) ()
+tex.print(f(#1)) 
+}}
+
+\def\calcval(#1,#2,#3,#4){%
+\directlua{
+local min, max, nb = #2, #3, #4 
+local expr = [[#1]]
+local points = {}
+
+local f = load (("return function (x) return (\percentchar s) end"):format (expr), nil, 't', math) ()
+
+for t = min,max,(max-min)/nb  do
+local x = checknumber(t)
+local y = checknumber(f(t))
+    table.insert (points, "("..x..","..y..")")  
+ end
+ tex.print(points)
+ }
+}
+
+\def\tkzfct{x*exp(-x^2)+1}
+
+\begin{tikzpicture}[scale = 2]
+  \tkzInit[xmin=-3,xmax=3,ymin=-2,ymax=2]
+  \tkzDrawX\tkzDrawY
+   \draw[smooth] plot coordinates {\calcval(\tkzfct,-3,2,100)};
+   \tkzDrawPoint(-3,\val{-3})
+   \tkzDrawPoint(1,\val{1})
+   \tkzDrawPoint(2,\val{2})
+\end{tikzpicture}
+
+\begin{Verbatim}
+\makeatletter\let\percentchar\@percentchar\makeatother
+\directlua{
+function checknumber(x)
+   if string.find(x, "e") then
+      return string.format("\percentchar.12f",x)
+   else
+      return x
+   end
+end}
+\def\val#1{\directlua{%
+  local expr = [[\tkzfct]] 
+  local f = load (("return function (x)
+            return (\percentchar s) end"):format (expr), nil, 't', math) ()
+tex.print(f(#1))
+}}
+\def\calcval(#1,#2,#3,#4){%
+\directlua{%
+  local min, max, nb = #2, #3, #4 
+  local expr = [[#1]]
+  local points = {}
+  local f = load (("return function (x)
+            return (\percentchar s) end"):format (expr), nil, 't', math) ()
+for t = min,max,(max-min)/nb  do
+ local x = checknumber(t)
+ local y = checknumber(f(t))
+ if (y==math.huge or y==-math.huge ) then tex.print("problem") end
+    table.insert (points, "("..x..","..y..")")  
+ end
+ tex.print(points)
+}}
+\def\tkzfct{x*exp(-x^2)+1}
+\begin{tikzpicture}
+  \tkzInit[xmin=-3,xmax=3,ymin=-2,ymax=2]
+  \tkzDrawX\tkzDrawY
+   \draw[smooth] plot coordinates {\calcval(\tkzfct,-3,2,100)};
+   \tkzDrawPoint(-3,\val{-3})
+   \tkzDrawPoint(1,\val{1})
+   \tkzDrawPoint(2,\val{2})
+\end{tikzpicture}
+\end{Verbatim}
+
+% subsubsection plotting_a_curve (end)
+
+% ssubsection use_of_tables (end)
+
 \subsection{In\_out method} % (fold)
 \label{sub:in_out_method}
 
@@ -586,10 +813,10 @@
 Here's the definition and transformation of the power of a complex number.
 
 \begin{Verbatim}
-   -- determinant  is '^'   ad - bc
+   % determinant  is '^'   ad - bc
    function point.__pow(z1,z2)
        local z
-       z = point.conj(z1) * z2   -- (a-ib) (c+id) = ac+bd + i(ad - bc)
+       z = point.conj(z1) * z2   % (a-ib) (c+id) = ac+bd + i(ad - bc)
       return z.im
    end
 \end{Verbatim}
@@ -602,10 +829,10 @@
 Here's the definition of the dot product between two affixes and the concatenation transformation. 
 
 \begin{Verbatim}
--- dot product is '..'         result ac + bd
+% dot product is '..'         result ac + bd
 function point.__concat(z1,z2)
     local z
-    z = z1 * point.conj(z2)         -- (a+ib) (c-id) = ac+bd + i(bc-ad) 
+    z = z1 * point.conj(z2)         % (a+ib) (c-id) = ac+bd + i(bc-ad) 
   return z.re
 end
 \end{Verbatim}

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -200,7 +200,7 @@
    z.e      = L.ab: point (-.2)
    E        = ellipse: foci (z.a,z.b,z.e)
    z.u,z.v  = intersection (E,L.mn)
-  -- transfer to tex
+  %  transfer to tex
    a        = E.Rx
    b        = E.Ry
    ang      = math.deg(E.slope)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-inversion.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-inversion.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-inversion.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,4 +1,4 @@
 \section{Inversion} % (fold)
 \label{sec:inversion}
-midcircless
+midcircles
 % section inversion (end)
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-main.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-main.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-main.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 % !TEX TS-program = lualatex
 % encoding : utf8 
-% Documentation of tkz-elements v3.00c
+% Documentation of tkz-elements v3.10c
 % Copyright 2024  Alain Matthes
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either version 1.3
@@ -21,10 +21,10 @@
                headings    = small
                ]{tkz-doc}
 \gdef\tkznameofpack{tkz-elements}
-\gdef\tkzversionofpack{3.00c}
+\gdef\tkzversionofpack{3.10c}
 \gdef\tkzdateofpack{\today}
 \gdef\tkznameofdoc{tkz-elements.pdf}
-\gdef\tkzversionofdoc{3.00c}
+\gdef\tkzversionofdoc{3.10c}
 \gdef\tkzdateofdoc{\today}
 \gdef\tkzauthorofpack{Alain Matthes}
 \gdef\tkzadressofauthor{}
@@ -66,6 +66,8 @@
 
 \usepackage{fontspec}
 \setmainfont{texgyrepagella}[
+    UprightFont = texgyrepagella-regular.otf,
+    SmallCapsFeatures={FakeSmallCaps},
   Extension = .otf,
   UprightFont = *-regular ,
   ItalicFont  = *-italic  ,
@@ -78,7 +80,8 @@
   ItalicFont  = *-italic  ,
   BoldFont    = *-bold    ,
   BoldItalicFont = *-bolditalic ,
-]
+ BoldItalicFeatures = {RawFeature=-smcp} % Désactiver smcp
+ ]
 
 \setmonofont{lmmono10-regular.otf}[
   Numbers={Lining,SlashedZero},
@@ -178,10 +181,11 @@
 \tkzTitleFrame{tkz-elements \tkzversionofpack\\Euclidean Geometry}
 \clearpage
 
-\defoffile{\lefthand\
+
+\defoffile{\lefthand\ \\
  This document compiles some notes about  \tkzname{\tkznameofpack}, the initial version of a \code{Lua}  library designed to perform all the necessary calculations for defining objects in Euclidean geometry figures. Your document  must be compiled using Lua\LaTeX.\\ 
  With \pkg{tkz-elements}, definitions and calculations are exclusively conducted using \pkg{Lua}. \\ 
- The primary programming approach offered is oriented towards \code{object programming}, utilizing object classes such as point, line, triangle, circle, and ellipse.  Currently, after the calculations are completed, \pkg{tkz-euclide} or   \pkg{TikZ} is used for drawing purposes.\\
+ The primary programming approach offered is oriented towards object programming, utilizing object classes such as point, line, triangle, circle, and ellipse.  Currently, after the calculations are completed, \pkg{tkz-euclide} is used for drawing purposes. (but you can use \TIKZ)\\
  I discovered Lua and object-oriented programming  while developing this package, so it's highly likely that I've made a few mistakes.   If you'd like to contribute to the development of this package or provide advice on how to proceed, please contact me via email.
 }
 
@@ -236,6 +240,7 @@
 \input{TKZdoc-elements-classes-misc.tex}
 \input{TKZdoc-elements-intersection.tex}
 \input{TKZdoc-elements-indepthstudy.tex}
+\input{TKZdoc-elements-theorems.tex}
 \input{TKZdoc-elements-examples.tex}
 
 \clearpage\newpage
@@ -246,7 +251,7 @@
 \label{sec:cheat_sheet}
 
 % section cheat_sheet (end)
-|r| denotes a real number, |cx| complex number, |d| a positive real number, |n| an integer, |an| an angle, |b| a boolean, |s| a character string, |pt| a point, |t| a table, |m| a matrix, |v| variable, |L| a straight line, |C| a circle, |T| a triangle, |E| an ellipse, |V| a vector,|Q| a quadrilateral, |P| a parallelogram, |R| a rectangle, |S| a square, |RP| a regular polygon, |M| a matrix, |O| an object (pt, L,C,T), . . a list of points or an object, < > optional argument. 
+|r| denotes a real number, |cx| complex number, |d| a positive real number, |n| an integer, |an| an angle, |b| a boolean, |s| a character string, |p| a point, |t| a table, |m| a matrix, |v| variable, |L| a straight line, |C| a circle, |T| a triangle, |E| an ellipse, |V| a vector,|Q| a quadrilateral, |P| a parallelogram, |R| a rectangle, |S| a square, |RP| a regular polygon, |M| a matrix, |O| an object (p, L,C,T), . . a list of points or an object, < > optional argument. 
 
 \begin{multicols}{3}
 \fbox{\textbf{point}}\\
@@ -257,82 +262,87 @@
 |argument                  -> r|   \\
 |modulus                   -> d|   \\
 \textbf{Functions} table(\ref{point:att})   \\
-|new                       -> pt|  \\
-|polar                     -> pt|  \\
-|polar_deg                 -> pt|  \\
+|new                       -> p|  \\
+|polar                     -> p|  \\
+|polar_deg                 -> p|  \\
 \textbf{Methods} table(\ref{complex:meta})  \\
-|+ - * /     (pt,pt)       -> pt|  \\
-|..          (pt,pt)       -> r|   \\
-|^           (pt,pt)       -> r|   \\
+|+ - * /     (p,p)         -> p|  \\
+|..          (p,p)         -> r|   \\
+|^           (p,p)         -> r|   \\
 |=                         -> b|   \\
 |tostring                  -> s|   \\
 \textbf{Methods} table(\ref{point:met})  table(\ref{complex:met})    \\
-|conj                      -> pt|  \\
+|conj                      -> p|  \\
 |abs                       -> r|   \\
 |mod                       -> d|   \\
 |norm                      -> d|   \\
 |arg                       -> d|   \\
 |get                       -> r,r| \\
-|sqrt                      -> pt|  \\
-|north(d)                  -> pt|  \\
-|south(d)                  -> pt|  \\
-|east(d)                   -> pt|  \\
-|west(d)                   -> pt|  \\
-|normalize(pt)             -> pt|  \\
+|sqrt                      -> p|  \\
+|north(d)                  -> p|  \\
+|south(d)                  -> p|  \\
+|east(d)                   -> p|  \\
+|west(d)                   -> p|  \\
+|normalize(p)              -> p|  \\
 |symmetry (...)            -> O|   \\
 |rotation (an , ...)       -> O|   \\
 |homothety (r , ...)       -> O|   \\
-|orthogonal(d)             -> pt|  \\
-|at()                      -> pt|  \\
+|orthogonal(d)             -> p|  \\
+|at()                      -> p|  \\
 |print()                   -> s|   \\
                                    \\
 \fbox{\textbf{line}}               \\
 \textbf{Attributes} table(\ref{line:att})  \\
-|pa,pb                     -> pt|  \\
+|pa,pb                     -> p|  \\
 |type                      -> s|   \\
-|mid                       -> pt|  \\
-|north_pa                  -> pt|  \\
-|north_pb                  -> pt|  \\
-|south_pa                  -> pt|  \\
-|south_pb                  -> pt|  \\
-|east                      -> pt|  \\
-|west                      -> pt|  \\
+|mid                       -> p|  \\
+|north_pa                  -> p|  \\
+|north_pb                  -> p|  \\
+|south_pa                  -> p|  \\
+|south_pb                  -> p|  \\
+|east                      -> p|  \\
+|west                      -> p|  \\
 |slope                     -> r|   \\
 |length                    -> d|   \\
 |vec                       -> V|   \\
 \textbf{Methods} table(\ref{line:met})     \\
-|new (pt,pt)               -> d|   \\
-|distance (pt)             -> d|   \\
+|new (p,p)                 -> d|   \\
+|distance (p)              -> d|   \\
 |slope ()                  -> r|   \\
-|in_out (pt)               -> b|   \\
-|in_out_segment (pt)       -> b|   \\
-|barycenter (r,r)          -> pt|  \\
-|point (t)                 -> pt|  \\
-|midpoint ()               -> pt|  \\
-|harmonic_int (pt)         -> pt|  \\
-|harmonic_ext (pt)         -> pt|  \\
-|harmonic_both (d)         -> pt|  \\
-|gold_ratio()              -> pt|  \\
-|normalize ()              -> pt|  \\
-|normalize_inv ()          -> pt|  \\
-|_north_pa (d)             -> pt|  \\
-|_north_pb (d)             -> pt|  \\               
-|_south_pa (d)             -> pt|  \\
-|_south_pb (d)             -> pt|  \\                  
-|_east (d)                 -> pt|  \\
-|_west (d)                 -> pt|  \\
-|report (r,pt)             -> pt|  \\
-|colinear_at (pt,k)        -> pt|  \\                 
+|in_out (p)                -> b|   \\
+|in_out_segment (p)        -> b|   \\
+|is_parallel (l)           -> b|   \\
+|is_orthogonal (l)         -> b|   \\
+|is_equidistant (p)        -> b|   \\
+|barycenter (r,r)          -> p|  \\
+|point (t)                 -> p|  \\
+|midpoint ()               -> p|  \\
+|harmonic_int (p)          -> p|  \\
+|harmonic_ext (p)          -> p|  \\
+|harmonic_both (d)         -> p|  \\
+|gold_ratio()              -> p|  \\
+|normalize ()              -> p|  \\
+|normalize_inv ()          -> p|  \\
+|_north_pa (d)             -> p|  \\
+|_north_pb (d)             -> p|  \\
+|_south_pa (d)             -> p|  \\
+|_south_pb (d)             -> p|  \\ 
+|_east (d)                 -> p|  \\
+|_west (d)                 -> p|  \\
+|report (r,p)              -> p|  \\
+|colinear_at (p,k)         -> p|  \\
 |translation (...)         -> O|   \\
 |projection (...)          -> O|   \\
 |reflection (...)          -> O|   \\
-|ll_from ( pt )            -> L|   \\
-|ortho_from ( pt )         -> L|   \\
+|ll_from ( p )             -> L|   \\
+|ortho_from ( p )          -> L|   \\
 |mediator ()               -> L|   \\
 |circle ()                 -> C|   \\
 |circle_swap ()            -> C|   \\
 |diameter ()               -> C|   \\
-|apollonius (r)            -> C|   \\                     
+|apollonius (r)            -> C|   \\
+|c_ll_p (p,p)              -> C|   \\
+|c_l_pp (p,p)              -> C|   \\
 |equilateral (<swap>)      -> T|   \\
 |isosceles (an,<swap>)     -> T|   \\
 |school ()                 -> T|   \\
@@ -353,13 +363,13 @@
                                    \\
 \fbox{\textbf{triangle}}           \\
 \textbf{Attributes} table(\ref{triangle:att})      \\
-|pa,pb,pc                  -> pt|  \\
-|circumcenter              -> pt|  \\
-|centroid                  -> pt|  \\
-|incenter                  -> pt|  \\
-|eulercenter               -> pt|  \\
-|orthocenter               -> pt|  \\
-|spiekercenter             -> pt|  \\
+|pa,pb,pc                  -> p|  \\
+|circumcenter              -> p|  \\
+|centroid                  -> p|  \\
+|incenter                  -> p|  \\
+|eulercenter               -> p|  \\
+|orthocenter               -> p|  \\
+|spiekercenter             -> p|  \\
 |type                      -> s|   \\
 |a                         -> d|   \\
 |b                         -> d|   \\
@@ -371,30 +381,30 @@
 |beta                      -> r|   \\
 |gamma                     -> r|   \\
 \textbf{Methods} table(\ref{triangle:met}) \\
-|new (pt,pt,pt)            -> pt|  \\
-|trilinear (r,r,r)         -> pt|  \\
-|barycentric (r,r,r)       -> pt|  \\
-|bevan_point ()            -> pt|  \\
-|mittenpunkt_point ()      -> pt|  \\
-|gergonne_point ()         -> pt|  \\
-|nagel_point ()            -> pt|  \\
-|feuerbach_point ()        -> pt|  \\
-|lemoine_point()           -> pt|  \\
-|symmedian_point()         -> pt|  \\
-|spieker_center()          -> pt|  \\
-|barycenter (r,r,r)        -> pt|  \\
-|base (u,v)                -> pt|  \\
-|euler_points ()           -> pt|  \\
-|nine_points ()            -> pt|  \\
-|point (t)                 -> pt|  \\
-|soddy_center ()           -> pt|  \\
-|conway_points ()          -> pts|  \\
+|new (p,p,p)               -> p|  \\
+|trilinear (r,r,r)         -> p|  \\
+|barycentric (r,r,r)       -> p|  \\
+|bevan_point ()            -> p|  \\
+|mittenpunkt_point ()      -> p|  \\
+|gergonne_point ()         -> p|  \\
+|nagel_point ()            -> p|  \\
+|feuerbach_point ()        -> p|  \\
+|lemoine_point()           -> p|  \\
+|symmedian_point()         -> p|  \\
+|spieker_center()          -> p|  \\
+|barycenter (r,r,r)        -> p|  \\
+|base (u,v)                -> p|  \\
+|euler_points ()           -> p|  \\
+|nine_points ()            -> p|  \\
+|point (t)                 -> p|  \\
+|soddy_center ()           -> p|  \\
+|conway_points ()          -> pts| \\
 |euler_line ()             -> L|   \\
 |symmedian_line (n)        -> L|   \\
 |altitude (n)              -> L|   \\
 |bisector (n)              -> L|   \\
 |bisector_ext(n)           -> L|   \\
-|antiparallel(pt,n)        -> L|   \\
+|antiparallel(p,n)         -> L|   \\
 |euler_circle ()           -> C|   \\
 |circum_circle()           -> C|   \\
 |in_circle ()              -> C|   \\
@@ -406,6 +416,7 @@
 |conway_circle ()          -> C|   \\
 |pedal_circle ()           -> C|   \\
 |cevian_circle ()          -> C|   \\
+|c_ll_p (p)                -> C|   \\
 |orthic()                  -> T|   \\
 |medial()                  -> T|   \\
 |incentral()               -> T|   \\
@@ -416,104 +427,109 @@
 |feuerbach()               -> T|   \\
 |anti ()                   -> T|   \\
 |tangential ()             -> T|   \\
-|cevian (pt)               -> T|   \\
+|cevian (p)                -> T|   \\
 |symmedian ()              -> T|   \\
 |euler ()                  -> T|   \\
-|pedal (pt)                -> T|   \\
-|projection (pt)     -> pt,pt,pt|  \\
-|parallelogram ()          -> pt|  \\
+|pedal (p)                 -> T|   \\
+|projection (p)         -> p,p,p|  \\
+|parallelogram ()          -> p|  \\
 |area ()                   -> d|   \\
-|barycentric_coordinates(pt)|      \\
+|barycentric_coordinates(p)|      \\
                       |-> r,r,r|   \\
-|in_out (pt)               -> pt|  \\
+|in_out (p)                -> p|  \\
 |check_equilateral ()      -> b|   \\
                                    \\
 \fbox{\textbf{circle}}             \\
 \textbf{Attributes} table(\ref{circle:att}) \\
-|center                    -> pt|  \\
-|through                   -> pt|  \\
-|north                     -> pt|  \\
-|south                     -> pt|  \\
-|east                      -> pt|  \\
-|west                      -> pt|  \\
-|opp                       -> pt|  \\
+|center                    -> p|  \\
+|through                   -> p|  \\
+|north                     -> p|  \\
+|south                     -> p|  \\
+|east                      -> p|  \\
+|west                      -> p|  \\
+|opp                       -> p|  \\
 |type                      -> s|   \\
 |radius                    -> d|   \\
 |ct                        -> L|   \\ 
+|perimeter                 -> r|   \\ 
+|area                      -> r|   \\ 
 \textbf{Methods} table(\ref{circle:met})  \\
-|new (pt,pt)               -> C|   \\
-|radius (pt, r)            -> C|   \\
-|diameter (pt,pt)          -> C|   \\       
-|in_out (pt)               -> b|   \\     
-|in_out_disk (pt)          -> b|   \\     
-|circles_position (C)      -> s|   \\     
-|power (pt)                -> r|   \\     
-|antipode (pt)             -> pt|  \\     
-|midarc (pt,pt)            -> pt|  \\     
-|point (r)                 -> pt|  \\     
-|random_pt (lower, upper)  -> pt|  \\     
-|internal_similitude (C)   -> pt|  \\     
-|external_similitude (C)   -> pt|  \\       
-|radical_center(C,<C>)     -> pt|  \\
-|tangent_at (pt)           -> L|   \\     
-|radical_axis (C)          -> L|   \\     
-|radical_circle(C,<C>)     -> C|   \\     
-|orthogonal_from (pt)      -> C|   \\     
-|orthogonal_through(pt,pt) -> C|   \\
+|new (p,p)                 -> C|   \\
+|radius (p, r)             -> C|   \\
+|diameter (p,p)            -> C|   \\ 
+|in_out (p)                -> b|   \\ 
+|in_out_disk (p)           -> b|   \\ 
+|circles_position (C)      -> s|   \\ 
+|power (p)                 -> r|   \\ 
+|antipode (p)              -> p|  \\ 
+|midarc (p,p)              -> p|  \\ 
+|point (r)                 -> p|  \\ 
+|random_pt (lower, upper)  -> p|  \\ 
+|internal_similitude (C)   -> p|  \\ 
+|external_similitude (C)   -> p|  \\ 
+|radical_center(C,<C>)     -> p|  \\
+|tangent_at (p)            -> L|   \\ 
+|radical_axis (C)          -> L|   \\ 
+|radical_circle(C,<C>)     -> C|   \\ 
+|orthogonal_from (p)       -> C|   \\ 
+|orthogonal_through(p,p)   -> C|   \\
+|c_lc_p (L,p,inside)       -> C|   \\
+|c_c_pp(a,b)(p,p)          -> C|   \\
+|c_cc_p (C,p)              -> C|   \\
 |midcircle(C)              -> C|   \\
 |external_tangent(C)       -> L,L| \\
 |internal_tangent(C)       -> L,L| \\
 |common_tangent(C)         -> L,L| \\
-|tangent_from (pt)         -> L,L| \\
+|tangent_from (p)          -> L,L| \\
 |inversion (...)           -> O |  \\
                                    \\
 \fbox{\textbf{ellipse}}            \\
-\textbf{Attributes} table(\ref{ellipse:met})      \\
-|center                    -> pt|  \\
-|vertex                    -> pt|  \\
-|covertex                  -> pt|  \\
-|Fa                        -> pt|  \\
-|Fb                        -> pt|  \\
-|north                     -> pt|  \\
-|south                     -> pt|  \\
-|east                      -> pt|  \\
-|west                      -> pt|  \\
+\textbf{Attributes} table(\ref{ellipse:met}) \\
+|center                    -> p|  \\
+|vertex                    -> p|  \\
+|covertex                  -> p|  \\
+|Fa                        -> p|  \\
+|Fb                        -> p|  \\
+|north                     -> p|  \\
+|south                     -> p|  \\
+|east                      -> p|  \\
+|west                      -> p|  \\
 |Rx                        -> d|   \\
 |Ry                        -> d|   \\
 |slope                     -> r|   \\
 |type                      -> s|   \\
 \textbf{Methods} table(\ref{ellipse:met}) \\
-|new (pt,pt,pt)            -> E|   \\
-|foci (pt,pt,pt)           -> E|   \\
-|radii (pt,r,r,an)         -> E|   \\
-|in_out (pt)               -> b|   \\
-|tangent_at (pt)           -> L|   \\
-|tangent_from (pt)         -> L|   \\
-|point (r)                 -> pt|  \\
+|new (p,p,p)               -> E|   \\
+|foci (p,p,p)              -> E|   \\
+|radii (p,r,r,an)          -> E|   \\
+|in_out (p)                -> b|   \\
+|tangent_at (p)            -> L|   \\
+|tangent_from (p)          -> L|   \\
+|point (r)                 -> p|  \\
                                    \\
-\fbox{\textbf{square}}             \\                      
- \textbf{Attributes} table(\ref{square:att})      \\
-|pa,pb,pc,pd               -> pt|  \\
+\fbox{\textbf{square}}             \\
+ \textbf{Attributes} table(\ref{square:att}) \\
+|pa,pb,pc,pd               -> p|  \\
 |type                      -> s|   \\
 |side                      -> d|   \\
-|center                    -> pt|  \\
-|exradius                  -> d|   \\
+|center                    -> p|  \\
+|circumradius              -> d|   \\
 |inradius                  -> d|   \\
 |diagonal                  -> d|   \\
-|proj                      -> pt|  \\
+|proj                      -> p|  \\
 |ab bc cd da               -> L|   \\
 |ac bd                     -> L|   \\
- \textbf{Methods} table(\ref{square:met})      \\
-|new (pt,pt,pt,pt)         -> S|   \\ 
-|rotation (pt,pt)          -> S|   \\
-|side (pt,pt,<swap>)       -> S|   \\
+ \textbf{Methods} table(\ref{square:met}) \\
+|new (p,p,p,p)             -> S|   \\ 
+|rotation (p,p)            -> S|   \\
+|side (p,p,<swap>)         -> S|   \\
                                    \\
 \fbox{\textbf{rectangle}}          \\
 \textbf{Attributes} table(\ref{rectangle:att}) \\
-|pa,pb,pc,pd               -> pt|  \\
+|pa,pb,pc,pd               -> p|  \\
 |type                      -> s|   \\
-|center                    -> pt|  \\
-|exradius                  -> d|   \\
+|center                    -> p|  \\
+|circumradius              -> d|   \\
 |length                    -> r|   \\
 |width                     -> r|   \\
 |diagonal                  -> d|   \\
@@ -520,51 +536,51 @@
 |ab bc cd da               -> L|   \\
 |ac bd                     -> L|   \\
  \textbf{Methods} table(\ref{rectangle:met}) \\
-|new (pt,pt,pt,pt)         -> R|   \\ 
-|angle (pt,pt,an)          -> R|   \\
-|gold  (pt,pt,<swap>)      -> R|   \\
-|diagonal  (pt,pt,<swap>)  -> R|   \\
-|side  (pt,pt,r,<swap>)    -> R|   \\
+|new (p,p,p,p)             -> R|   \\ 
+|angle (p,p,an)            -> R|   \\
+|gold  (p,p,<swap>)        -> R|   \\
+|diagonal  (p,p,<swap>)    -> R|   \\
+|side  (p,p,r,<swap>)      -> R|   \\
 |get_lengths ()            ->r,r|  \\
                                    \\
 \fbox{\textbf{quadrilateral} }     \\
  \textbf{Attributes} table(\ref{quadrilateral:att}) \\
-|pa,pb,pc,pd               -> pt|  \\
+|pa,pb,pc,pd               -> p|  \\
 |ab bc cd da               -> L |  \\
 |ac bd                     -> L |  \\
 |type                      -> s |  \\
-|i                         -> pt|  \\
-|g                         -> pt|  \\
+|i                         -> p|  \\
+|g                         -> p|  \\
 |a b c d                   -> r|   \\
  \textbf{Methods} table(\ref{quadrilateral:met}) \\
-|new (pt,pt,pt,pt)         -> Q|   \\ 
+|new (p,p,p,p)             -> Q|   \\ 
 |iscyclic ()               -> b|   \\         
                                    \\
 \fbox{\textbf{parallelogram}}      \\
  \textbf{Attributes} table(\ref{parallelogram:att}) \\
-|pa,pb,pc,pd               -> pt|  \\
+|pa,pb,pc,pd               -> p|  \\
 |ab bc cd da               -> L |  \\
 |ac bd                     -> L |  \\
 |type                      -> s |  \\
-|center                    -> pt|  \\
+|center                    -> p|  \\
  \textbf{Methods} table(\ref{parallelogram:met}) \\
-|new (pt,pt,pt,pt)         ->|     \\ 
-|fourth (pt,pt,pt)         ->|     \\
+|new (p,p,p,p)             ->|     \\ 
+|fourth (p,p,p)            ->|     \\
                                    \\
 \fbox{\textbf{Regular\_polygon}}   \\
  \textbf{Attributes} table(\ref{regular:att}) \\
-|center                    -> pt|  \\
-|through                   -> pt | \\
+|center                    -> p|  \\
+|through                   -> p | \\
 |circle                    -> C |  \\
 |type                      -> s |  \\
 |side                      -> d|   \\
-|exradius                  -> d|   \\
+|circumradius              -> d|   \\
 |inradius                  -> d|   \\
-|proj                      -> pt|  \\
+|proj                      -> p|  \\
 |nb                        -> i|   \\
 |angle                     -> an|  \\
  \textbf{Methods} table(\ref{regular:met})  \\
-|new (pt,pt,n)             -> PR|  \\
+|new (p,p,n)               -> PR|  \\
 |incircle ()               -> C|   \\
 |name (s)                  -> ?|   \\
                                    \\
@@ -575,12 +591,12 @@
 |slope                     -> r|   \\
 |mtx                       -> M|   \\
 \textbf{Methods} table(\ref{vector:met})  \\
-|new (pt,pt)               -> V|   \\
-|+ - *                     -> pt|  \\
+|new (p,p)                 -> V|   \\
+|+ - *                     -> p|  \\
 |normalize (V)             -> V|   \\
 |orthogonal (d)            -> V|   \\
 |scale (r)                 -> V|   \\
-|at (pt)                   -> V|   \\
+|at (p)                    -> V|   \\
 \fbox{\textbf{matrix}}             \\
 \textbf{Attributes} table(\ref{matrix:att})   \\
 |set                       ->  t|  \\
@@ -617,23 +633,24 @@
 |tkzsqrtphi                -> r|   \\
 |tkz_epsilon (default=1e-8)-> r|   \\
 |length                    -> d|   \\
-|islinear(pt,pt,pt)        -> b|   \\
-|isortho(pt,pt,pt)         -> b|   \\
+|islinear(p,p,p)           -> b|   \\
+|isortho(p,p,p)            -> b|   \\
 |value{r}                  -> r|   \\
 |real                      -> r|   \\
 |angle_normalize (an)      -> an|  \\
-|barycenter (...)          -> pt|  \\
-|bisector (pt,pt,pt)       -> L|   \\
-|bisector_ext (pt,pt,pt)   -> L|   \\
-|altitude (pt,pt,pt)       -> L|   \\
-|midpoint (pt,pt)          -> pt|  \\
-|equilateral (pt,pt)       -> T|   \\
+|barycenter (...)          -> p|  \\
+|bisector (p,p,p)          -> L|   \\
+|bisector_ext (p,p,p)      -> L|   \\
+|altitude (p,p,p)          -> L|   \\
+|midpoint (p,p)            -> p|  \\
+|midpoints (...)  -> list of pts|  \\
+|equilateral (p,p)         -> T|   \\
 |format_number(r,n)        -> r|   \\
-|solve_quadratic(cx,cx,cx) -> cx,cx|   \\
+|solve_quadratic(cx,cx,cx)-> cx,cx|\\
 |\tkzUseLua{v}             -> s|   \\
                                    \\
 \fbox{\textbf{Macros}}             \\
 |\tkzDN[n]{r}              -> r|   \\
-|\tkzDrawLuaEllipse((pt,pt,pt))|   \\
+|\tkzDrawLuaEllipse((p,p,p))|   \\
 \end{multicols}
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-news.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-news.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-news.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,13 +1,11 @@
 \section{News} % (fold)
 \label{sec:news}
 
-The documentation you are reading corresponds to the latest version 3.0 of \tkzNamePack{tkz-elements}. This version introduces an important new feature: the code \code{Lua} part of the code can now be processed using the \Iprimitive{directlua} primitive of \Iengine{Lua\LaTeX}. See the examples given in the Transfers section. 
+The documentation you are reading corresponds to the latest version (3.10c) of \tkzNamePack{tkz-elements}.
+One significant feature introduced in version 3.0 was the use of the \Iprimitive{directlua} macro, replacing the \tkzNameEnv{tkzelements} environment. 
+In this new version , most functions have been optimized and quelques méthodes apparaissent. In particular, methods for determining a circle tangent to different objects. (see \ref{ssub:c_l_pp}; \ref{ssub:method_c__ll__p}; \ref{ssub:method_c__c__pp}; \ref{ssub:method_c_cc_p}; \ref{ssub:method_c_lc_p}; and \ref{ssub:tr_method_c__ll__p})
 
-This introduces a slight complication whatever the method used to execute the \code{Lua} code. If you want to use the \tkzNameEnv{tkzelements} environment, then you need to load the \pkg{luacode} package. If you prefer to use the |\directlua| primitive, you'll need to delete and reset the tables and  \Igfct{tkz-elements}{scale} with the \Igfct{tkz-elements}{init\_elements} function. 
 
-Some complex examples require the use of the \Iprimitive{directlua} primitive.
-
-
 % section news (end)
 \endinput
 

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-organization.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-organization.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-organization.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -18,11 +18,10 @@
 A third advantage is that the code can be reused.
 
 
-
+\begin{minipage}{.5\textwidth}
 \begin{Verbatim}
 % !TEX TS-program = lualatex
 % Created by Alain Matthes on 2024-01-09.
-
 \documentclass[margin = 12pt]{standalone} 
 \usepackage[mini]{tkz-euclide}
 \usepackage{tkz-elements,ifthen}
@@ -32,7 +31,6 @@
  scale = 1.25
  dofile ("sangaku.lua")
 }
-
 \begin{tikzpicture}
    \tkzGetNodes
    \tkzDrawCircle(I,F)
@@ -42,38 +40,46 @@
 \end{tikzpicture}
 \end{document}
 \end{Verbatim}
-
-And here is the code for the \code{Lua} part: the file |ex_sangaku.lua|
-
-\begin{Verbatim}
-z.A         = point : new ( 0,0 ) 
-z.B         = point : new ( 8,0 )
-L.AB        = line : new ( z.A , z.B )
-S           = L.AB : square ()
-_,_,z.C,z.D = get_points (S)
-z.F         = S.ac : projection (z.B)
-L.BF        = line : new (z.B,z.F)
-T.ABC       = triangle : new ( z.A , z.B , z.C )
-L.bi        = T.ABC : bisector (2)
-z.c         = L.bi.pb
-L.Cc        = line : new (z.C,z.c)
-z.I         = intersection (L.Cc,L.BF)
-\end{Verbatim}
-
+\end{minipage}
+\begin{minipage}{.5\textwidth}
 \directlua{
  init_elements ()
- scale = 1.25
+ scale = .75
  dofile ("sangaku.lua")
 }
 
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzDrawCircle(I,F)
-   \tkzFillPolygon[color = purple](A,C,D)%
-   \tkzFillPolygon[color = blue!50!black](A,B,C)%
-   \tkzFillCircle[color = orange](I,F)%
-\end{tikzpicture}
+\begin{center}
+  \begin{tikzpicture}
+     \tkzGetNodes
+     \tkzDrawCircle(I,F)
+     \tkzFillPolygon[color = purple](A,C,D)%
+     \tkzFillPolygon[color = blue!50!black](A,B,C)%
+     \tkzFillCircle[color = orange](I,F)%
+  \end{tikzpicture}
+\end{center}
 
+\end{minipage}
+And here is the code for the \code{Lua} part: the file |ex_sangaku.lua|
+
+\begin{minipage}{.5\textwidth}
+\begin{mybox}
+  \begin{Verbatim}
+  z.A         = point : new ( 0,0 ) 
+  z.B         = point : new ( 8,0 )
+  L.AB        = line : new ( z.A , z.B )
+  S           = L.AB : square ()
+  _,_,z.C,z.D = get_points (S)
+  z.F         = S.ac : projection (z.B)
+  L.BF        = line : new (z.B,z.F)
+  T.ABC       = triangle : new ( z.A , z.B , z.C )
+  L.bi        = T.ABC : bisector (2)
+  z.c         = L.bi.pb
+  L.Cc        = line : new (z.C,z.c)
+  z.I         = intersection (L.Cc,L.BF)
+  \end{Verbatim}
+\end{mybox}
+\end{minipage}
+
 \subsection{Scale problem} % (fold)
 \label{sub:scale_problem}
 

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-presentation.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-presentation.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-presentation.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -186,7 +186,7 @@
    C.ins    = T.ABC: in_circle ()         % we get the incircle of this triangle
    z.I      = C.ins.center                % center is an attribute of the circle
    z.T      = C.ins.through               % through is also an attribute
-   -- z.I,z.T  = get_points (C.ins)       % get_points is a shortcut
+  %  z.I,z.T  = get_points (C.ins)        % get_points is a shortcut
    C.cir    = T.ABC : circum_circle ()    % we get the  circumscribed circle
    z.W      = C.cir.center                % we get the center of this circle   
    z.O      = C.cir.south                 % now we get the south pole of this circle
@@ -228,7 +228,8 @@
 \tkzLabelPoints[above](A)
 \end{tikzpicture}
 \hspace*{\fill}
-%
+
+\vspace{12pt}
 Here's the tikzpicture environment to obtain the drawing:
 \begin{Verbatim}
 \begin{tikzpicture}

Added: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-theorems.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-theorems.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-theorems.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -0,0 +1,747 @@
+\newpage
+
+\section{Some theorems} % (fold)
+\label{sec:some_theorems}
+
+\subsection{Viviani's Theorem} % (fold)
+\label{sub:viviani_s_theorem}
+Viviani's theorem, named after Vincenzo Viviani, states that the sum of the shortest distances from any interior point to the sides of an equilateral triangle equals the length of the triangle's altitude.
+[Wikipedia].
+
+Here's the visual demonstration I gave at the CAPES oral exam in 1989 to become a teacher.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A     = point: new (0 , 0)
+z.B     = point: new (8 , 0)
+L.AB    = line: new (z.A,z.B)
+T.equ   = L.AB:equilateral ()
+z.C     = T.equ.pc
+z.I     = point:new (3,2)
+L.IAB   = T.equ.ab:ll_from(z.I)
+L.IBC   = T.equ.bc:ll_from(z.I)
+L.ICA   = T.equ.ca:ll_from(z.I)
+z.b     = intersection(L.IAB,T.equ.ca)
+z.a     = intersection(L.IAB,T.equ.bc)
+z.c     = intersection(L.IBC,T.equ.ab)
+z.d     = intersection(L.IBC,T.equ.ca)
+z.e     = intersection(L.ICA,T.equ.ab)
+z.f     = intersection(L.ICA,T.equ.bc)
+L.last  = T.equ.ab:ll_from(z.f)
+z.g     = intersection(L.last,T.equ.ca)
+z.pC    = L.last:projection(z.C)
+z.pIca  = T.equ.ca:projection(z.I)
+z.pIbc  = T.equ.bc:projection(z.I)
+z.pIAB  = L.IAB:projection(z.f)
+z.pIab  = T.equ.ab:projection(z.I)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawSegments(a,b c,d e,f f,g)
+\tkzDrawSegments[red,thick](C,pC I,pIab f,pIAB)
+\tkzDrawSegments[red, dashed](I,pIbc I,pIca)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A     = point: new (0 , 0)
+z.B     = point: new (8 , 0)
+L.AB    = line: new (z.A,z.B)
+T.equ   = L.AB:equilateral ()
+z.C     = T.equ.pc
+z.I     = point:new (3,2)
+L.IAB   = T.equ.ab:ll_from(z.I)
+L.IBC   = T.equ.bc:ll_from(z.I)
+L.ICA   = T.equ.ca:ll_from(z.I)
+z.b     = intersection(L.IAB,T.equ.ca)
+z.a     = intersection(L.IAB,T.equ.bc)
+z.c     = intersection(L.IBC,T.equ.ab)
+z.d     = intersection(L.IBC,T.equ.ca)
+z.e     = intersection(L.ICA,T.equ.ab)
+z.f     = intersection(L.ICA,T.equ.bc)
+L.last  = T.equ.ab:ll_from(z.f)
+z.g     = intersection(L.last,T.equ.ca)
+z.pC    = L.last:projection(z.C)
+z.pIca  = T.equ.ca:projection(z.I)
+z.pIbc  = T.equ.bc:projection(z.I)
+z.pIAB  = L.IAB:projection(z.f)
+z.pIab  = T.equ.ab:projection(z.I)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawSegments(a,b c,d e,f f,g)
+\tkzDrawSegments[red,thick](C,pC I,pIab f,pIAB)
+\tkzDrawSegments[red, dashed](I,pIbc I,pIca)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection viviani_s_theorem (end)
+
+
+\subsection{Reuschle's theorem} % (fold)
+\label{sub:reuschle_s_theorem}
+In elementary geometry, Reuschle's theorem describes a property of the cevians of a triangle intersecting in a common point and is named after the German mathematician Karl Gustav Reuschle (1812–1875). It is also known as Terquem's theorem after the French mathematician Olry Terquem (1782–1862), who published it in 1842.
+
+\vspace{6pt}
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+z.A    = point:new(0, 0)
+z.B    = point:new(8, 0)
+z.C    = point:new(5, 5)
+z.P    = point:new(4, 2)
+T.ABC  = triangle:new(z.A,z.B,z.C)
+T.cev  = T.ABC:cevian (z.P)
+z.D,
+z.E,
+z.F    = get_points(T.cev)
+C.cev  = T.ABC :cevian_circle (z.P)
+z.O    = C.cev.center
+z.T    = C.cev.through
+z.G    = intersection(C.cev,T.ABC.ca)
+_,z.H  = intersection(C.cev,T.ABC.ab)
+z.I    = intersection(C.cev,T.ABC.bc)
+L.AI   = line:new(z.A,z.I)
+L.BG   = line:new(z.B,z.G)
+z.K    = intersection(L.AI,L.BG)
+}    
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawPoints(A,...,I,P,K)
+\tkzDrawSegments(A,D B,E C,F A,I B,G C,H)
+\tkzDrawCircle(O,T)
+\tkzLabelPoints[below](A,B)
+\tkzLabelPoints[above](C,I,E,D,G,K)
+\tkzLabelPoints[below](F,P,H)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 5  , 5  )
+z.P    = point : new ( 4  , 2  )
+T.ABC  = triangle : new (z.A,z.B,z.C)
+T.cev  = T.ABC : cevian (z.P)
+z.D,
+z.E,
+z.F    = get_points(T.cev)
+C.cev  = T.ABC :cevian_circle (z.P)
+z.O    = C.cev.center
+z.T    = C.cev.through
+z.G    = intersection(C.cev,T.ABC.ca)
+_,z.H  = intersection(C.cev,T.ABC.ab)
+z.I    = intersection(C.cev,T.ABC.bc)
+L.AI   = line:new(z.A,z.I)
+L.BG   = line:new(z.B,z.G)
+z.K    = intersection(L.AI,L.BG)
+}    
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawPoints(A,...,I,P,K)
+\tkzDrawSegments(A,D B,E C,F A,I B,G C,H)
+\tkzDrawCircle(O,T)
+\tkzLabelPoints[below](A,B)
+\tkzLabelPoints[above](C,I,E,D,G,K)
+\tkzLabelPoints[below](F,P,H)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection reuschle_s_theorem (end)
+
+\subsection{Thébault's problem III} % (fold)
+\label{sub:thebault_s_problemIII}
+Given any triangle ABC, and any point M on BC, construct the incircle and circumcircle of the triangle. Then construct two additional circles, each tangent to AM, BC, and to the circumcircle. Then their centers and the center of the incircle are collinear.[wikipedia]
+\vspace{6pt}
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A    = point : new(0, 0)
+z.B    = point : new(8, 0)
+z.C    = point : new(1, 6)
+z.M    = point : new(5, 0)
+L.CM   = line:new(z.C,z.M)
+T.ABC  = triangle:new(z.A,z.B,z.C)
+C.circ = T.ABC:circum_circle()
+z.O    = C.circ.center
+C.ins  =  T.ABC:in_circle()
+z.I    = C.ins.center
+z.T    = C.ins.through
+L.ll   = T.ABC.ab: ll_from(z.I)
+z.Q    = intersection(L.ll,L.CM)
+C.QI   = circle:new(z.Q,z.I)
+z.R,z.S= intersection(C.QI,L.CM)
+L.BMC  = bisector(z.M,z.B,z.C)
+z.x    = L.BMC.pb
+L.CMA  = bisector(z.M,z.C,z.A)
+z.y    = L.CMA.pb
+L.pS   = L.CM:ortho_from(z.S)
+L.pR   = L.CM:ortho_from(z.R)
+z.J    = intersection(L.pS,L.CMA)
+z.K    = intersection(L.pR,L.BMC)
+}  
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawSegments(C,M)
+\tkzDrawLines(J,K I,Q)
+\tkzDrawCircles(O,A I,T Q,I J,S K,R)
+\tkzDrawPoints(A,B,C,M,Q,I,R,S,J,K)
+\tkzLabelPoints(A,B,C,M,Q,I,R,S,J,K)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new  (1  , 6  )
+z.M    = point : new  (5  , 0  )
+L.CM = line:new(z.C,z.M)
+T.ABC  = triangle:new(z.A,z.B,z.C)
+C.circ = T.ABC:circum_circle()
+z.O    = C.circ.center
+C.ins  =  T.ABC:in_circle()
+z.I    = C.ins.center
+z.T    = C.ins.through
+L.ll = T.ABC.ab: ll_from(z.I)
+z.Q =intersection(L.ll,L.CM)
+C.QI = circle:new(z.Q,z.I)
+z.R,z.S = intersection(C.QI,L.CM)
+L.BMC = bisector(z.M,z.B,z.C)
+z.x = L.BMC.pb
+L.CMA = bisector(z.M,z.C,z.A)
+z.y = L.CMA.pb
+L.pS = L.CM:ortho_from(z.S)
+L.pR = L.CM:ortho_from(z.R)
+z.J = intersection(L.pS,L.CMA)
+z.K = intersection(L.pR,L.BMC)
+}  
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawSegments(C,M)
+\tkzDrawLines(J,K I,Q)
+\tkzDrawCircles(O,A I,T Q,I J,S K,R)
+\tkzDrawPoints(A,B,C,M,Q,I,R,S,J,K)
+\tkzLabelPoints(A,B,C,M,Q,I,R,S,J,K)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection thebault_s_problemIII (end)
+
+\subsection{Thebault's problem II} % (fold)
+\label{sub:thebault_s_problemII}
+
+Given a square, construct equilateral triangles on two adjacent edges, either both inside or both outside the square. Then the triangle formed by joining the vertex of the square distant from both triangles and the vertices of the triangles distant from the square is equilateral.[wikipedia]
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new (  0 , 0  )
+z.B = point : new (  8 , 0 )
+L.AB = line:new (z.A,z.B)
+S.ABCD = L.AB:square() 
+z.C = S.ABCD.pc
+z.D = S.ABCD.pd
+z.E = S.ABCD.ab:equilateral().pc
+z.F = S.ABCD.bc:equilateral().pc
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPolygons[cyan](A,B,E B,C,F)
+\tkzFillPolygon[fill=orange!20](D,E,F)
+\tkzDrawPolygons[orange,thick](D,E,F)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new (  0 , 0  )
+z.B = point : new (  8 , 0 )
+L.AB = line:new (z.A,z.B)
+S.ABCD = L.AB:square() 
+z.C = S.ABCD.pc
+z.D = S.ABCD.pd
+z.E = S.ABCD.ab:equilateral().pc
+z.F = S.ABCD.bc:equilateral().pc
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPolygons[cyan](A,B,E B,C,F)
+\tkzFillPolygon[fill=orange!20](D,E,F)
+\tkzDrawPolygons[orange,thick](D,E,F)
+\end{tikzpicture}
+\end{minipage}
+
+
+% subsection thebault_s_problemII (end)
+
+\subsection{Varignon's Theorem} % (fold)
+\label{sub:varignon_s_theorem}
+In Euclidean geometry, Varignon's theorem holds that the midpoints of the sides of an arbitrary quadrilateral form a parallelogram, called the Varignon parallelogram. It is named after Pierre Varignon, whose proof was published posthumously in 1731. [Wikipedia]
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A    = point : new ( 0 , 0 )
+z.B    = point : new ( 0 , 8 )
+z.C    = point : new ( 5 , 3 )
+z.D    = point : new ( -1 , 6 )
+Q.ABCD = quadrilateral:new(z.A, z.B, z.C, z.D)
+z.E,z.F,z.G,z.H = midpoints(z.A,z.B,z.C,z.D)
+  }
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPolygon[red](E,F,G,H)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzDrawPoints[red](E,F,G,H)
+ \tkzLabelPoints(A,C)
+ \tkzLabelPoints[above right](B,D)
+ \tkzLabelPoints[red](G,H)
+ \tkzLabelPoints[red,above right](E,F)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A    = point : new ( 0 , 0 )
+z.B    = point : new ( 0 , 8 )
+z.C    = point : new ( 5 , 3 )
+z.D    = point : new ( -1 , 6 )
+Q.ABCD = quadrilateral:new(z.A, z.B, z.C, z.D)
+z.E,z.F,z.G,z.H = midpoints(z.A,z.B,z.C,z.D)
+}
+\begin{center}
+  \begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawPolygon(A,B,C,D)
+  \tkzDrawPolygon[red](E,F,G,H)
+  \tkzDrawPoints(A,B,C,D)
+  \tkzDrawPoints[red](E,F,G,H)
+  \tkzLabelPoints(A,C)
+  \tkzLabelPoints[above right](B,D)
+  \tkzLabelPoints[red](G,H)
+  \tkzLabelPoints[red,above right](E,F)
+  \end{tikzpicture}
+\end{center}
+
+\end{minipage}
+
+% subsection varignon_s_theorem (end)
+
+
+\subsection{Wittenbauer's Parallelogram} % (fold)
+\label{sub:wittenbauer_s_parallelogram}
+
+Divide the sides of a quadrilateral into three equal parts. The figure formed by connecting and extending adjacent points on either side of a polygon vertex is a parallelogram known as Wittenbauer's parallelogram.
+[\href{https://mathworld.wolfram.com/WittenbauersParallelogram.html}{Weisstein, Eric W. "Wittenbauer's Parallelogram." From MathWorld--A Wolfram Web Resource.}]
+
+\vspace{6pt}
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A    = point : new ( 0 , 0 )
+z.B    = point : new ( 4 , 0 )
+z.C    = point : new ( 5 , 3 )
+z.D    = point : new ( -1 , 4 )
+Q.ABCD = quadrilateral:new (z.A, z.B, z.C, z.D)
+z.P_1  = Q.ABCD.ab:point(1/3)
+z.P_2  = Q.ABCD.ab:point(2/3)
+z.P_3  = Q.ABCD.bc:point(1/3)
+z.P_4  = Q.ABCD.bc:point(2/3)
+z.P_5  = Q.ABCD.cd:point(1/3)
+z.P_6  = Q.ABCD.cd:point(2/3)
+z.P_7  = Q.ABCD.da:point(1/3)
+z.P_8  = Q.ABCD.da:point(2/3)
+L.P18  = line:new(z.P_1,z.P_8)
+L.P23  = line:new(z.P_2,z.P_3)
+L.P45  = line:new(z.P_4,z.P_5)
+L.P67  = line:new(z.P_6,z.P_7)
+z.K    = intersection(L.P18,L.P23)
+z.L    = intersection(L.P23,L.P45)
+z.M    = intersection(L.P45,L.P67)
+z.N    = intersection(L.P67,L.P18)
+}
+\begin{tikzpicture}
+  \tkzGetNodes
+  \tkzDrawPolygon(A,B,C,D)
+  \tkzDrawPolygon[red](K,L,M,N)
+  \tkzDrawSegments(A,C B,D)
+  \tkzDrawPoints(A,B,C,D)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A      = point : new ( 0 , 0 )
+z.B      = point : new ( 4 , 0 )
+z.C      = point : new ( 5 , 3 )
+z.D      = point : new ( -1 , 4 )
+Q.ABCD   = quadrilateral : new ( z.A , z.B , z.C , z.D )
+z.P_1    = Q.ABCD.ab:point(1/3)
+z.P_2    = Q.ABCD.ab:point(2/3)
+z.P_3    = Q.ABCD.bc:point(1/3)
+z.P_4    = Q.ABCD.bc:point(2/3)
+z.P_5    = Q.ABCD.cd:point(1/3)
+z.P_6    = Q.ABCD.cd:point(2/3)
+z.P_7    = Q.ABCD.da:point(1/3)
+z.P_8    = Q.ABCD.da:point(2/3)
+L.P18    = line:new(z.P_1,z.P_8)
+L.P23    = line:new(z.P_2,z.P_3)
+L.P45    = line:new(z.P_4,z.P_5)
+L.P67    = line:new(z.P_6,z.P_7)
+z.K      = intersection(L.P18,L.P23)
+z.L      = intersection(L.P23,L.P45)
+z.M      = intersection(L.P45,L.P67)
+z.N      = intersection(L.P67,L.P18)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPolygon[red](K,L,M,N)
+\tkzDrawSegments(A,C B,D)
+\tkzDrawPoints(A,B,C,D)
+\end{tikzpicture}
+\end{minipage}
+% subsection wittenbauer_s_parallelogram (end)
+
+\subsection{Soddy circles of a triangle} % (fold)
+\label{sub:soddy_circles_of_a_triangle}
+
+In geometry, the Soddy circles of a triangle are two circles associated with any triangle in the plane.[wikipedia]
+
+ Given three noncollinear points, construct three tangent circles such that one is centered at each point and the circles are pairwise tangent to one another. Then there exist exactly two nonintersecting circles that are tangent to all three circles. These are called the inner and outer Soddy circles, and their centers are called the inner and outer Soddy centers, respectively.
+
+[\href{https://mathworld.wolfram.com/SoddyCircles.html}{ Weisstein, Eric W. "Soddy Circles." From MathWorld--A Wolfram Web Resource}]
+
+
+\subsubsection{Soddy circle without function} % (fold)
+\label{ssub:soddy}
+
+\begin{Verbatim}
+\directlua{%
+init_elements ()
+z.A = point : new ( 0  , 0  )
+z.B = point : new ( 5  , 0  )
+z.C = point : new ( 0.5 ,  4  )
+T.ABC = triangle : new ( z.A,z.B,z.C )
+z.I = T.ABC.incenter
+z.E,z.F,z.G = T.ABC : projection (z.I)
+C.ins = circle : new (z.I,z.E)
+T.orthic = T.ABC : orthic ()
+z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+C.CF = circle : new ( z.C , z.F )
+C.AG = circle : new ( z.A , z.G )
+C.BE = circle : new ( z.B , z.E )
+L.Ah = line : new ( z.A , z.Ha )
+L.Bh = line : new ( z.B , z.Hb )
+L.Ch = line : new ( z.C , z.Hc )
+z.X,z.Xp = intersection (L.Ah,C.AG)
+z.Y,z.Yp = intersection (L.Bh,C.BE)
+z.Z,z.Zp = intersection (L.Ch,C.CF)
+L.XpE = line   : new (z.Xp,z.E)
+L.YpF = line   : new (z.Yp,z.F)
+L.ZpG = line   : new (z.Zp,z.G)
+z.S = intersection (L.XpE,L.YpF)
+z.Xi = intersection(L.XpE,C.AG)
+z.Yi = intersection(L.YpF,C.BE)
+_,z.Zi = intersection(L.ZpG,C.CF)
+z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
+C.soddy_int = circle : new (z.S,z.Xi)
+C.soddy_ext = C.ins : inversion (C.soddy_int)
+z.w = C.soddy_ext.center
+z.s = C.soddy_ext.through
+z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
+\tkzDrawPoints(Xi',Yi',Zi',S)
+\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
+\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
+\tkzDrawLines(X',Ha Y',Hb Z',Hc)
+\tkzDrawLines(X',E Y',F Z',G)
+\end{tikzpicture}
+\end{Verbatim}
+
+\directlua{%
+init_elements ()
+z.A = point : new ( 0  , 0  )
+z.B = point : new ( 5  , 0  )
+z.C = point : new ( 0.5 ,  4  )
+T.ABC = triangle : new ( z.A,z.B,z.C )
+z.I = T.ABC.incenter
+z.E,z.F,z.G = T.ABC : projection (z.I)
+C.ins = circle : new (z.I,z.E)
+T.orthic = T.ABC : orthic ()
+z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+C.CF = circle : new ( z.C , z.F )
+C.AG = circle : new ( z.A , z.G )
+C.BE = circle : new ( z.B , z.E )
+L.Ah = line : new ( z.A , z.Ha )
+L.Bh = line : new ( z.B , z.Hb )
+L.Ch = line : new ( z.C , z.Hc )
+z.X,z.Xp = intersection (L.Ah,C.AG)
+z.Y,z.Yp = intersection (L.Bh,C.BE)
+z.Z,z.Zp = intersection (L.Ch,C.CF)
+L.XpE = line   : new (z.Xp,z.E)
+L.YpF = line   : new (z.Yp,z.F)
+L.ZpG = line   : new (z.Zp,z.G)
+z.S = intersection (L.XpE,L.YpF)
+z.Xi = intersection(L.XpE,C.AG)
+z.Yi = intersection(L.YpF,C.BE)
+_,z.Zi = intersection(L.ZpG,C.CF)
+z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
+C.soddy_int = circle : new (z.S,z.Xi)
+C.soddy_ext = C.ins : inversion (C.soddy_int)
+z.w = C.soddy_ext.center
+z.s = C.soddy_ext.through
+z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
+\tkzDrawPoints(Xi',Yi',Zi',S)
+\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
+\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
+\tkzDrawLines(X',Ha Y',Hb Z',Hc)
+\tkzDrawLines(X',E Y',F Z',G)
+\end{tikzpicture}
+% subsubsection soddy (end)
+
+\subsubsection{Soddy circle with function} % (fold)
+\label{ssub:soddy_circle_with_function}
+
+\directlua{%
+init_elements ()
+z.A = point : new ( 0  , 0  )
+z.B = point : new ( 5  , 0  )
+z.C = point : new (4 ,  4  )
+T.ABC = triangle : new ( z.A,z.B,z.C )
+z.I = T.ABC.incenter
+z.E,z.F,z.G = T.ABC : projection (z.I)
+T.orthic = T.ABC : orthic ()
+z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+C.ins = circle : new (z.I,z.E)
+z.s,z.xi,z.yi,z.zi = T.ABC : soddy_center ()
+C.soddy_int = circle : new (z.s,z.xi)
+C.soddy_ext = C.ins : inversion (C.soddy_int)
+z.w = C.soddy_ext.center
+z.t = C.soddy_ext.through
+z.Xip,z.Yip,z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
+}
+
+\begin{minipage}{.5\textwidth}
+  \begin{Verbatim}
+  \directlua{%
+init_elements ()
+  z.A = point : new ( 0  , 0  )
+  z.B = point : new ( 5  , 0  )
+  z.C = point : new (4 ,  4  )
+  T.ABC = triangle : new ( z.A,z.B,z.C )
+  z.I = T.ABC.incenter
+  z.E,z.F,z.G = T.ABC : projection (z.I)
+  T.orthic = T.ABC : orthic ()
+  z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+  C.ins = circle : new (z.I,z.E)
+  z.s,z.xi,z.yi,
+  z.zi = T.ABC : soddy_center ()
+  C.soddy_int = circle : new (z.s,z.xi)
+  C.soddy_ext = C.ins : inversion (C.soddy_int)
+  z.w = C.soddy_ext.center
+  z.t = C.soddy_ext.through
+  z.Xip,z.Yip,
+  z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
+  }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tikzpicture}[scale=.6]
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
+\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
+\tkzLabelPoints(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
+\tkzDrawPoints(Xi',Yi',Zi')
+\tkzLabelPoints(A,B,C,E,F,G)
+\end{tikzpicture}
+\end{minipage}
+
+\begin{Verbatim}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
+\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
+\tkzLabelPoints(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
+\tkzDrawPoints(Xi',Yi',Zi')
+\tkzLabelPoints(A,B,C,E,F,G)
+\end{tikzpicture}
+\end{Verbatim}
+% subsubsection soddy_circle_with_function (end)
+
+
+% subsection soddy_circles_of_a_triangle (end)
+
+\subsection{Six circles in a triangle} % (fold)
+\label{sub:six_circles_in_a_triangle}
+In geometry, the six circles theorem relates to a chain of six circles together with a triangle, such that each circle is tangent to two sides of the triangle and also to the preceding circle in the chain. The chain closes, in the sense that the sixth circle is always tangent to the first circle.[1][2] It is assumed in this construction that all circles lie within the triangle, and all points of tangency lie on the sides of the triangle. [Wikipedia]
+
+\vspace{6pt}
+The file \code{search\_circle.lua} used in this example:
+
+\begin{mybox}
+  \begin{Verbatim}
+  local r =...
+
+  function newcircle (T,C)
+    local NT,L,NC,c,t
+      NT    = T.incenter : homothety ((1+C.radius/T.inradius),T)
+       L    = line : new (NT.pb,NT.pa)
+      _,NC  = L :  c_ll_p(NT.pc,C.center)
+    return NC.center,T.bc:projection(NC.center)
+  end
+
+  z.A    = point : new ( 0  , 0  )
+  z.B    = point : new ( 8  , 0  )
+  z.C    = point : new ( 2  , 6  )
+  T.ABC  = triangle : new (z.A,z.B,z.C)
+  L.bA   = T.ABC : bisector ()
+  z.c1   = L.bA : report(r)
+  z.t1   = T.ABC.ab : projection(z.c1)
+  C.last  = circle : new(z.c1,z.t1)
+
+  local vertices = {"A", "B", "C"} 
+    for i = 2, 6 do
+       T.used = triangle : new(
+        z[vertices[math.fmod(i - 2, 3) + 1]],
+        z[vertices[math.fmod(i - 1, 3) + 1]],
+        z[vertices[math.fmod(i, 3) + 1]] )
+      z["c" .. i], z["t" .. i] = newcircle(T.used, C.last)
+      C.last = circle : new(z["c" .. i], z["t" .. i])
+    end
+  \end{Verbatim}
+\end{mybox}
+
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 2  , 6  )
+loadfile ("search_circle.lua")(1.4)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,%
+3/yellow,4/green,5/blue,6/violet} 
+ {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+  \tkzDrawCircle[thick,\c](c\n,t\n)}
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 2  , 6  )
+loadfile ("search_circle.lua")(1.4)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,3/yellow,4/green,5/blue,6/violet} 
+  {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+  \tkzDrawCircle[thick,\c](c\n,t\n) }
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{12pt}
+When the first circle is the incircle then you get only 4 circles.
+
+\begin{minipage}{.5\textwidth}
+\begin{mybox}
+  \begin{Verbatim}
+  T.ABC  = triangle : new (z.A,z.B,z.C)
+  R = T.ABC.inradius/math.sin((T.ABC.alpha)/2)
+    loadfile ("search_circle.lua")(R)
+    }
+  \end{Verbatim}
+\end{mybox}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+scale =1.5
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 2  , 6  )
+T.ABC  = triangle : new (z.A,z.B,z.C)
+R = T.ABC.inradius/math.sin((T.ABC.alpha)/2)
+  loadfile ("search_circle.lua")(R)
+  }
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,3/yellow,4/green,5/blue,6/violet} 
+  {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+  \tkzDrawCircle[thick,\c](c\n,t\n) }
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{minipage}
+
+
+% subsection six_circles_in_a_triangle (end)
+% section some_theorems (end)
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-theorems.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-transfers.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-transfers.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-transfers.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -116,18 +116,18 @@
 \begin{minipage}{0.5\textwidth}
 \begin{Verbatim}
 \directlua{
-   init_elements ()
-   z.b = point:  new (1,1)
-   z.a = point:  new (4,2)
-   z.c = point:  new (2,2)
-   z.d = point:  new (5,1)
-   L.ab = line : new (z.a,z.b)
-   L.cd = line : new (z.c,z.d)
-    det = (z.b-z.a)^(z.d-z.c)
-    if det == 0 then bool = true 
-      else bool = false
-    end
-    x = intersection (L.ab,L.cd)
+ init_elements ()
+ z.b = point:  new (1,1)
+ z.a = point:  new (4,2)
+ z.c = point:  new (2,2)
+ z.d = point:  new (5,1)
+ L.ab = line : new (z.a,z.b)
+ L.cd = line : new (z.c,z.d)
+  det = (z.b-z.a)^(z.d-z.c)
+  if det == 0 then bool = true 
+    else bool = false
+  end
+  x = intersection (L.ab,L.cd)
 }
 The intersection of the two lines lies at
     a point whose affix is:\tkzUseLua{x}
@@ -295,6 +295,7 @@
 This time, the transfer will be carried out using an external file. The following example is based on this one, but using a table.
 
 \directlua{
+init_elements()
    z.a   = point: new (1,0) 
    z.b   = point: new (3,2) 
    z.c   = point: new (0,2)
@@ -314,6 +315,7 @@
 \begin{minipage}{0.5\textwidth}
 \begin{Verbatim}
 \directlua{
+  init_elements()
    z.a   = point: new (1,0) 
    z.b   = point: new (3,2) 
    z.c   = point: new (0,2)
@@ -331,7 +333,7 @@
  }
 \begin{tikzpicture}
    \tkzGetNodes
-   \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=6]
+   \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=5]
    \tkzDrawX\tkzDrawY
    \tkzDrawPoints[red,size=2](a,b,c)
    \directlua{f(-1,3,100)}%
@@ -340,14 +342,17 @@
 \end{Verbatim}
 \end{minipage}
 \begin{minipage}{0.5\textwidth}
-\begin{tikzpicture}
-   \tkzGetNodes
-   \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=6]
-   \tkzDrawX\tkzDrawY
-   \tkzDrawPoints[red,size=2](a,b,c)
-   \directlua{f(-1,3,100)}%
-   \draw[domain=-1:3] plot[smooth] file {tmp.table};
-\end{tikzpicture}
+\begin{center}
+  \begin{tikzpicture}
+     \tkzGetNodes
+     \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=5]
+     \tkzDrawX\tkzDrawY
+     \tkzDrawPoints[red,size=2](a,b,c)
+     \directlua{f(-1,3,100)}%
+     \draw[domain=-1:3] plot[smooth] file {tmp.table};
+  \end{tikzpicture}
+\end{center}
+
 \end{minipage}
 % subsubsection example_3 (end)
 

Added: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/search_circle.lua
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/search_circle.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/search_circle.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -0,0 +1,29 @@
+-- search_circle.lua
+local r =...
+
+function newcircle (T,C)
+  local NT,L,NC,c,t
+    NT    = T.incenter : homothety ((1+C.radius/T.inradius),T)
+     L    = line : new (NT.pb,NT.pa)
+    _,NC  = L :  c_ll_p(NT.pc,C.center)
+  return NC.center,T.bc:projection(NC.center)
+end
+
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 2  , 6  )
+T.ABC  = triangle : new (z.A,z.B,z.C)
+L.bA   = T.ABC : bisector ()
+z.c1   = L.bA : report(r)
+z.t1   = T.ABC.ab : projection(z.c1)
+C.last  = circle : new(z.c1,z.t1)
+
+local vertices = {"A", "B", "C"} 
+  for i = 2, 6 do
+     T.used = triangle : new(
+      z[vertices[math.fmod(i - 2, 3) + 1]],
+      z[vertices[math.fmod(i - 1, 3) + 1]],
+      z[vertices[math.fmod(i, 3) + 1]] )
+    z["c" .. i], z["t" .. i] = newcircle(T.used, C.last)
+    C.last = circle : new(z["c" .. i], z["t" .. i])
+  end


Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/search_circle.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_1.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_1.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -5,7 +5,7 @@
 \usepackage{tkz-elements}
 \begin{document}
 
-\begin{tkzelements}
+\directlua{
    z.A      = point: new (0 , 0)
    z.B      = point: new (10 , 0)
    L.AB     = line:  new ( z.A, z.B)
@@ -30,7 +30,7 @@
    _,z.P_2  = intersection (C.QA,C.CB)
    T        = triangle: new ( z.P_0, z.P_1, z.P_2)
    z.O_3    = T.circumcenter
-\end{tkzelements}
+}
 
 \begin{tikzpicture}
   \tkzGetNodes

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_2.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_2.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -7,7 +7,7 @@
 
  The Feuerbach triangle is the triangle formed by the three points of tangency of the nine-point circle with the excircles    
 
-\begin{tkzelements}
+\directlua{
   scale           = .6
   z.A             = point: new (0,0)
   z.B             = point: new (6,0)
@@ -26,7 +26,7 @@
   C.apo           = C.ortho : inversion (C.euler)
   z.O             = C.apo.center
   z.xa,z.xb,z.xc  = C.ortho : inversion (z.Ea,z.Eb,z.Ec)
-\end{tkzelements}
+}
 
 \vspace*{2em}
 \hfill

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_3.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_3.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_3.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -5,7 +5,7 @@
 \usepackage{tkz-elements}
 \begin{document}
 
-\begin{tkzelements}
+\directlua{
    scale = 2
    z.A                  = point: new (0 , 0)
    z.B                  = point: new (5 , 1)
@@ -42,7 +42,7 @@
    _,z.V                = intersection (L.YO,E)
    _,z.W                = intersection (L.ZO,E)
     set_lua_to_tex {'a','b','ang'} 
- \end{tkzelements}
+ }
 
 \begin{tikzpicture}
    \tkzGetNodes
@@ -50,13 +50,14 @@
    \tkzDrawCircles[red](N,Ma O,A)
    \tkzDrawSegments(A,X B,Y C,Z B,Hb C,Hc X,O Y,O Z,O)
    \tkzDrawPolygon[red](U,V,W)
-   \tkzLabelPoints[red](U,V,W)
-   \tkzLabelPoints(A,B,C,X,Y,Z)
    \tkzDrawLine[blue](I,J)
-   \tkzLabelPoints[blue,right](O,N,G,H,I,J)
    \tkzDrawPoints(I,J,U,V,W)
    \tkzDrawPoints(A,B,C,N,G,H,O,X,Y,Z,Ma,Mb,Mc,Ha,Hb,Hc)
    \tkzDrawEllipse[blue](N,\a,\b,\ang)
+   \tkzLabelPoints[blue,right](O,N,G,H,I,J)
+   \tkzLabelPoints[red](U,V,W)
+   \tkzLabelPoints(A,B,Z)
+   \tkzLabelPoints[above](C,X,Y)
 \end{tikzpicture}
 \end{document}
 

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_4.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_4.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_4.tex	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_4.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -7,7 +7,7 @@
 \usepackage{tkz-elements}
 \begin{document} 
     
-\begin{tkzelements}
+\directlua{
    scale       = 2
    z.A         = point: new(0,0)
    z.B         = point: new(5,0)
@@ -17,13 +17,14 @@
    z.E,z.F,z.G = get_points (T.EFG)
    z.S         = T.ABC: medial (): circum_circle ().south
    z.O         = T.ABC: medial ().circumcenter
-\end{tkzelements}
+}
 \begin{tikzpicture}
    \tkzGetNodes
    \tkzDrawPolygons(A,B,C E,F,G)
    \tkzDrawCircle(O,E)
    \tkzDrawPoints(A,B,C,O,S,E,F,G)
-   \tkzLabelPoints(A,B,O,S,E,F,G)
+   \tkzLabelPoints(A,B,O,S,G)
+   \tkzLabelPoints[above](E,F)
    \tkzLabelPoints[above](C)
 \end{tikzpicture}
 

Added: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.pdf	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.pdf	2025-01-07 21:02:07 UTC (rev 73346)

Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.tex	2025-01-07 21:02:07 UTC (rev 73346)
@@ -0,0 +1,28 @@
+% !TEX TS-program = lualatex
+% Created by Alain Matthes on 2024-12-25.
+% Copyright (c) 2024 AlterMundus.
+\documentclass[margin = 12pt]{standalone} 
+\usepackage{tkz-euclide}
+\usepackage{tkz-elements}
+
+\begin{document} 
+
+\directlua{
+init_elements ()
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 2  , 6  )
+loadfile ("search_circle.lua")(1.4)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,3/yellow,4/green,5/blue,6/violet} 
+  {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+  \tkzDrawCircle[thick,\c](c\n,t\n) }
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-elements/examples/tkz-elements-demo_5.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tkz-elements/search_circle.lua
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-elements/search_circle.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tkz-elements/search_circle.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -0,0 +1,29 @@
+-- search_circle.lua
+local r =...
+
+function newcircle (T,C)
+  local NT,L,NC,c,t
+    NT    = T.incenter : homothety ((1+C.radius/T.inradius),T)
+     L    = line : new (NT.pb,NT.pa)
+    _,NC  = L :  c_ll_p(NT.pc,C.center)
+  return NC.center,T.bc:projection(NC.center)
+end
+
+z.A    = point : new ( 0  , 0  )
+z.B    = point : new ( 8  , 0  )
+z.C    = point : new ( 2  , 6  )
+T.ABC  = triangle : new (z.A,z.B,z.C)
+L.bA   = T.ABC : bisector ()
+z.c1   = L.bA : report(r)
+z.t1   = T.ABC.ab : projection(z.c1)
+C.last  = circle : new(z.c1,z.t1)
+
+local vertices = {"A", "B", "C"} 
+  for i = 2, 6 do
+     T.used = triangle : new(
+      z[vertices[math.fmod(i - 2, 3) + 1]],
+      z[vertices[math.fmod(i - 1, 3) + 1]],
+      z[vertices[math.fmod(i, 3) + 1]] )
+    z["c" .. i], z["t" .. i] = newcircle(T.used, C.last)
+    C.last = circle : new(z["c" .. i], z["t" .. i])
+  end


Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-elements/search_circle.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/tkz-elements/tkz-elements.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz-elements.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz-elements.sty	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz-elements.sty	2025-01-07 21:02:07 UTC (rev 73346)
@@ -11,14 +11,15 @@
 % This work has the LPPL maintenance status “maintained”.
 % The Current Maintainer of this work is Alain Matthes.
 
-\ProvidesPackage{tkz-elements}[2024/07/16 version 3.00 Graphic Object Library]
+\ProvidesPackage{tkz-elements}[2025/01/06 version 3.10 Graphic Object Library]
 %\RequirePackage{luacode}
 
  \directlua{
       require "tkz_elements_main"
-      tkz_epsilon=1e-8
-      tkz_dc=2
-      indirect = true
+      tkz_epsilon  = 1e-8
+      tkz_dc       = 2
+      indirect     = true
+      inside       = true
       init_elements()}%
       
 \newenvironment{tkzelements}
@@ -52,7 +53,7 @@
  tex.sprint("\string\\coordinate ("..K..") at ("..V.re..","..V.im..") ; \string\r")
 end}}
 
-\def\tkzUseLua#1{\directlua{tex.print(tostring(#1))}} 
+\def\tkzUseLua#1{\directlua{tex.print(#1)}} 
 \makeatletter
 \def\tkzDrawLuaEllipse{\pgfutil at ifnextchar[{\tkz at DrawLuaEllipse}{\tkz at DrawLuaEllipse[]}}
 \def\tkz at DrawLuaEllipse[#1](#2,#3,#4){% 
@@ -67,6 +68,7 @@
 \pgfmathprintnumber{#2}
 \endgroup
 }
+\let\percentchar\@percentchar
 
 \makeatother
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements-circles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -24,6 +24,8 @@
    local east              = c + point (radius,0)
    local north             = c + point (0,radius)
    local west              = c - point (radius,0)
+   local perimeter         = 2*math.pi*radius
+   local area              = 4*math.pi*radius*radius
    local o = { center      = c, 
                through     = t, 
                ct          = ct,
@@ -33,7 +35,9 @@
                east        = east,
                north       = north,
                west        = west,
-               type        = type}
+               type        = type,
+               perimeter   = perimeter,
+               area        = area}
    setmetatable(o, self)
    self.__index = self
    return o
@@ -51,26 +55,12 @@
 -----------------------
 -- boolean --
 -----------------------
-function circle: in_out (pt)
-    local d
-    d = point.abs (pt - self.center)
-    if math.abs(d-self.radius) < tkz_epsilon
-     then
-       return true
-    else
-       return false
-    end
+function circle:in_out(pt)
+    return math.abs(point.abs(pt - self.center) - self.radius) < tkz_epsilon
 end
 
-function circle: in_out_disk (pt)
-    local d
-    d = point.abs (pt - self.center)
-    if d <= self.radius
-     then
-       return true
-    else
-       return false
-    end
+function circle:in_out_disk(pt)
+    return point.abs(pt - self.center) <= self.radius
 end
 
 -- new version 1.80 added 
@@ -78,6 +68,16 @@
    return circles_position_ (self.center,self.radius,C.center,C.radius)
 end
 
+function circle:is_tangent(l)
+  local a, b = intersection(self, l)
+  -- Checks whether the intersection produces valid points
+  if not a or not b then
+    return false
+  end
+  -- Checks whether the distance between the two intersection points is less than a given tolerance
+  return (point.abs(b - a) < tkz_epsilon)
+end
+
 -----------------------
 -- real --
 -----------------------
@@ -131,59 +131,64 @@
 -----------------------
 -- lines --
 -----------------------
-function circle: tangent_at (pt)
-    return line : new ( rotation_ (pt,math.pi/2,self.center),rotation_ (pt,-math.pi/2,self.center))
+function circle:tangent_at(pt)
+    return line:new(
+        rotation_(pt, math.pi / 2, self.center), 
+        rotation_(pt, -math.pi / 2, self.center)
+    )
+end
+
+ 
+ function circle:tangent_from(pt)
+     local t1, t2 = tangent_from_(self.center, self.through, pt)
+     return line:new(pt, t1), line:new(pt, t2)
  end
  
-function circle: tangent_from (pt)
-   local t1,t2
-   t1,t2 = tangent_from_ (self.center,self.through,pt) 
-    return line :new (pt,t1),line : new (pt,t2)
+ function circle:radical_axis(C)
+     local t1, t2
+     if self.radius > C.radius then
+         t1, t2 = radical_axis_(self.center, self.through, C.center, C.through)
+     else
+         t1, t2 = radical_axis_(C.center, C.through, self.center, self.through)
+     end
+     return line:new(t1, t2)
  end
 
- function circle: radical_axis (C)
-    local t1,t2
-    if self.radius > C.radius then
-    t1,t2 = radical_axis_ (self.center,self.through,C.center,C.through)
- else
-    t1,t2 = radical_axis_ (C.center,C.through,self.center,self.through)
- end
-  return line :new (t1,t2)
- end
  
-function circle: radical_center (C1,C2)
-if C2 == nil then
-    if self.radius > C1.radius then
-       return radical_center_ (self.center,self.through,C1.center,C1.through)
-    else
-       return radical_center_ (C1.center,C1.through,self.center,self.through)
-    end
-else
-    return radical_center3 (self,C1,C2)
-end
-end 
+ function circle:radical_center(C1, C2)
+     if C2 == nil then
+         if self.radius > C1.radius then
+             return radical_center_(self.center, self.through, C1.center, C1.through)
+         else
+             return radical_center_(C1.center, C1.through, self.center, self.through)
+         end
+     else
+         return radical_center3(self, C1, C2)
+     end
+ end 
 
-function circle : radical_circle (C1,C2)
-   local rc
-    if C2 == nil then
-       rc = self : radical_center (C1)
-       return self : orthogonal_from (rc)
-    else
-       rc = self : radical_center (C1,C2)
-       return C1 : orthogonal_from (rc)
-    end
-end
+ function circle : radical_circle (C1,C2)
+    local rc
+     if C2 == nil then
+        rc = self : radical_center (C1)
+        return self : orthogonal_from (rc)
+     else
+        rc = self : radical_center (C1,C2)
+        return C1 : orthogonal_from (rc)
+     end
+ end
  
- function circle : external_tangent(C)
-   local i,t1,t2,k,T1,T2
-      i     = barycenter_ ({C.center,self.radius},{self.center,-C.radius})
-      t1,t2 = tangent_from_ (self.center,self.through,i) 
-      k     = point.mod((C.center-i)/(self.center-i))
-      T1    = homothety_(i,k,t1)
-      T2    = homothety_(i,k,t2)
-   return line : new (t1,T1),line : new (t2,T2)
+ function circle:external_tangent(C)
+     local i, t1, t2, k, T1, T2
+     i = barycenter_({C.center, self.radius}, {self.center, -C.radius})
+     t1, t2 = tangent_from_(self.center, self.through, i)
+     k = point.mod((C.center - i) / (self.center - i))
+     T1 = homothety_(i, k, t1)
+     T2 = homothety_(i, k, t2)
+     return line:new(t1, T1), line:new(t2, T2)
  end
 
+
  function circle : internal_tangent(C)
    local i,t1,t2,k,T1,T2
       i = barycenter_ ({C.center,self.radius},{self.center,C.radius})
@@ -221,54 +226,52 @@
     return circle : new (orthogonal_through_ (self.center,self.through,pta,ptb),pta)
  end
 
- function circle: inversion_L (L)
-    local p,q
-    if L: in_out (self.center) then
-    return L
-  else 
-   p =  L: projection (self.center)
-   q = inversion_ (self.center,self.through,p) 
-   return   circle: new (midpoint_(self.center,q),q) 
-  end
+ function circle:inversion_L(L)
+     if L:in_out(self.center) then
+         return L
+     else
+         local p = L:projection(self.center)
+         local q = inversion_(self.center, self.through, p)
+         return circle:new(midpoint_(self.center, q), q)
+     end
  end
-   
- function circle: inversion_C (C)
-    local p,q,x,y
-    if C: in_out (self.center) then
-       p = C : antipode (self.center)
-       q = inversion_ (self.center,self.through,p) 
-       x = ortho_from_ ( q , self.center , p )
-       y = ortho_from_ ( q , p, self.center)
-    return line : new  (x,y)
-  else 
-      x,y = intersection_lc_ (self.center,C.center,C.center,C.through)
-      X = inversion_ (self.center,self.through,x) 
-      Y = inversion_ (self.center,self.through,y) 
-      return circle : new (midpoint_(X,Y),X)
-   end
+
+ function circle:inversion_C(C)
+     local p, q, x, y, X, Y
+     if C:in_out(self.center) then
+         p = C:antipode(self.center)
+         q = inversion_(self.center, self.through, p)
+         x = ortho_from_(q, self.center, p)
+         y = ortho_from_(q, p, self.center)
+         return line:new(x, y)
+     else
+         x, y = intersection_lc_(self.center, C.center, C.center, C.through)
+         X = inversion_(self.center, self.through, x)
+         Y = inversion_(self.center, self.through, y)
+         return circle:new(midpoint_(X, Y), X)
+     end
  end
  
-function circle: inversion (...)
-   local obj,nb,t
-   local tp = table.pack(...)
-   obj = tp[1]
-   nb = tp.n
-    if nb == 1 then
-       if obj.type == "point" then
-          return inversion_ (self.center,self.through,obj)
-       elseif  obj.type == "line" then
-          return self: inversion_L (obj)
-       else
-          return self: inversion_C (obj)
-       end
-    else
-        t = {}
-        for i=1,tp.n do
-         table.insert( t , inversion_ (self.center,self.through , tp[i])  ) 
+ function circle:inversion(...)
+     local tp = table.pack(...)
+     local obj = tp[1]
+     local nb = tp.n
+     if nb == 1 then
+         if obj.type == "point" then
+             return inversion_(self.center, self.through, obj)
+         elseif obj.type == "line" then
+             return self:inversion_L(obj)
+         else
+             return self:inversion_C(obj)
          end
-      return table.unpack ( t )     
-    end
-end
+     else
+         local t = {}
+         for i = 1, nb do
+             table.insert(t, inversion_(self.center, self.through, tp[i]))
+         end
+         return table.unpack(t)
+     end
+ end
  
 function circle: draw ()
    local x,y
@@ -282,4 +285,111 @@
   return midcircle_ (self,C)
 end
 
+-- -----------------------------------------------------------
+-- Circle tangent to a circle passing through two points
+function circle : c_c_pp(a,b)
+  
+  -- test If one point is inside the disk and the other is outside, there is no solution.
+  if (self:in_out_disk(a) and not self:in_out_disk(b)) or  ( self:in_out_disk(b) and not self:in_out_disk(a)) then  
+  tex.error("An error has occurred", {"Bad configuration. Only one point is in the disk"})
+return end
+
+-- Find the mediator of the current line
+local  lab = line : new (a,b)
+local  lmed = lab : mediator()
+
+if self : is_tangent (lab) then
+  local c = intersection (self,lab)
+  local d = self : antipode (c)
+
+  return circle:new (circum_circle_(a, b, d),a),
+         circle:new (circum_circle_(a, b, d),a)
+end 
+
+-- pb are (AB) tgt to circle A and B equidistant of O tgt and equidistant
+if lab : is_equidistant (self.center) then 
+  local t1,t2 = intersection (lmed,self)
+   return circle:new (circum_circle_(a, b, t1),t1),
+          circle:new (circum_circle_(a, b, t2),t2)
+else 
+  -- Create a circumcircle passing through a, b, and a point on C
+  local Cc = circle:new(circum_circle_(a, b, self.center), a)
+  -- Find the intersection points of C and Cc
+  local c, d = intersection(self, Cc)
+  -- Create a line passing through the two intersection points
+  local lcd = line:new(c, d)
+  -- Find the intersection of the current line (self) with the line lcd
+  local i = intersection(lab, lcd)
+  -- Create tangents from the intersection point to C
+  local lt, ltp = self:tangent_from(i)
+  -- Get the tangent points
+  local t, tp = lt.pb, ltp.pb
+  -- Return two new circles tangent to C and passing through the tangent points
+  return circle:new(intersection(lmed, line:new(self.center, t)), t),
+         circle:new(intersection(lmed, line:new(self.center, tp)), tp)
+end
+end
+
+
+-- Circle  tangent to two circles passing through a point
+function circle : c_cc_p (C,p)
+  local i = self: external_similitude (C)
+  local lofcenters = line : new (self.center,C.center)
+  local u1,u2 = intersection (lofcenters,self)
+  local v1,v2 = intersection (lofcenters,C)
+   local u1,v1 = self : common_tangent (C) 
+  local o =  circum_circle_(u1,v1,p)
+   local a,b = intersection_lc_(i,p,o,p)
+   if (point.abs(a - b) < tkz_epsilon) then
+    local li = line:new (i,p)
+     return C : c_lc_p (li,a)
+   else
+   local q
+   -- problem if p == q ?
+   if (point.abs(a - p) < tkz_epsilon) then q = b else q=a end
+   return C : c_c_pp (p,q) 
+ end
+end
+
+-- Circle  tangent to one circle, on line and passing through a point
+function circle : c_lc_p (l,p,inside)
+    inside = inside or false  
+  if self : in_out (p) then
+   local t1 = intersection_ll_( self.north,p,l.pa,l.pb)
+   local t2 = intersection_ll_( self.south,p,l.pa,l.pb)
+   local l1 = l : ortho_from (t1)
+   local l2 = l : ortho_from (t2)
+   local o1 = intersection_ll_( self.center,p,l1.pa,l1.pb)
+    local o2 = intersection_ll_( self.center,p,l2.pa,l2.pb)
+    return circle:new(o1,t1),circle:new(o2,t2)
+  else
+    if l : in_out (p) then
+  local i = l : projection (self.center)
+  local lortho = l : ortho_from (p)
+  local u = lortho : report (self.radius,p)
+   local v = lortho : report (-self.radius,p)
+   local ux,uy = mediator_ (self.center,u)
+   local vx,vy = mediator_ (self.center,v)
+   -- pb if c tgt l
+    local o1= intersection_ll_(u,v,ux,uy)
+    local o2 = intersection_ll_(u,v,vx,vy)
+   return circle:new(o1,p),circle:new(o2,p)
+ else  -- genral case
+   local u = self.north
+   local v = self.south
+   local h = intersection_ll_(u,v,l.pa,l.pb)
+     if inside then
+     local o = circum_circle_(p,u,h)
+     local q = intersection_lc_(p,v,o,p)
+     return self : c_c_pp (p,q)
+  else 
+   local o = circum_circle_(p,v,h)
+   local q = intersection_lc_(u,p,o,v)  
+   return self : c_c_pp (p,q)
+   end  
+ end
+ end
+end
+
+
 return circle
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_class.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_class.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_class.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_class.lua 
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- from class.lua (Simple Lua Classes from Lua-users wiki)
 -- Compatible with Lua 5.1 (not 5.0).
 --  http://lua-users.org/wiki/SimpleLuaClasses DavidManura 

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_ellipse.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_ellipse.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_ellipse.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements-ellipses.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_circles.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_circles.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_circles.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_circles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -37,45 +37,52 @@
     return tangent_from_ (a,b,p)
 end
 
-function orthogonal_through_ (a,b,x,y)
-    local d,z
-   d =  1/point.mod(x-a)
-   z = a +(b-a)*d
-   return circum_center_ (x,y,z)
+function orthogonal_through_(a, b, x, y)
+    local d = 1 / point.mod(x - a)
+    local z = a + (b - a) * d
+    return circum_center_(x, y, z)
 end
 
-function inversion_ (c,p,pt)
-  local ry = point.abs(c-p)
-  local d  = point.abs(c-pt)
-  local r  = (ry*ry)/d
-  return c+polar_ (r,point.arg(pt-c))
+function inversion_(c, p, pt)
+    local ry = point.abs(c - p)
+    local d = point.abs(c - pt)
+    local r = (ry * ry) / d
+    return c + polar_(r, point.arg(pt - c))
 end
 
-function circles_position_ (c1,r1,c2,r2)
-   local d,max,min
-   d        = point.mod(c1-c2)
-   max      = r1+r2
-   min      = math.abs ( r1 - r2)
-   if d > max then return "outside"
-      elseif math.abs(d - max) < tkz_epsilon then return "outside tangent" -- epsilon
-      elseif math.abs(d - min) < tkz_epsilon then return "inside tangent" -- epsilon
-      elseif d < min then return "inside"
-      else return "intersect"
-   end
+function circles_position_(c1, r1, c2, r2)
+    local d = point.mod(c1 - c2)
+    local max = r1 + r2
+    local min = math.abs(r1 - r2)
+
+    if d > max then
+        return "outside"
+    elseif math.abs(d - max) < tkz_epsilon then
+        return "outside tangent"
+    elseif math.abs(d - min) < tkz_epsilon then
+        return "inside tangent"
+    elseif d < min then
+        return "inside"
+    else
+        return "intersect"
+    end
 end
+
  
-function radical_axis_ (c1,p1,c2,p2)
-   local ci,cj
-   r1 = point.abs(c1-p1)
-   r2 = point.abs(c2-p2)
-   d  = point.abs(c1-c2)
-   h  = (r1*r1-r2*r2+d*d)/(2*d)
-   ck = radical_center_ (c1,p1,c2,p2)
-   cj = rotation_ (ck,-math.pi/2,c1)
-   ci = symmetry_ (ck,cj)
-   return cj,ci
+function radical_axis_(c1, p1, c2, p2)
+    local r1 = point.abs(c1 - p1)
+    local r2 = point.abs(c2 - p2)
+    local d = point.abs(c1 - c2)
+    local h = (r1 * r1 - r2 * r2 + d * d) / (2 * d)
+
+    local ck = radical_center_(c1, p1, c2, p2)
+    local cj = rotation_(ck, -math.pi / 2, c1)
+    local ci = symmetry_(ck, cj)
+
+    return cj, ci
 end
 
+
 function radical_center_ (c1,p1,c2,p2)
    local d,r1,r2,h
    r1 = point.abs(c1-p1)
@@ -96,18 +103,16 @@
 end
 end
 
-function south_pole_ (c,p)
-   local r
-   r = point.abs (c-p)
-   return c - point (0,r)
- end
+function south_pole_(c, p)
+    return c - point(0, point.abs(c - p))
+end
 
-function north_pole_ (c,p)
-   local r
-   r = point.abs (c-p)
-   return c + point (0,r)
+
+function north_pole_(c, p)
+    return c + point(0, point.abs(c - p))
 end
 
+
 function antipode_ (c,pt)
    return 2 * c - pt
 end
@@ -126,23 +131,24 @@
 end
  
 function midcircle_(C1,C2)
-   local state,r,s,t1,t2,T1,T2,p,a,b,c,d,Cx,Cy,i,j
-   state =  circles_position_(C1.center,C1.radius,C2.center,C2.radius)
-   i = barycenter_ ({C2.center,C1.radius},{C1.center,-C2.radius})
-   j = barycenter_ ({C2.center,C1.radius},{C1.center,C2.radius})
-   t1,t2 = tangent_from_ (C1.center,C1.through,i)
-   T1,T2 = tangent_from_ (C2.center,C2.through,i)
+    local state, r, s, t1, t2, T1, T2, p, a, b, c, d, Cx, Cy, i, j
+    state = circles_position_(C1.center, C1.radius, C2.center, C2.radius)
+    i = barycenter_({C2.center, C1.radius}, {C1.center, -C2.radius})
+    j = barycenter_({C2.center, C1.radius}, {C1.center, C2.radius})
+    t1, t2 = tangent_from_(C1.center, C1.through, i)
+    T1, T2 = tangent_from_(C2.center, C2.through, i)
       
-   if (state == 'outside') or (state == 'outside tangent')then
-         p = math.sqrt(point.mod(i-t1)*point.mod(i-T1))
-   return circle  : radius (i,p)
-   elseif state == 'intersect' then
-        r,s = intersection (C1,C2)
-   return circle  : radius (i,point.mod(r-i)) , circle  : radius (j,point.mod(r-j))
-   elseif (state == 'inside') or (state == 'inside tangent') then
-      a,b = intersection_lc_ (C1.center,C2.center,C1.center,C1.through)
-      c,d = intersection_lc_ (C1.center,C2.center,C2.center,C2.through)
-       
+    if (state == 'outside') or (state == 'outside tangent') then
+        p = math.sqrt(point.mod(i - t1) * point.mod(i - T1))
+        return circle:radius(i, p)
+    elseif state == 'intersect' then
+        r, s = intersection(C1, C2)
+        return circle:radius(i, point.mod(r - i)), circle:radius(j, point.mod(r - j))
+    elseif (state == 'inside') or (state == 'inside tangent') then
+        a, b = intersection_lc_(C1.center, C2.center, C1.center, C1.through)
+        c, d = intersection_lc_(C1.center, C2.center, C2.center, C2.through)
+  
+      -- Ensure the smaller radius circle is used first
       if C1.radius < C2.radius then 
          z.u, z.v, z.r, z.s = a, b, c, d
       else
@@ -149,19 +155,22 @@
          z.u, z.v, z.r, z.s = c, d, a, b
       end
       
-      if  (in_segment_ (z.s,z.v,z.u) == true) 
-      then 
-      Cx = circle  :  diameter (z.r,z.v)
-      Cy = circle  :  diameter (z.u,z.s)
-      else
-      Cx = circle  :  diameter (z.s,z.v)
-      Cy = circle  :  diameter (z.u,z.r)
-      end
-      if (Cx.radius) < (Cy.radius) then
-         return Cy : orthogonal_from (j) 
-      else
-         return Cx : orthogonal_from (j)
- end
- end
+        -- Determine circle orientation and return orthogonal from j
+        if in_segment_(z.s, z.v, z.u) then
+            Cx = circle:diameter(z.r, z.v)
+            Cy = circle:diameter(z.u, z.s)
+        else
+            Cx = circle:diameter(z.s, z.v)
+            Cy = circle:diameter(z.u, z.r)
+        end
+
+        -- Return the circle with the smaller radius orthogonal from j
+        if Cx.radius < Cy.radius then
+            return Cy:orthogonal_from(j)
+        else
+            return Cx:orthogonal_from(j)
+        end
+    end
 end
+
  
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_intersections.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_intersections.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_intersections.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_intersections.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -72,133 +72,142 @@
       end
 end
  
-function intersection_ll_ (a,b,c,d)
-    local x1,x2,x3,x4,y1,y2,y3,y4,DN,NX,NY
-    x1 = a.re
-    y1 = a.im
-    x2 = b.re
-    y2 = b.im
-    x3 = c.re
-    y3 = c.im
-    x4 = d.re
-    y4 = d.im
-    DN = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4)
-    if math.abs ( DN ) < tkz_epsilon then
-     return false 
-     else
-    NX = (x1*y2-y1*x2)*(x3-x4) - (x1-x2)*(x3*y4-y3*x4)
-    NY = (x1*y2-y1*x2)*(y3-y4) - (y1-y2)*(x3*y4-y3*x4)
-    return point (NX/DN,NY/DN)
+function intersection_ll_(a, b, c, d)
+    local x1, y1, x2, y2, x3, y3, x4, y4
+    local DN, NX, NY
+
+    x1, y1 = a.re, a.im
+    x2, y2 = b.re, b.im
+    x3, y3 = c.re, c.im
+    x4, y4 = d.re, d.im
+
+    DN = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
+
+    if math.abs(DN) < tkz_epsilon then
+        return false
     end
+
+    NX = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)
+    NY = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)
+
+    return point(NX / DN, NY / DN)
 end
 
-function intersection_lc_ (pa,pb,c,p)
-  local zh, dh, arg_ab, test, phi,c1,c2,r
-    r = point.mod (c-p)
-    zh = projection_ (pa,pb,c)
-    dh = point.abs  (c - zh)
-    arg_ab = point.arg (pa - pb)
-   if dh < tkz_epsilon
-       then
-       return
-            c + polar_ (r , math.pi + arg_ab),  -- through center
-            c + polar_ (r ,  arg_ab)
-  elseif math.abs (r - dh) < tkz_epsilon
-    then 
-        return zh , zh -- tangent
-  elseif dh > r
-    then return false , false -- no intersection
-  else
-    phi = math.asin (dh / r)
-   -- phi = angle_normalize(phi)
-    test = (pa-pb) * point.conj (c-zh)
-    if test.im < 0
-    then phi = math.pi + phi
-      end
-      c1 = angle_normalize (arg_ab + phi )
-      c2 = angle_normalize (math.pi + arg_ab - phi )
-      if c2 < c1 then
-    return
-    c + polar_ (r, c2) ,
-    c + polar_ (r, c1)
- else 
-    return
-    c + polar_ (r, c1) ,
-    c + polar_ (r, c2)
-   end -- if
-   end -- if
+function intersection_lc_(pa, pb, c, p)
+    local zh, dh, arg_ab, phi, c1, c2, r, test
 
-end -- function
+    r = point.mod(c - p)
+    zh = projection_(pa, pb, c)
+    dh = point.abs(c - zh)
+    arg_ab = point.arg(pa - pb)
 
-function intersection_cc_ (ca,pa,cb,pb )
-  local d, cosphi, phi,ra,rb,c1,c2,epsilon
+    if dh < tkz_epsilon then
+        -- Le centre du cercle est sur la droite
+        return c + polar_(r, math.pi + arg_ab), c + polar_(r, arg_ab)
+    elseif math.abs(r - dh) < tkz_epsilon then
+        -- La droite est tangente au cercle
+        return zh, zh
+    elseif dh > r then
+        -- Aucune intersection
+        return false, false
+    else
+        -- Il y a une intersection, calcul de l'angle
+        phi = math.asin(dh / r)
+        test = (pa - pb) * point.conj(c - zh)
+        if test.im < 0 then
+            phi = math.pi + phi
+        end
+
+        c1 = angle_normalize(arg_ab + phi)
+        c2 = angle_normalize(math.pi + arg_ab - phi)
+
+        -- Retourner les deux points d'intersection
+        if c2 < c1 then
+            return c + polar_(r, c2), c + polar_(r, c1)
+        else
+            return c + polar_(r, c1), c + polar_(r, c2)
+        end
+    end
+end
+
+function intersection_cc_(ca, pa, cb, pb)
+    local d, cosphi, phi, ra, rb, c1, c2, epsilon
+
+    -- Précision pour arrondir les résultats
     epsilon = 12
-    d  = point.abs (ca - cb)
-    ra = point.abs (ca - pa)
-    rb = point.abs (cb - pb)
-  cosphi = tkzround(((ra * ra + d * d - rb * rb)
-                           /( 2 * ra * d )) , epsilon)  
-  phi =  tkzround (math.acos(cosphi),epsilon)
-  if not phi then 
-     return false , false 
-  elseif phi == 0 then
-     return ca + polar_ (ra, phi + point.arg (cb - ca)) ,
-            ca + polar_ (ra, phi + point.arg (cb - ca))
-  else
-     c1 = angle_normalize ( phi + point.arg(cb - ca))
-     c2 = angle_normalize (-phi + point.arg(cb - ca))
-  if c1 < c2 then
-      return
-   ca + polar_(ra,  c1),
-   ca + polar_(ra, c2)
-else
-   return
-   ca + polar_(ra,  c2),
-   ca + polar_(ra, c1)
-      end -- if
-   end -- if
- end -- function
+    -- Distance entre les centres des cercles
+    d = point.abs(ca - cb)
+    -- Rayons des cercles
+    ra = point.abs(ca - pa)
+    rb = point.abs(cb - pb)
 
-function intersection ( X , Y )
-   local i,z1,z2
-   local t = {}
+    -- Calcul du cosinus de l'angle phi entre les centres et les points sur les cercles
+    cosphi = tkzround((ra * ra + d * d - rb * rb) / (2 * ra * d), epsilon)
+    
+    -- Calcul de l'angle phi
+    phi = tkzround(math.acos(cosphi), epsilon)
 
-   if X.type == 'circle'
-   then 
-         if Y.type == 'circle'
-         then
-            z1,z2 = intersection_cc ( X , Y )
-            table.insert (t , z1 )
-            table.insert (t , z2 )
-         else -- Y[i] est une droite
-            z1,z2 = intersection_lc ( Y , X )
-            table.insert (t , z1 )
-            table.insert (t , z2 )
-         end -- if
-   else 
-      if X.type == 'line' then
-         if Y.type == 'circle'
-         then
-            z1,z2 = intersection_lc ( X , Y )
-            table.insert ( t , z1 )
-            table.insert ( t , z2 )
-         else 
-            if Y.type == 'line' then
-            z1 = intersection_ll ( X , Y )
-            table.insert (t , z1 )
-         else -- ellipse
-            z1,z2 = intersection_le ( X , Y )
-            table.insert ( t , z1 )
-            table.insert ( t , z2 )
-         end
-         end -- if
-      else 
-         if  X.type == 'ellipse' then
-         z1,z2 = intersection_le ( Y,X)
-         table.insert ( t , z1 )
-         table.insert ( t , z2 )
-       end
+    -- Si phi est invalide (par exemple, cosphi > 1 ou < -1), aucune intersection
+    if not phi then
+        return false, false
+    elseif phi == 0 then
+        -- Les cercles sont tangents l'un à l'autre, retourne le même point pour les deux intersections
+        return ca + polar_(ra, point.arg(cb - ca)), ca + polar_(ra, point.arg(cb - ca))
+    else
+        -- Calcul des angles des points d'intersection
+        c1 = angle_normalize(phi + point.arg(cb - ca))
+        c2 = angle_normalize(-phi + point.arg(cb - ca))
+
+        -- Retourner les points d'intersection dans l'ordre croissant des angles
+        if c1 < c2 then
+            return ca + polar_(ra, c1), ca + polar_(ra, c2)
+        else
+            return ca + polar_(ra, c2), ca + polar_(ra, c1)
+        end
+    end
+end
+
+function intersection(X, Y)
+   local t = {}  -- Tableau pour stocker les points d'intersection
+
+   -- Cas où X est un cercle
+   if X.type == 'circle' then
+      if Y.type == 'circle' then
+         -- Intersection entre deux cercles
+         local z1, z2 = intersection_cc(X, Y)
+         table.insert(t, z1)
+         table.insert(t, z2)
+      else -- Y est une droite
+         local z1, z2 = intersection_lc(Y, X)  -- Intersection entre un cercle et une droite
+         table.insert(t, z1)
+         table.insert(t, z2)
       end
-   end -- if
-   return table.unpack ( t )
-end -- function 
\ No newline at end of file
+
+   -- Cas où X est une droite
+   elseif X.type == 'line' then
+      if Y.type == 'circle' then
+         -- Intersection entre une droite et un cercle
+         local z1, z2 = intersection_lc(X, Y)
+         table.insert(t, z1)
+         table.insert(t, z2)
+      elseif Y.type == 'line' then
+         -- Intersection entre deux droites
+         local z1 = intersection_ll(X, Y)
+         table.insert(t, z1)
+      else -- Y est une ellipse
+         local z1, z2 = intersection_le(X, Y)  -- Intersection entre une droite et une ellipse
+         table.insert(t, z1)
+         table.insert(t, z2)
+      end
+
+   -- Cas où X est une ellipse
+   elseif X.type == 'ellipse' then
+      -- Intersection entre une ellipse et l'autre objet (cercle, droite ou ellipse)
+      local z1, z2 = intersection_le(Y, X)
+      table.insert(t, z1)
+      table.insert(t, z2)
+   end
+
+   -- Retourner les résultats sous forme de valeurs distinctes
+   return table.unpack(t)
+end

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_lines.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_lines.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_lines.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_lines.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -15,16 +15,17 @@
 ---------------------------------------------------------------------------
 --                 Lines
 ---------------------------------------------------------------------------
-function normalize_ (a,b)
-   return a+(b-a)/point.mod(b-a)
+function normalize_(a, b)
+    return a + (b - a) / point.mod(b - a)
 end
 
-function ortho_from_ ( p , a , b )
-	return  p+(b-a)*point(0,1) 
+
+function ortho_from_(p, a, b)
+    return p + (b - a) * point(0, 1)
 end
 
 function ll_from_ ( p , a , b )
-	return  p+b-a
+	return  p + b - a
 end
 
 function slope_ (a,b)
@@ -32,7 +33,7 @@
 end
 
 function gold_segment_ (a,b)
-  return a + (b-a)*tkzinvphi
+  return a + (b - a) * tkzinvphi
 end
 
 function online_ (a,b,t)
@@ -52,26 +53,25 @@
    return rotation_ (a,math.pi/3,b)
 end
 
-function isosceles_right_tr (a,b)
-     local pt
-     pt = rotation_ (a,math.pi/4,b)
-   return a + (pt-a) * math.sin(math.pi/4)
+function isosceles_right_tr(a, b)
+    local pt = rotation_(a, math.pi / 4, b)
+    return a + (pt - a) * math.sin(math.pi / 4)
 end
 
-function gold_tr (a,b)
-   local pt
-   pt = rotation_ (a,math.pi/2,b)
-   return a + (pt-a) * tkzinvphi
+
+function gold_tr(a, b)
+    local pt = rotation_(a, math.pi / 2, b)
+    return a + (pt - a) * tkzinvphi
 end
 
+
 function euclide_tr (a,b)
      return rotation_ (a,math.pi/5,b)
 end
 
 function golden_tr (a,b)
-    local pt
-    pt = rotation_ (a,2*math.pi/5,b)
-     return a + (pt-a) * tkzphi
+   local  pt = rotation_ (a,2*math.pi/5,b)
+   return a + (pt-a) * tkzphi
 end
 
 function div_harmonic_int_(a,b,n)
@@ -97,66 +97,56 @@
   return projection_ ( Dt.pa,Dt.pb,pt )
 end
 
-function projection_ ( pa,pb,pt )
-   local v
-   local z
-   if aligned ( pa,pb,pt ) then
-   return pt
-   else
-    v = pb - pa
-    z = ((pt - pa)..v)/(point.norm(v)) -- .. dot product
-   return pa + z * v  
-   end
+function projection_(pa, pb, pt)
+    if aligned(pa, pb, pt) then
+        return pt
+    else
+        local v = pb - pa
+        local z = ((pt - pa) .. v) / point.norm(v)  -- .. dot product
+        return pa + z * v
+    end
 end
 
+
 function symmetry_axial_(pa,pb,pt)
-    local p 
-    p = projection_ (pa,pb,pt)
+    local p = projection_ (pa,pb,pt)
     return symmetry_(p,pt)
 end
 
-function set_symmetry_axial_ (u,v,...)
-	local tp = table.pack(...)
-	local i
+function set_symmetry_axial_(u, v, ...)
     local t = {}
-	for i=1,tp.n do
-        table.insert( t , symmetry_axial_ (u,v , tp[i])  ) 
-	end
-  return table.unpack ( t )
+    for _, value in ipairs({...}) do
+        table.insert(t, symmetry_axial_(u, v, value))
+    end
+    return table.unpack(t)
 end
 
+
 function square_ (a,b)
     return rotation_ (b,-math.pi/2,a), rotation_ (a,math.pi/2,b)
 end
 
-function in_segment_ (a,b,pt)
-    local sc
-    sc = point.mod (pt-a) + point.mod (pt-b) - point.mod(b-a)
-    if sc <= tkz_epsilon
-     then
-       return true
+function in_segment_(a, b, pt)
+    return point.mod(pt - a) + point.mod(pt - b) - point.mod(b - a) <= tkz_epsilon
+end
+
+function report_(za, zb, d, pt)
+    local len = point.mod(zb - za)
+    local t = d / len
+    local result = barycenter_({za, 1 - t}, {zb, t})
+    
+    if pt then
+        return result + pt - za
     else
-       return false
+        return result
     end
 end
 
-function report_ (za,zb,d,pt)
-   local t,len
-   len = point.mod(zb-za)
-   t = d/len
-   if pt == nil  
-   then  
-   return barycenter_({za,1-t},{zb,(t)})
-else 
-   return barycenter_({za,1-t},{zb,(t)}) +pt-za
+function colinear_at_(za, zb, pt, k)
+    if k then
+        return pt + k * (zb - za)
+    else
+        return pt + (zb - za)
+    end
 end
-end
 
-function colinear_at_ (za,zb,pt,k)
-  if k == nil  
-  then 
-	return  pt+zb-za
-else
-  return  pt+k*(zb-za)
-end
-end

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_maths.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_maths.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_maths.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_maths.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -38,27 +38,26 @@
   return a1*b2-a2*b1
 end
 
-function aligned ( m,a,b )
+function aligned(m, a, b)
     local z
-    z = (b-a)/(m-b)
-      if math.abs(z.im) < tkz_epsilon
-        then
-            return true
-        else
-            return false
-        end
-end 
+    z = (b - a) / (m - b)
+    if math.abs(z.im) < tkz_epsilon then
+        return true
+    else
+        return false
+    end
+end
 
-function islinear (z1,z2,z3)
-     local dp
-    dp = (z2-z1) ^ (z3-z1)
-    if math.abs(dp) < tkz_epsilon 
-    then 
+function islinear(z1, z2, z3)
+    local dp
+    dp = (z2 - z1) ^ (z3 - z1)
+    if math.abs(dp) < tkz_epsilon then
         return true
-    else 
+    else
         return false
     end
 end
+is_linear = islinear
 
 function isortho (z1,z2,z3)
    local dp
@@ -71,6 +70,8 @@
     end
 end
 
+is_ortho = isortho
+
 function parabola (a,b,c)
    local xa,xb,xc,ya,yb,yc
    xa = a.re

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_matrices.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_matrices.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_matrices.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_matrices.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_points.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -23,30 +23,29 @@
 end
 
 function barycenter_ (...)
-local cp = table.pack(...)
-local i
-local sum = 0
-local weight=0
-for i=1,cp.n do
-   sum = sum + cp[i][1]*cp[i][2]
-   weight = weight + cp[i][2]
+  local cp = table.pack(...)
+  local sum = 0
+  local weight = 0
+  for i = 1, cp.n do
+    sum = sum + cp[i][1] * cp[i][2]
+    weight = weight + cp[i][2]
+  end
+  return sum / weight
 end
-return sum/weight
-end
 
-function rotation_ (c,a,pt)
-  local z = point( math.cos(a) , math.sin(a) )
-  return z*(pt-c)+c
+function rotation_ (c, a, pt)
+  local z = point(math.cos(a), math.sin(a))
+  return z * (pt - c) + c
 end
 
-function set_rotation_ (c,angle,...)
+-- Define the set_rotation_ function
+function set_rotation_ (c, angle, ...)
    local tp = table.pack(...)
-   local i
    local t = {}
    for i=1,tp.n do
-         table.insert( t ,  rotation_(c , angle , tp[i] ))
+         table.insert(t, rotation_(c, angle, tp[i]))
    end
-   return table.unpack ( t )
+   return table.unpack(t)
 end
 
 function symmetry_(c,pt)
@@ -55,8 +54,7 @@
 
 function set_symmetry_ (c,...)
    local tp = table.pack(...)
-   local i
-    local t = {}
+   local t = {}
     for i=1,tp.n do
         table.insert( t , symmetry_ (c , tp[i])  )
      end
@@ -69,8 +67,7 @@
 
 function set_homothety_ (c,coeff,...)
    local tp = table.pack(...)
-   local i
-    local t = {}
+   local t = {}
     for i=1,tp.n do
         table.insert( t , homothety_ (c, coeff , tp[i]) )
      end
@@ -83,7 +80,6 @@
 
 function set_translation_ (u,...)
    local tp = table.pack(...)
-   local i
    local t = {}
    for i=1,tp.n do
          table.insert( t ,  (u + tp[i])  )
@@ -101,7 +97,6 @@
 function midpoints_ (...)
    local arg = table.pack(...)
    local n = arg.n
-   local i
    local t = {}
    for i=1, n-1 do
       table.insert(  t , (arg[i]+arg[i+1])/2 )

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_regular.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_regular.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_regular.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_regular.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_triangles.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_triangles.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_triangles.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_triangles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -70,20 +70,32 @@
  return   barycenter_ ({a,u*u},{b,v*v},{c,w*w})
 end
 
-function nagel_point_ (a,b,c)
-   local u,v,w
-   u,v,w =  extouch_tr_ ( a,b,c ) 
-return   intersection_ll_ (a,u,b,v)
+function nagel_point_ (a, b, c)
+   -- Calculate the excircle tangency points (u, v, w)
+   local u, v, w = extouch_tr_ (a, b, c)
+
+   -- Find the intersection of lines through a and u, and through b and v
+   return intersection_ll_ (a, u, b, v)
 end
 
-function  feuerbach_point_ (a,b,c)
-   local i,h,e,ma
-   i,h =  in_circle_ (a,b,c)
-   e   =  euler_center_ (a,b,c)
-   ma  = (b+c)/2
-return   intersection_cc_ (i,h,e,ma)
+
+function feuerbach_point_ (a, b, c)
+   local i, h, e, ma
+
+   -- Calculate the incenter and some related point (likely the orthocenter or another center)
+   i, h = in_circle_ (a, b, c)
+   
+   -- Calculate the Euler center (center of the nine-point circle)
+   e = euler_center_ (a, b, c)
+   
+   -- Calculate the midpoint of side BC
+   ma = (b + c) / 2
+   
+   -- Find the intersection of the circles at (i, h) and (e, ma), which gives the Feuerbach point
+   return intersection_cc_ (i, h, e, ma)
 end
 
+
 function spieker_center_ (a,b,c)
 return in_center_ (medial_tr_ ( a,b,c))
 end
@@ -160,18 +172,28 @@
                  projection_ (b,a,o)
 end
 
-function euler_circle_ (a,b,c)
-   local o,ma,mb,mc,H,ha,hb,hc
-   o = euler_center_ (a,b,c)
-    ma,mb,mc = medial_tr_  ( a,b,c) 
-    ha,hb,hc = orthic_tr_  ( a,b,c)
-    local _,_,H,_ = euler_line_ (a,b,c)
-    return 
-    o,ma,mb,mc,ha,hb,hc,
-    midpoint_ ( H,a ),
-    midpoint_ ( H,b ),
-    midpoint_ ( H,c )
+function euler_circle_ (a, b, c)
+   local o, ma, mb, mc, H, ha, hb, hc
+   -- Compute the Euler center (center of the nine-point circle)
+   o = euler_center_ (a, b, c)
+
+   -- Calculate the medial triangle (midpoints of the sides)
+   ma, mb, mc = medial_tr_ (a, b, c)
+
+   -- Calculate the orthic triangle (feet of the altitudes)
+   ha, hb, hc = orthic_tr_ (a, b, c)
+
+   -- Get the Euler line and midpoint (H) on the Euler line
+   _, _, H, _ = euler_line_ (a, b, c)
+
+   -- Return all relevant geometric elements
+   return 
+      o, ma, mb, mc, ha, hb, hc,
+      midpoint_ (H, a),  -- Midpoint between H and vertex a
+      midpoint_ (H, b),  -- Midpoint between H and vertex b
+      midpoint_ (H, c)   -- Midpoint between H and vertex c
 end
+
 --------------------
 -- triangles --
 --------------------
@@ -194,15 +216,21 @@
          barycenter_ ( {a,1} , {b,1} , {c,-1} )
 end
 
-function incentral_tr_ (a,b,c)
-    local i,r,s,t
-    i = in_center_ (a , b , c)
-    r = intersection_ll_ ( a,i , b,c)
-    s = intersection_ll_ ( b,i , a,c)
-    t = intersection_ll_ ( c,i , a,b)
-return    r,s,t
+function incentral_tr_ (a, b, c)
+    local i, r, s, t
+    -- Compute the incenter (center of the incircle)
+    i = in_center_ (a, b, c)
+    
+    -- Calculate the points of tangency where the incircle touches the sides
+    r = intersection_ll_ (a, i, b, c)  -- Intersection of lines a-i and b-c
+    s = intersection_ll_ (b, i, a, c)  -- Intersection of lines b-i and a-c
+    t = intersection_ll_ (c, i, a, b)  -- Intersection of lines c-i and a-b
+    
+    -- Return the points of tangency that form the incentral triangle
+    return r, s, t
 end
 
+
 function excentral_tr_ (a,b,c)
     local r,s,t,ka,kb,kc
       ka = point.abs (b-c)
@@ -290,19 +318,22 @@
     return  point.mod(a - projection_(b,c,a))*point.mod (b - c)/2
 end
 
-function check_equilateral_ (a,b,c)
-    local A,B,C
-    A = b - c
-    B = a - c
-    C = a - b
-    if (point.abs(A)-point.abs(B) < tkz_epsilon) and (point.abs(B)-point.abs(C) < tkz_epsilon) 
-    then
-       return true
-     else 
-        return false
+function check_equilateral_ (a, b, c)
+    local A, B, C
+    -- Compute the vectors representing the sides of the triangle
+    A = b - c  -- Side from b to c
+    B = a - c  -- Side from a to c
+    C = a - b  -- Side from a to b
+
+    -- Check if all sides have approximately equal lengths
+    if (point.abs(A) - point.abs(B) < tkz_epsilon) and (point.abs(B) - point.abs(C) < tkz_epsilon) then
+        return true  -- The triangle is equilateral
+    else 
+        return false  -- The triangle is not equilateral
     end
 end
 
+
 function parallelogram_ (a,b,c)
     local x = c + a - b
   return  x
@@ -337,22 +368,34 @@
     end
 end
 
-function  soddy_center_ (a,b,c)
-    local i,ha,hb,hc,e,f,g,x,y,z,xp,yp,zp
-    i,e,f,g    = in_circle_ (a,b,c)
-    ha,hb,hc   = orthic_tr_ (a,b,c)
-    x,xp       = intersection_lc_ (a,ha,a,g)
-    if (point.mod(ha-x)<point.mod(ha-xp)) then else x,xp=swap(x,xp) end
-    y,yp       = intersection_lc_ (b,hb,b,e)
-    if (point.mod(hb-y)<point.mod(hb-yp)) then else y,yp=swap(y,yp) end
-    z,zp       = intersection_lc_ (c,hc,c,f)
-    if (point.mod(hc-z)<point.mod(hc-zp)) then else z,zp=swap(z,zp) end
-    xi,t         = intersection_lc_ (xp,e,a,g)
-     if in_out_ (a,b,c,xi) then  else xi,t = swap(xi,t) end
-    yi,t         = intersection_lc_ (yp,f,b,e)
-     if in_out_ (a,b,c,yi) then  else yi,t = swap(yi,t) end
-    zi,t      = intersection_lc_ (zp,g,c,f)
-     if in_out_ (a,b,c,zi) then  else zi,t = swap(zi,t) end
-    s          = circum_center_ (xi,yi,zi)
-   return s,xi,yi,zi
+function soddy_center_ (a,b,c)
+    -- Step 1: Compute the incenter and excircle centers
+    local i,e,f,g = in_circle_ (a,b,c)
+    local ha,hb,hc = orthic_tr_ (a,b,c)
+
+    -- Step 2: Find the intersection points for the tangent lines
+    local x,xp = intersection_lc_ (a,ha,a,g)
+    if (point.mod(ha-x) < point.mod(ha-xp)) then else x,xp = swap(x,xp) end
+    
+    local y,yp = intersection_lc_ (b,hb,b,e)
+    if (point.mod(hb-y) < point.mod(hb-yp)) then else y,yp = swap(y,yp) end
+    
+    local z,zp = intersection_lc_ (c,hc,c,f)
+    if (point.mod(hc-z) < point.mod(hc-zp)) then else z,zp = swap(z,zp) end
+    
+    -- Step 3: Calculate the intersections with the opposite triangle sides
+    local xi,t = intersection_lc_ (xp,e,a,g)
+    if in_out_ (a,b,c,xi) then else xi,t = swap(xi,t) end
+    
+    local yi,t = intersection_lc_ (yp,f,b,e)
+    if in_out_ (a,b,c,yi) then else yi,t = swap(yi,t) end
+    
+    local zi,t = intersection_lc_ (zp,g,c,f)
+    if in_out_ (a,b,c,zi) then else zi,t = swap(zi,t) end
+    
+    -- Step 4: Calculate the circumcenter of the triangle formed by the tangent points
+    local s = circum_center_ (xi,yi,zi)
+
+    return s,xi,yi,zi -- Return the Soddy center and the tangent points
 end
+

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_line.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_line.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_line.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_lines.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -16,7 +16,7 @@
 --                           Lines
 -- -------------------------------------------------------------------------
 line = {}
-function line: new(za, zb)
+function line:new(za, zb)
     local type             = 'line'
     local mid              = (za+zb)/2
     local north_pa         = rotation_ (za,math.pi/2,zb)
@@ -49,122 +49,119 @@
 -------------------
 -- Result -> real
 -------------------
-function line: distance (pt)   
+function line:distance(pt)   
     return point.mod(projection(self,pt)-pt)
 end
 
-function length(a,b)
-  return  point.abs (a-b)
-end
-
-function line: slope ()
+function line:slope()
    return slope_(self.pa,self.pb)
 end
 -------------------
 -- Result -> boolean
 -------------------
-function line: in_out (pt)
-    local sc
-    sc = math.abs ((pt-self.pa)^(pt-self.pb))
-    if sc <= tkz_epsilon
-     then
-       return true
-    else
-       return false
-    end
+function line:in_out(pt)
+    return math.abs((pt - self.pa) ^ (pt - self.pb)) <= tkz_epsilon
 end
 
-function line: in_out_segment (pt)
-    local sc
-    sc = point.mod (pt-self.pa) + point.mod (pt-self.pb) - point.mod(self.pb-self.pa)
-    if sc <= tkz_epsilon
-     then
-       return true
-    else
-       return false
-    end
+function line:in_out_segment(pt)
+    return point.mod(pt - self.pa) + point.mod(pt - self.pb) - point.mod(self.pb - self.pa) <= tkz_epsilon
 end
+
+function line:is_parallel(L)
+    return math.abs(self.slope - L.slope) < tkz_epsilon
+end
+
+function line:is_orthogonal(L)
+    return math.abs(self.slope * L.slope + 1) < tkz_epsilon
+end
+
+function line:is_equidistant(p)
+    return math.abs( (point.mod(self.pa-p)-(point.mod(self.pb-p)))) < tkz_epsilon
+end
 -------------------
 -- Result -> point
 -------------------
-function line: barycenter (ka,kb)
+function line:barycenter(ka,kb)
     return barycenter_({self.pa,ka},{self.pb,kb})
 end
 
-function line: point (t) --  t=o A  t=1 B  t = AM / AB 
+function line:point(t) --  t=o A  t=1 B  t = AM / AB 
     return barycenter_({self.pa,1-t},{self.pb,(t)})
 end
 
-function line: midpoint ()
+function line:midpoint()
     return (self.pa+self.pb)/2
 end
 
-function line: harmonic_int (pt)
+function line:harmonic_int(pt)
     return div_harmonic_int_(self.pa,self.pb,pt)
 end
 
-function line: harmonic_ext (pt)
+function line:harmonic_ext(pt)
     return div_harmonic_ext_(self.pa,self.pb,pt)
 end
 
-function line: harmonic_both (k)
+function line:harmonic_both(k)
     return div_harmonic_both_(self.pa,self.pb,k)
 end
 
-function line: gold_ratio()
+function line:gold_ratio()
    return self.pa + (self.pb-self.pa)*tkzinvphi
 end
 
-function line: normalize ()
+function line:normalize()
    return  self.pa+(self.pb-self.pa)/point.mod(self.pb-self.pa)
 end
 
-function line: normalize_inv ()
+function line:normalize_inv()
    return normalize_ (self.pb,self.pa)
 end
 
-function line: _east (d)
+function line:_east(d)
    local d = d or 1
    return self.pb+ d/self.length * (self.pb-self.pa)
 end
 
-function line: _west (d)
+function line:_west(d)
    local d = d or 1
    return self.pa+ d/self.length * (self.pa-self.pb)
 end
 
-function line: _north_pa (d)
+function line:_north_pa(d)
    local d = d or 1
    return d/self.length * ( self.north_pa - self.pa ) + self.pa
 end
 
-function line: _south_pa (d)
+function line:_south_pa(d)
    local d = d or 1
    return d/self.length *( self.south_pa - self.pa ) + self.pa
 end
 
-function line: _south_pb (d)
+function line:_south_pb(d)
    local d = d or 1
    return d/self.length *( self.south_pb - self.pb ) + self.pb
 end
 
-function line: _north_pb (d)
+function line:_north_pb(d)
    local d = d or 1
    return d/self.length *( self.north_pb - self.pb ) + self.pb
 end
 
-function line  : report (d,pt)
-   local t
-   t = d/self.length
-   if pt == nil  
-      then  
-         return barycenter_({self.pa,1-t},{self.pb,(t)})
-      else 
-         return barycenter_({self.pa,1-t},{self.pb,(t)}) +pt-self.pa
-      end
+function line:report(d, pt)
+    if not self.length or self.length == 0 then
+        error("self.length must be non-zero")
+    end
+    local t = d / self.length
+    local result = barycenter_({self.pa, 1 - t}, {self.pb, t})
+    if pt then
+        return result + pt - self.pa
+    else
+        return result
+    end
 end
 
-function line  : colinear_at (pt,k)
+
+function line:colinear_at (pt,k)
    if k == nil  
       then  
          return colinear_at_ (self.pa,self.pb,pt,1)
@@ -173,28 +170,28 @@
       end
 end
 -------------- transformations -------------
-function line: translation_pt ( pt )
+function line:translation_pt( pt )
     return translation_ ( self.pb-self.pa,pt )
 end
 
-function line: translation_C ( obj )
+function line:translation_C( obj )
    local pa,pb,x,y
    pa = obj.center
    pb = obj.through
-   x,y = set_translation_ ( self.pb-self.pa,pa,pb )
+   x,y = set_translation_( self.pb-self.pa,pa,pb )
    return circle : new  (x,y)
 end
 
-function line: translation_T ( obj )
+function line: translation_T( obj )
    local pa,pb,pc,x,y,z
    pa    = obj.pa
    pb    = obj.pb
    pc    = obj.pc
-   x,y,z = set_translation_ ( self.pb-self.pa,pa,pb,pc )
+   x,y,z = set_translation_( self.pb-self.pa,pa,pb,pc )
    return triangle : new  (x,y,z)
 end
 
-function line: translation_L ( obj )
+function line: translation_L( obj )
    local pa,pb,x,y
    pa = obj.pa
    pb = obj.pb
@@ -202,35 +199,42 @@
    return line : new  (x,y)
 end
 
-function line: translation (...)
-   local obj,nb,t
+function line:translation(...)
+   local obj, nb, t
    local tp = table.pack(...)
    obj = tp[1]
    nb = tp.n
-    if nb == 1 then
-       if obj.type == "point" then
-          return translation_ ( self.pb-self.pa,obj )
-       elseif  obj.type == "line" then
-          return self: translation_L (obj)
-       elseif obj.type == "triangle" then
-          return self: translation_T (obj)
-       else
-          return self: translation_C (obj)
-       end
-    else
+
+   -- If only one object is passed
+   if nb == 1 then
+      if obj.type == "point" then
+         return translation_(self.pb - self.pa, obj)  -- Translate point
+      elseif obj.type == "line" then
+         return self:translation_L(obj)  -- Translate line
+      elseif obj.type == "triangle" then
+         return self:translation_T(obj)  -- Translate triangle
+      elseif obj.type == "circle" then
+         return self:translation_C(obj)  -- Translate circle
+      else
+         error("Unsupported object type for translation")
+      end
+   else
+      -- If multiple objects are passed, translate each one
       t = {}
-       for i=1,tp.n do
-      table.insert(t , translation_ ( self.pb-self.pa , tp[i])) 
-         end
-      return table.unpack ( t )      
-    end
+      for i = 1, nb do
+         -- Translate each object using the translation vector
+         table.insert(t, translation_(self.pb - self.pa, tp[i]))
+      end
+      return table.unpack(t)  -- Return the translated objects
+   end
 end
 
+
 function line: set_translation ( ...)
     return set_translation_ ( self.pb-self.pa,... )
 end
 
-function line: projection (...)
+function line:projection(...)
    local obj,nb,t
    local tp = table.pack(...)
    obj = tp[1]
@@ -246,7 +250,7 @@
     end
 end
 
-function line: set_projection (...)
+function line:set_projection(...)
 	local tp = table.pack(...)
 	local i
     local t = {}
@@ -256,31 +260,31 @@
   return table.unpack ( t )
 end
 
-function line: symmetry_axial_L ( obj )
+function line:symmetry_axial_L( obj )
    local pa,pb,x,y
    pa = obj.pa
    pb = obj.pb
-   x,y = self:set_reflection ( pa,pb )
+   x,y = self:set_reflection(pa, pb)
    return line : new  (x,y)
 end
-function line: symmetry_axial_T ( obj )
+function line:symmetry_axial_T( obj )
    local pa,pb,pc,x,y,z
    pa    = obj.pa
    pb    = obj.pb
    pc    = obj.pc
-   x,y,z = self:set_reflection ( pa,pb,pc )
+   x,y,z = self:set_reflection (pa, pb, pc)
    return triangle : new  (x,y,z)
 end
 
-function line: symmetry_axial_C ( obj )
+function line:symmetry_axial_C( obj )
    local pa,pb,x,y
    pa = obj.center
    pb = obj.through
-   x,y = self:set_reflection ( pa,pb )
+   x,y = self:set_reflection( pa,pb )
    return circle : new  (x,y)
 end
 
-function line: reflection (...)
+function line:reflection(...)
    local obj,nb,t
    local tp = table.pack(...)
    obj = tp[1]
@@ -304,7 +308,7 @@
     end
 end
 
-function line: set_reflection (...)
+function line:set_reflection (...)
     return set_symmetry_axial_ ( self.pb,self.pa,... )
 end
 
@@ -311,23 +315,21 @@
 -------------------
 -- Result -> line
 -------------------
-function line: ll_from ( pt )
+function line:ll_from( pt )
 	return line : new (pt,pt+self.pb-self.pa) 
 end
 
-function line: ortho_from ( pt )
+function line:ortho_from( pt )
 	return  line : new (pt+(self.pb-self.pa)*point(0,-1),pt+(self.pb-self.pa)*point(0,1))
 end
 
-function line: mediator () 
-   local m
-   m = midpoint_ (self.pa,self.pb)
+function line:mediator() 
+   local m = midpoint_ (self.pa,self.pb)
   return line : new (rotation_ (m,-math.pi/2,self.pb),rotation_ (m,math.pi/2,self.pb)) 
 end
 
-function line : perpendicular_bisector ()
-   local m
-   m = midpoint_ (self.pa,self.pb)
+function line:perpendicular_bisector ()
+   local  m = midpoint_ (self.pa,self.pb)
   return line : new (rotation_ (m,-math.pi/2,self.pb),rotation_ (m,math.pi/2,self.pb))
 end
 
@@ -334,173 +336,351 @@
 -------------------
 -- Result -> circle
 -------------------
-function line: circle (swap)
-  if swap == nil then
-      swap = false
-  end
+function line:circle(swap)
+  swap = swap or false
   if swap then
-    return circle : new (self.pb,self.pa)
+    return circle:new(self.pb,self.pa)
   else
-    return circle : new (self.pa,self.pb)
+    return circle:new(self.pa,self.pb)
   end
 end
 
-function line: circle_swap ()   
+function line:circle_swap()   
     return circle : new (self.pb,self.pa)
 end
 
-function line : diameter ()
-   local c = midpoint_ (self.pa,self.pb)
-  return circle : new  (c,self.pb)
+function line:diameter()
+   local c = midpoint_(self.pa,self.pb)
+  return circle:new (c,self.pb)
 end
 
-function line : apollonius (k)
+function line:apollonius(k)
    local z1,z2,c
-    z1     = barycenter_ ({self.pa,1},{self.pb,k})
-    z2     = barycenter_ ({self.pa,1},{self.pb,-k})
-    c = midpoint_ (z1,z2)
+    z1     = barycenter_({self.pa,1},{self.pb,k})
+    z2     = barycenter_({self.pa,1},{self.pb,-k})
+    c      = midpoint_ (z1,z2)
   return circle : new  (c,z2)
 end
 
+function line:test(x,y) 
+  
+end
+
+
+-- Circle tangent to a line passing through two points
+-- In general, there are two solutions
+function line:c_l_pp(a, b) -- a and b on the same side
+  -- Initialisation
+  local lab = line:new(a, b) -- Line through a and b
+  local Cab = circle:diameter(a, b) -- Circle with a and b diameters
+  local i = intersection(lab, self) -- Intersection with current line
+ 
+  -- One point on the line  (a)
+   if self : in_out(a)  and not self:in_out(b) then
+    local lmed  = lab : mediator()
+     local laperp = self:ortho_from(a)
+     local o = intersection(lmed,laperp)
+     return circle:new(o,a),
+            circle:new(o,a)
+      end
+      -- One point on the line  (b)
+       if self:in_out(b) and not self:in_out(a) then
+         local lmed  = lab:mediator()
+         local laperp = self:ortho_from(b)
+         local o = intersection(lmed,laperp)
+         return circle:new(o,b),
+                circle:new(o,b)
+       end    
+  -- Check: if the intersection exists and lies on the segment [a, b].
+   if i  and lab:in_out_segment(i) then
+    return nil, nil -- No circle is possible
+   end
+
+  -- If the current line is orthogonal to lab
+  if self:is_orthogonal(lab) then
+    local lmed = lab:mediator() 
+    local m = midpoint(a, b) 
+    local r = length(m, i) 
+    local pt1 = lab:isosceles_s(r)
+    local pt2 = lab:isosceles_s(r, true)
+    return circle:new(pt1, a),
+           circle:new(pt2, a)
+  end
+
+  -- If the two lines are parallel
+  if lab:is_parallel(self) then
+    local mid = midpoint(a, b) -- Midpoint of segment [a, b]
+    local proj = self:projection(mid) -- Mid projection on the running line
+
+    return circle:new(circum_center_(a, b, proj), proj),
+           circle:new(circum_center_(a, b, proj), proj)
+  end
+
+  -- General case
+  local t = Cab:tangent_from(i).pb
+  local x, y = intersection(self, circle:new(i, t))
+  return circle:new(intersection(self:ortho_from(x), lab:mediator()), x),
+         circle:new(intersection(self:ortho_from(y), lab:mediator()), y)
+end
+
+
+-- Circle tangent to two straight lines passing through a given point
+function line:c_ll_p(a, p)
+  
+  -- Compute the bisector of the triangle formed by self.pa, self.pb, and a
+  local lbi = bisector(self.pa, self.pb, a)
+
+  if lbi:in_out(p) then
+    -- Orthogonal projection of p onto the bisector
+    local lp = lbi:ortho_from(p)
+
+    -- Intersection of line from p to its projection with self.pa and self.pb
+    local i = intersection_ll_(p, lp.pb, self.pa, self.pb)
+
+    -- Intersection points of the line with the circle defined by (i, p)
+    local t1, t2 = intersection_lc_(self.pa, self.pb, i, p)
+
+    -- Create the main line and find orthogonal projections from t1 and t2
+    local lab = line:new(self.pa, self.pb)
+    local x = lab:ortho_from(t1).pb
+    local y = lab:ortho_from(t2).pb
+
+    -- Return two circles based on the orthogonal projections and points t1, t2
+    return circle:new(intersection_ll_(x, t1, self.pa, p), t1),
+           circle:new(intersection_ll_(y, t2, self.pa, p), t2)
+  else
+    -- Reflection of p across the bisector
+    local q = lbi : reflection (p)
+
+    -- Compute circles from the Wallis construction
+    local c1, c2 = self:c_l_pp(p, q)
+
+    -- Return two circles with centers and points on their circumference
+    return  c1,c2
+  end
+end
+
+
+
 ----------------------
 -- Result -> triangle
 ----------------------
-function line: equilateral (swap)
-    if swap == nil then
-        swap = false
+function line:equilateral(swap)
+    swap = swap or false
+    if swap then
+        return triangle:new(self.pa, self.pb, rotation_(self.pa, -math.pi / 3, self.pb))
+    else
+        return triangle:new(self.pa, self.pb, rotation_(self.pa, math.pi / 3, self.pb))
     end
-   if swap  then 
-        return triangle : new (self.pa,self.pb,rotation_ (self.pa,-math.pi/3,self.pb))
-    else
-          return triangle : new (self.pa,self.pb,rotation_ (self.pa,math.pi/3,self.pb)) 
 end
-end
 
-function line: isosceles (phi,swap)
-      local pta,ptb
-       if swap == nil then
-       swap = false
-   end
+function line:isosceles(phi,swap)
+  local pta,ptb
+   swap = swap or false
   if swap  then 
-     pta = rotation_ (self.pa,-phi,self.pb)
-     ptb = rotation_ (self.pb,phi,self.pa)
-   return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
+     pta = rotation_(self.pa,-phi,self.pb)
+     ptb = rotation_(self.pb,phi,self.pa)
+   return triangle : new (self.pa,self.pb, intersection_ll_(self.pa,pta,self.pb,ptb ))
   else
-    pta = rotation_ (self.pa,phi,self.pb)
-    ptb = rotation_ (self.pb,-phi,self.pa)
+    pta = rotation_(self.pa,phi,self.pb)
+    ptb = rotation_(self.pb,-phi,self.pa)
   return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
 end
 end
+line.isosceles_a = line.isosceles
 
-function line: two_angles (alpha,beta)
+function line:isosceles_s(a,swap)
+     local c1,c2,pta,ptb,pt1,pt2
+  c1 = circle : radius (self.pa,a)
+  c2 = circle : radius (self.pb,a)
+  pta,ptb = intersection_cc (c1,c2)
+   if get_angle(self.pa,self.pb,pta) < get_angle(self.pa,self.pb,ptb) then
+     pt1=pta pt2=ptb
+      else  pt1=ptb pt2=pta end  
+   swap = swap or false
+  if swap  then
+   return triangle : new (self.pa,self.pb,pt2 )
+  else
+  return triangle : new (self.pa,self.pb,pt1)
+end
+end
+
+function line:two_angles(alpha,beta,swap)
    local pta,ptb,pt
-   pta = rotation_ (self.pa,alpha,self.pb)
-   ptb = rotation_ (self.pb,-beta,self.pa)
-   pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
-   return triangle : new (self.pa,self.pb,pt)
+   swap = swap or false
+   if swap  then 
+     pta = rotation_(self.pa,-alpha,self.pb)
+     ptb = rotation_(self.pb,beta,self.pa)
+   else
+   pta = rotation_(self.pa,alpha,self.pb)
+   ptb = rotation_(self.pb,-beta,self.pa)
+ end
+   pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+   return triangle:new(self.pa,self.pb,pt)
 end
 
-function line: school ()
+function line:school(swap)
    local pta,ptb,pt
-   pta = rotation_ (self.pa,math.pi/6,self.pb)
-   ptb = rotation_ (self.pb,-math.pi/3,self.pa)
-   pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
-   return triangle : new (self.pa,self.pb,pt)
+   swap = swap or false
+   if swap  then 
+     pta = rotation_(self.pa,-math.pi/6,self.pb)
+     ptb = rotation_(self.pb,math.pi/3,self.pa)
+   else
+   pta = rotation_(self.pa,math.pi/6,self.pb)
+   ptb = rotation_(self.pb,-math.pi/3,self.pa)
+   end
+   pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+   return triangle:new(self.pa,self.pb,pt)
 end
 
-function line: half ()
+function line:half(swap)
    local x,pt
    x  = midpoint_(self.pa,self.pb)
-   pt = rotation_ (self.pb,-math.pi/2,x)
-   return triangle : new (self.pa,self.pb,pt)
+   swap = swap or false
+   if swap  then 
+    pt = rotation_(self.pb,math.pi/2,x)  
+   else
+   pt = rotation_(self.pb,-math.pi/2,x)
+    end
+   return triangle:new(self.pa,self.pb,pt)
 end
 
-function line: sss (a,b)
+function line:sss(a,b,swap)
    local pta,ptb,i,j
+   swap = swap or false
     pta = self.pa + point ( a,  0 )
     ptb = self.pb + point ( -b , 0)
     i,j = intersection_cc_ (self.pa,pta,self.pb,ptb)
-   return triangle : new (self.pa,self.pb,i),triangle : new (self.pa,self.pb,j)
+       if swap  then 
+   return triangle : new (self.pa,self.pb,j)
+ else 
+   return triangle : new (self.pa,self.pb,i)
+ end
 end
 
-function line: ssa (a,phi)
-   local x,y,pt
-    x = rotation_ (self.pb,-phi,self.pa)
-    y = self.pa + polar_ ( a , self.slope)
-    i,j = intersection_lc_ (self.pb,x,self.pa,y)
-   return triangle : new (self.pa,self.pb,i),triangle : new (self.pa,self.pb,j)
+function line:ssa(a, phi,swap)
+    local x, y, i, j
+     swap = swap or false
+    x = rotation_(self.pb, -phi, self.pa)
+    y = self.pa + polar_(a, self.slope)
+    i, j = intersection_lc_(self.pb, x, self.pa, y)
+    if swap  then  
+     return  triangle:new(self.pa, self.pb, j)
+    else
+      return triangle:new(self.pa, self.pb, i)
+    end
 end
 
-function line: sas (a,phi)
-   local x,pt
-    x  = self.pa + polar_ ( a , self.slope)
-    pt = rotation_ (self.pa,phi,x)
-   return triangle : new (self.pa,self.pb,pt)
+function line:sas(a, phi,swap)
+    local x, pt
+    swap = swap or false
+    x = self.pa + polar_(a, self.slope)
+     if swap  then 
+        pt = rotation_(self.pa, -phi, x) 
+     else
+     pt = rotation_(self.pa, phi, x)
+  end
+   return triangle:new(self.pa, self.pb, pt)
 end
 
-function line: asa (alpha,beta)
+function line:asa(alpha,beta,swap)
    local pta,ptb,pt
+   swap = swap or false
+    if swap  then 
+      pta = rotation_ (self.pa,-alpha,self.pb)
+      ptb = rotation_ (self.pb,beta,self.pa)
+    else
    pta = rotation_ (self.pa,alpha,self.pb)
    ptb = rotation_ (self.pb,-beta,self.pa)
-   pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
+ end
+ pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
    return triangle : new (self.pa,self.pb,pt)
 end
 ---- sacred triangles ----
 
-function line: gold (swap)
+function line:gold(swap)
     local pt
-     if swap == nil then
-     swap = false
- end
-if swap  then  
-   pt = rotation_ (self.pa,-math.pi/2,self.pb)
-    return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
-else
-    pt = rotation_ (self.pa,math.pi/2,self.pb)
-     return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+     swap = swap or false
+     if swap  then  
+        pt = rotation_ (self.pa,-math.pi/2,self.pb)
+      return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+    else
+         pt = rotation_ (self.pa,math.pi/2,self.pb)
+      return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+    end
 end
-end
 
-function line: sublime ()
+function line:sublime(swap)
    local pta,ptb,pt
-  pta = rotation_ (self.pa,2*math.pi/5,self.pb)
-  ptb = rotation_ (self.pb,-2*math.pi/5,self.pa)
-  pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
-  return triangle : new (self.pa,self.pb,pt)
+   swap = swap or false
+   if swap  then  
+     pta = rotation_(self.pa,-2*math.pi/5,self.pb)
+     ptb = rotation_(self.pb,2*math.pi/5,self.pa)
+     pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+     return triangle:new(self.pa,self.pb,pt)
+   else
+  pta = rotation_(self.pa,2*math.pi/5,self.pb)
+  ptb = rotation_(self.pb,-2*math.pi/5,self.pa)
+  pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+  return triangle:new(self.pa,self.pb,pt)
 end
+end
 
 line.euclid = line.sublime
 
-function line: euclide (swap)
- if swap == nil then
-   return triangle : new (self.pa,self.pb, rotation_ (self.pa,math.pi/5,self.pb))
-  else  
-     return triangle : new (self.pa,self.pb, rotation_ (self.pa,-math.pi/5,self.pb))
-   end
+function line:euclide (swap)
+  swap = swap or false
+  if swap  then  
+     return triangle : new (self.pa,self.pb, rotation_(self.pa,-math.pi/5,self.pb))
+  else
+     return triangle : new (self.pa,self.pb, rotation_(self.pa,math.pi/5,self.pb))
+     end
   end
 
-function line: divine ()
-   local pta,ptb,pt,h
-   pta = rotation_ (self.pa,math.pi/5,self.pb)
-   ptb = rotation_ (self.pb,-math.pi/5,self.pa)
-   pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
-   return triangle : new (self.pa,self.pb,pt)
+  function line:divine(swap)
+      local pta, ptb, pt
+      swap = swap or false
+      if swap  then  
+        pta = rotation_(self.pa, -math.pi / 5, self.pb)
+        ptb = rotation_(self.pb, math.pi / 5, self.pa)
+        pt = intersection_ll_(self.pa, pta, self.pb, ptb)
+        return triangle:new(self.pa, self.pb, pt)
+      else
+      pta = rotation_(self.pa, math.pi / 5, self.pb)
+      ptb = rotation_(self.pb, -math.pi / 5, self.pa)
+      pt = intersection_ll_(self.pa, pta, self.pb, ptb)
+      return triangle:new(self.pa, self.pb, pt)
+    end
+  end
+
+function line:cheops(swap)
+    local m, n, pt
+    m = midpoint_(self.pa, self.pb)
+    swap = swap or false
+    if swap  then 
+      n = rotation_(m, math.pi / 2, self.pa)
+     pt = m + (n - m) * tkzsqrtphi 
+else
+      n = rotation_(m, -math.pi / 2, self.pa)
+     pt = m + (n - m) * tkzsqrtphi
+  end
+    return triangle:new(self.pa, self.pb, pt)
 end
 
-function line: cheops ()
-   local m,n,pt
-   m = midpoint_ (self.pa,self.pb)
-   n = rotation_ (m,- math.pi/2,self.pa)
-   pt = m + (n-m)* tkzsqrtphi
-   return triangle : new (self.pa,self.pb,pt)
+
+function line:egyptian(swap)
+    local n, pt
+    swap = swap or false
+    if swap  then 
+      n = rotation_(self.pb, math.pi / 2, self.pa)
+      pt = self.pb + (n - self.pb) / point.mod(n - self.pb) * self.length * 0.75
+   else  
+    n = rotation_(self.pb, -math.pi / 2, self.pa)
+    pt = self.pb + (n - self.pb) / point.mod(n - self.pb) * self.length * 0.75
+  end
+    return triangle:new(self.pa, self.pb, pt)
 end
 
-function line: egyptian ()
-   local n,pt
-    n = rotation_ (self.pb,- math.pi/2,self.pa)
-    pt = self.pb + (n-self.pb)/point.mod(n-self.pb)*self.length* 0.75
-   return triangle : new (self.pa,self.pb,pt)
-end
 line.pythagoras = line.egyptian
 line.isis = line.egyptian
 line.golden = line.sublime
@@ -509,12 +689,14 @@
 ------------------------------
 -- Result -> square
 ------------------------------
-function line: square (swap)
-   if swap == nil  
+function line:square (swap)
+   swap = swap or false
+   if swap  
    then
-      return square : side (self.pa,self.pb)
+      return square : side (self.pa,self.pb,indirect)
    else
-      return square : side (self.pa,self.pb,indirect)
+        return square : side (self.pa,self.pb)
+   
    end
 end
 

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_main.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_main.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_main.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements-main.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_matrices.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_matrices.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_matrices.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_matrices.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -44,26 +44,37 @@
   return add_matrix(m1,k_mul_matrix(-1, m2))
 end
 
-function matrix.__pow( m, num )
-  if num =='T' then 
-  return transposeMatrix(m)
-  else
-	if num == 0 then
-		return matrix:new( #m,"I" )
-	end
-	if num < 0 then
-		local i; m,i = inv_matrix ( m )
-      if not m then return m, i end
-		num = -num
-	end
-	local mt = m
-	for i = 2,num	do
-		mt = mul_matrix(mt,m)
-	end
-	return mt
+function matrix.__pow(m, num)
+   -- Handle transpose (when num is 'T')
+   if num == 'T' then
+      return transposeMatrix(m)
+   end
+
+   -- Handle exponentiation by 0 (returns the identity matrix)
+   if num == 0 then
+      return matrix:new(#m, "I")  -- Identity matrix
+   end
+
+   -- Handle negative exponents (invert the matrix)
+   if num < 0 then
+      local inv_matrix, err = inv_matrix(m)
+      if not inv_matrix then 
+         return nil, err  -- Return nil and the error if matrix is non-invertible
+      end
+      num = -num  -- Make exponent positive for easier handling
+      m = inv_matrix  -- Now use the inverted matrix
+   end
+
+   -- Now handle the positive exponentiation
+   local result = m
+   for i = 2, num do
+      result = mul_matrix(result, m)  -- Repeated multiplication
+   end
+
+   return result
 end
-end
 
+
 function matrix.__tostring( A )
   local mt = (A.type=='matrix' and A.set or A)
 	local k = {}

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_misc.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_misc.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_misc.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_functions_maths.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -14,20 +14,32 @@
 -- ----------------------------------------------------------------
 -- 
 -- ----------------------------------------------------------------
-function get_points (obj)
-if obj.type == 'line' then return   obj.pa,obj.pb
- elseif
-  obj.type  == 'triangle' then return   obj.pa,obj.pb,obj.pc
-  elseif 
-  obj.type == 'circle' then   return obj.center,obj.through
-  elseif 
-  obj.type == 'ellipse' then   return obj.pc,obj.pa,obj.pb
-  elseif 
-  obj.type == 'square' or obj.type == 'rectangle' or obj.type == 'quadrilateral' or obj.type == 'parallelogram'
-  then   return obj.pa,obj.pb,obj.pc,obj.pd
-end
-end
+function get_points(obj)
+   -- Map of object types to their respective point keys
+   local point_map = {
+      line = {"pa", "pb"},                          -- Line has two points
+      triangle = {"pa", "pb", "pc"},               -- Triangle has three points
+      circle = {"center", "through"},              -- Circle has center and a point through its circumference
+      ellipse = {"pc", "pa", "pb"},                -- Ellipse has three key points
+      square = {"pa", "pb", "pc", "pd"},           -- Square has four vertices
+      rectangle = {"pa", "pb", "pc", "pd"},        -- Rectangle has four vertices
+      quadrilateral = {"pa", "pb", "pc", "pd"},    -- Quadrilateral has four vertices
+      parallelogram = {"pa", "pb", "pc", "pd"}     -- Parallelogram has four vertices
+   }
 
+   -- Check if the object's type is recognized
+   if point_map[obj.type] then
+      local points = {}
+      -- Iterate over the keys for the given type and extract the corresponding values
+      for _, key in ipairs(point_map[obj.type]) do
+         table.insert(points, obj[key])
+      end
+      -- Return all points as multiple return values
+      return table.unpack(points)
+   end
+ end
+
+
 function set_lua_to_tex (t)
    for k,v in pairs(t) do
     token.set_macro(v,_ENV[v],'global')
@@ -35,25 +47,36 @@
 end  
 
 function bisector (a,b,c)
-   local i
-      i = in_center_ (a,b,c)
+   local i = in_center_ (a,b,c)   
    return  line : new (a,intersection_ll_ (a,i,b,c))
 end
 
-function altitude (a,b,c)
-   local o,p 
-   o = ortho_center_ (a,b,c)
-   p = projection_ (b,c,a)
-   return  line : new (a,p) 
+function altitude(a, b, c)
+   local o, p
+   -- Get the orthocenter (which is the point of concurrency of the altitudes)
+   o = ortho_center_(a, b, c)
+   
+   -- Get the perpendicular projection of point 'a' onto the line defined by 'b' and 'c'
+   p = projection_(b, c, a)
+   
+   -- Return the altitude, which is the line from point 'a' to the point 'p'
+   return line:new(a, p)
 end
 
-function  bisector_ext(a,b,c)   -- n =1 swap n=2 2 swap
- local i,p
-    i = in_center_ (a,b,c)
-    p = rotation_ (a,math.pi/2,i)
-   return line : new (a,p)
+
+function bisector_ext(a, b, c) -- n=1 swap n=2 swap 2
+    local i, p
+    -- Get the incenter of the triangle
+    i = in_center_(a, b, c)
+    
+    -- Rotate the incenter by 90 degrees around point 'a' to compute the external bisector
+    p = rotation_(a, math.pi / 2, i)
+    
+    -- Return the external bisector as the line passing through points 'a' and 'p'
+    return line:new(a, p)
 end
 
+
 function equilateral (a,b)
    return equilateral_tr_ (a,b)
 end
@@ -60,4 +83,13 @@
 
 function midpoint (a,b)
     return (a+b)/2
+end
+
+function midpoints (...)
+    return midpoints_(...)
+end
+
+
+function length(a,b)
+  return  point.abs (a-b)
 end
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_parallelogram.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_parallelogram.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_parallelogram.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_parallelogram.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_point.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_point.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_point.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_point.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -252,28 +252,28 @@
 --     return symmetry_ (self ,pt)
 -- end
 
-function point: symmetry (...)
-   local obj,nb,t
-   local tp = table.pack(...)
-   obj = tp[1]
-   nb = tp.n
-    if nb == 1 then
-       if obj.type == "point" then
-          return symmetry_ (self,obj)
-       elseif  obj.type == "line" then
-         return line: new (set_symmetry_ (self,obj.pa,obj.pb))
-       elseif  obj.type == "circle" then
-          return circle: new (set_symmetry_ (self,obj.center,obj.through))
-       else
-         return triangle: new (set_symmetry (self,obj.pa,obj.pb,obj.pc)) 
-       end
-    else
-       local t = {}
-       for i=1,tp.n do
-           table.insert( t , symmetry_ (self , tp[i])  ) 
-        end
-     return table.unpack ( t )      
-    end
+function point:symmetry(...)
+   local tp = table.pack(...)  -- Pack arguments into a table
+   local nb = tp.n  -- Number of arguments
+   local obj = tp[1]  -- The first object in the arguments
+
+   if nb == 1 then  -- If there's only one argument
+      if obj.type == "point" then
+         return symmetry_(self, obj)  -- Apply symmetry on the point
+      elseif obj.type == "line" then
+         return line:new(set_symmetry_(self, obj.pa, obj.pb))  -- Create a new line
+      elseif obj.type == "circle" then
+         return circle:new(set_symmetry_(self, obj.center, obj.through))  -- Create a new circle
+      else
+         return triangle:new(set_symmetry(self, obj.pa, obj.pb, obj.pc))  -- Create a new triangle
+      end
+   else  -- If there are multiple arguments
+      local results = {}  -- Initialize a table to store results
+      for i = 1, nb do
+         table.insert(results, symmetry_(self, tp[i]))  -- Apply symmetry on each object
+      end
+      return table.unpack(results)  -- Return the results as separate values
+   end
 end
 
 function point: set_symmetry (...)
@@ -288,56 +288,56 @@
  return set_rotation_ ( self,angle,... )
 end
 
-function point : rotation (angle,...)
-   local obj,nb,t
-   local tp = table.pack(...)
-   obj = tp[1]
-   nb = tp.n
-    if nb == 1 then
-       if obj.type == "point" then
-      return rotation_ (self,angle,obj )
-       elseif  obj.type == "line" then
-   return line : new  (set_rotation_ (self, angle,obj.pa,obj.pb ))
-       elseif obj.type == "triangle" then
-   return triangle: new (set_rotation_ (self, angle,obj.pa,obj.pb,obj.pc))
-       elseif obj.type == "circle" then
-return circle : new  (set_rotation_ (self,angle,obj.center,obj.through))
-       else 
-return square: new (set_rotation_(self,angle,obj.pa,obj.pb,obj.pc,obj.pd))
-       end
-    else
-        t = {}
-        for i=1,tp.n do
-            table.insert( t , rotation_ ( self,angle,tp[i]))
-         end
-      return table.unpack ( t )
-     end
+function point:rotation(angle, ...)
+   local tp = table.pack(...)  -- Pack arguments into a table
+   local nb = tp.n  -- Number of arguments
+   local obj = tp[1]  -- The first object in the arguments
+
+   if nb == 1 then  -- If there's only one argument
+      if obj.type == "point" then
+         return rotation_(self, angle, obj)  -- Rotate the point
+      elseif obj.type == "line" then
+         return line:new(set_rotation_(self, angle, obj.pa, obj.pb))  -- Rotate the line
+      elseif obj.type == "triangle" then
+         return triangle:new(set_rotation_(self, angle, obj.pa, obj.pb, obj.pc))  -- Rotate the triangle
+      elseif obj.type == "circle" then
+         return circle:new(set_rotation_(self, angle, obj.center, obj.through))  -- Rotate the circle
+      else  -- For other shapes like square
+         return square:new(set_rotation_(self, angle, obj.pa, obj.pb, obj.pc, obj.pd))  -- Rotate the square
+      end
+   else  -- If there are multiple arguments
+      local results = {}  -- Initialize a table to store results
+      for i = 1, nb do
+         table.insert(results, rotation_(self, angle, tp[i]))  -- Rotate each object
+      end
+      return table.unpack(results)  -- Return the results as separate values
+   end
 end
 
-function point : homothety (coeff,...)
-local obj,nb,t
-local tp = table.pack(...)
-obj = tp[1]
-nb = tp.n
- if nb == 1 then
-   if obj.type == "point" then
-      return homothety_ (self,coeff,obj )
-   elseif  obj.type == "line" then
-      return line : new  (set_homothety_ (self, coeff,obj.pa,obj.pb ))
-   elseif obj.type == "triangle" then
-     return triangle: new (set_homothety_(self,coeff,obj.pa,obj.pb,obj.pc))
-   elseif obj.type == "circle" then
-    return circle: new  (set_homothety_(self,coeff,obj.center,obj.through))
-   else
-return square: new (set_homothety_(self,coeff,obj.pa,obj.pb))    
-       end
-    else
-        t = {}
-        for i=1,tp.n do
-            table.insert( t , homothety_ ( self,coeff,tp[i]))
-         end
-      return table.unpack ( t )
-     end
+function point:homothety(coeff, ...)
+    local tp = table.pack(...)  -- Pack arguments into a table
+    local nb = tp.n  -- Number of arguments
+    local obj = tp[1]  -- The first object in the arguments
+    local t = {}  -- Initialize a table to store results
+
+    if nb == 1 then  -- If there's only one argument
+        if obj.type == "point" then
+            return homothety_(self, coeff, obj)  -- Apply homothety to the point
+        elseif obj.type == "line" then
+            return line:new(set_homothety_(self, coeff, obj.pa, obj.pb))  -- Apply homothety to the line
+        elseif obj.type == "triangle" then
+            return triangle:new(set_homothety_(self, coeff, obj.pa, obj.pb, obj.pc))  -- Apply homothety to the triangle
+        elseif obj.type == "circle" then
+            return circle:new(set_homothety_(self, coeff, obj.center, obj.through))  -- Apply homothety to the circle
+        else  -- For other shapes like square
+            return square:new(set_homothety_(self, coeff, obj.pa, obj.pb, obj.pc, obj.pd))  -- Apply homothety to the square
+        end
+    else  -- If there are multiple arguments
+        for i = 1, nb do
+            table.insert(t, homothety_(self, coeff, tp[i]))  -- Apply homothety to each object
+        end
+        return table.unpack(t)  -- Return the results as separate values
+    end
 end
 
 function point: normalize()
@@ -345,16 +345,19 @@
    return point(self.re/d,self.im/d)
 end
 
-function point: orthogonal(d)
+function point:orthogonal(d)
    local m
-   if d==nil then
-   return point(-self.im,self.re)
-else
-   m = point.mod(self)
-   return point(-self.im*d/m,self.re*d/m)
+   if d == nil then
+      -- If no scaling factor d is provided, return the point rotated 90 degrees counterclockwise
+      return point(-self.im, self.re)
+   else
+      -- If a scaling factor d is provided, scale the orthogonal point
+      m = point.mod(self)  -- Get the modulus (magnitude) of the current point
+      return point(-self.im * d / m, self.re * d / m)  -- Return the scaled orthogonal point
+   end
 end
-end
 
+
 function point : at (z)
    return point(self.re+z.re,self.im+z.im)
 end

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_quadrilateral.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_quadrilateral.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_quadrilateral.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_quadrilateral.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_rectangle.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_rectangle.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_rectangle.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements-rectangle.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -24,34 +24,34 @@
    end
    if math.abs(point.abs (zc-za)-point.abs (zd-zb)) < tkz_epsilon  then  else error ("it's not a rectangle")    
    end
-   local type               = 'rectangle'
-   local center             = midpoint_ (za,zc)
-   local exradius           = point.abs (center-za)
-   local ab                 = line : new (za,zb)
-   local bc                 = line : new (zb,zc)
-   local cd                 = line : new (zc,zd)
-   local da                 = line : new (zd,za)
-   local ac                 = line : new (za,zc)
-   local bd                 = line : new (zb,zd)
-   local length             = point.mod (zb-za)
-   local width              = point.mod (zd-za)
-   local diagonal           = point.abs (zc-za)
-   local o  = {   pa        = za, 
-                  pb        = zb, 
-                  pc        = zc,
-                  pd        = zd,
-                  ab        = ab,
-                  ac        = ac,
-                  bc        = bc,
-                  da        = da,
-                  cd        = cd,
-                  bd        = bd,
-                  diagonal  = diagonal,
-                  exradius  = exradius,
-                  center    = center,
-                  length    = length,
-                  width     = width,
-                  type      = type  }
+   local type                   = 'rectangle'
+   local center                 = midpoint_ (za,zc)
+   local circumradius           = point.abs (center-za)
+   local ab                     = line : new (za,zb)
+   local bc                     = line : new (zb,zc)
+   local cd                     = line : new (zc,zd)
+   local da                     = line : new (zd,za)
+   local ac                     = line : new (za,zc)
+   local bd                     = line : new (zb,zd)
+   local length                 = point.mod (zb-za)
+   local width                  = point.mod (zd-za)
+   local diagonal               = point.abs (zc-za)
+   local o  = {   pa            = za, 
+                  pb            = zb, 
+                  pc            = zc,
+                  pd            = zd,
+                  ab            = ab,
+                  ac            = ac,
+                  bc            = bc,
+                  da            = da,
+                  cd            = cd,
+                  bd            = bd,
+                  diagonal      = diagonal,
+                  circumradius  = circumradius,
+                  center        = center,
+                  length        = length,
+                  width         = width,
+                  type          = type  }
     setmetatable(o, self)
     self.__index = self
     return o
@@ -69,7 +69,7 @@
  local zc,zd
  local a     = point.arg (zb-za)
  local d     = point.abs(zb-za)/tkzphi
- if swap == nil then swap = false end
+ swap = swap or false
  if swap  then 
      zc    = zb : south (d/scale)
      zc    = rotation_ (zb,a,zc)
@@ -87,7 +87,7 @@
 
 function rectangle : diagonal  (za,zc,swap)
    local zb,zd
-   if swap == nil then swap = false end
+    swap = swap or false
    if swap  then 
       zd   = point (zc.re,za.im)
       zb   = point (za.re,zc.im)
@@ -102,7 +102,7 @@
 function rectangle : side  (za,zb,d,swap)
    local a,zc,zd
     a  = point.arg (zb-za)
-    if swap == nil then swap = false end
+     swap = swap or false
     if swap  then 
        zc = zb : south (d/scale)
        zc = rotation_ (zb,a,zc)

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_regular.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -11,7 +11,7 @@
 -- version 2005/12/01 or later.
 -- This work has the LPPL maintenance status “maintained”.
 -- The Current Maintainer of this work is Alain Matthes.
-
+-- za = center zb a vertex
 regular_polygon = {}
 function regular_polygon: new (za, zb ,nb)
    local type              = 'regular_polygon'
@@ -19,17 +19,19 @@
    local center            = za
    local through           = zb
    local angle             = 2 * math.pi/nb
-   local exradius          = point.abs (zb-za)
+   local circumradius      = point.abs (zb-za)
    local circle            = circle : new (za,zb)
-   local inradius          = exradius * math.cos(math.pi/nb)
-   local side              = exradius * math.sin(math.pi/nb)
+   local inradius          = circumradius * math.cos(math.pi/nb)
+   local side              = circumradius * math.sin(math.pi/nb)
    local next              = table[2]
    local first             = table[1]
    local proj              = projection_ (first,next,za)
+   local perimeter         = nb * side
+   local area              = (perimeter * inradius)/2
    local o = { type        = type, 
                center      = center, 
                through     = through,
-               exradius    = exradius, 
+               circumradius= circumradius, 
                inradius    = inradius,
                table       = table, 
                circle      = circle, 
@@ -36,7 +38,9 @@
                nb          = nb,
                angle       = angle, 
                side        = side, 
-               proj        = proj }
+               proj        = proj,
+               perimeter   = perimeter,
+               area        = area}
     setmetatable(o, self)
     self.__index = self
     return o

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_square.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_square.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_square.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements-square.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -27,38 +27,42 @@
    if math.abs(point.abs (zb-za) - point.abs (zd-za)) < tkz_epsilon  then  else error ("it's not a square (side)")
    end
 
-   local type              = 'square'
-   local side              = point.abs ( zb - za )
-   local pc                = rotation_ (zb,-math.pi/2,za)
-   local pd                = rotation_ (za,math.pi/2,zb)
-   local center            = midpoint_ (za,zc)
-   local exradius          = point.abs (center-za)
-   local inradius          = exradius * math.cos(math.pi/4)
-   local diagonal          = math.sqrt(2) * side
-   local proj              = projection_ (za,zb,center)
-   local ab                = line : new (za,zb)
-   local bc                = line : new (zb,zc)
-   local cd                = line : new (zc,zd)
-   local da                = line : new (zd,za)
-   local bd                = line : new (zb,zd)
-   local ac                = line : new (za,zc)
-   local o  = {   pa       = za, 
-                  pb       = zb, 
-                  pc       = zc,
-                  pd       = zd,
-                  side     = side,
-                  center   = center,
-                  exradius = exradius,
-                  inradius = inradius,
-                  diagonal = diagonal,
-                  proj     = proj,
-                  ab       = ab,
-                  ac       = ac,
-                  bc       = bc,
-                  da       = da,
-                  cd       = cd,
-                  bd       = bd,
-                  type     = type  }
+   local type                  = 'square'
+   local side                  = point.abs ( zb - za )
+   local pc                    = rotation_ (zb,-math.pi/2,za)
+   local pd                    = rotation_ (za,math.pi/2,zb)
+   local center                = midpoint_ (za,zc)
+   local circumradius          = point.abs (center-za)
+   local inradius              = circumradius * math.cos(math.pi/4)
+   local diagonal              = math.sqrt(2) * side
+   local proj                  = projection_ (za,zb,center)
+   local ab                    = line : new (za,zb)
+   local bc                    = line : new (zb,zc)
+   local cd                    = line : new (zc,zd)
+   local da                    = line : new (zd,za)
+   local bd                    = line : new (zb,zd)
+   local ac                    = line : new (za,zc)
+   local area                  = side * side
+   local perimeter             = 4 * side
+   local o  = {   pa           = za, 
+                  pb           = zb, 
+                  pc           = zc,
+                  pd           = zd,
+                  side         = side,
+                  center       = center,
+                  circumradius = circumradius,
+                  inradius     = inradius,
+                  diagonal     = diagonal,
+                  proj         = proj,
+                  ab           = ab,
+                  ac           = ac,
+                  bc           = bc,
+                  da           = da,
+                  cd           = cd,
+                  bd           = bd,
+                  type         = type,
+                  area         = area,
+                  perimeter    = perimeter  }
     setmetatable(o, self)
     self.__index = self
     return o
@@ -71,16 +75,20 @@
    return square : new (za,zb,zc,zd)
 end
 
-function square : side (za,zb,swap)
-   if swap == nil 
-    then
-      local zc = rotation_ (zb,-math.pi/2,za)
-      local zd = rotation_ (za,math.pi/2,zb)
-       return square : new (za,zb,zc,zd)
+function square:side(za, zb, swap)
+   swap = swap or false
+   if swap  then
+      -- Rotate zb clockwise around za to get zc
+      local zc = rotation_(zb, math.pi / 2, za)
+      -- Rotate za counterclockwise around zb to get zd
+      local zd = rotation_(za, -math.pi / 2, zb)
+      return square:new(za, zb, zc, zd)
     else
-       local zc = rotation_ (zb,math.pi/2,za)
-       local zd = rotation_ (za,-math.pi/2,zb)
-       return square : new (za,zb,zc,zd) 
+      -- Rotate zb counterclockwise around za to get zc
+      local zc = rotation_(zb, -math.pi / 2, za)
+      -- Rotate za clockwise around zb to get zd
+      local zd = rotation_(za, math.pi / 2, zb)
+      return square:new(za, zb, zc, zd)
    end
 end
 

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_triangle.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_triangle.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_triangle.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_triangles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3
@@ -30,6 +30,10 @@
    local ab                      = line : new (za,zb)
    local ca                      = line : new (zc,za)
    local bc                      = line : new (zb,zc)
+   local semiperimeter           = (a+b+c)/2
+   local area                    = math.sqrt((semiperimeter)*(semiperimeter-a)*(semiperimeter-b)*(semiperimeter-c))
+   local inradius                = area / semiperimeter
+   local circumradius            = (a*b*c)/(4*inradius*semiperimeter)
    local o = {  pa               = za, 
                 pb               = zb, 
                 pc               = zc, 
@@ -48,7 +52,11 @@
                 bc               = bc,
                 alpha            = alpha, 
                 beta             = beta, 
-                gamma            = gamma}
+                gamma            = gamma,
+                semiperimeter    = semiperimeter,
+                area             = area,
+                inradius         = inradius,
+                circumradius     = circumradius}
     setmetatable(o, self)
     self.__index = self
     return o
@@ -110,24 +118,25 @@
    return midpoint_ ( H,self.pa ), midpoint_ ( H,self.pb ), midpoint_ ( H,self.pc )
 end
 
-function triangle: nine_points ()
-   local H,ma,mb,mc,H,ha,hb,hc
-    ma,mb,mc = medial_tr_  (  self.pa , self.pb , self.pc)
-    ha,hb,hc = orthic_tr_  (  self.pa , self.pb , self.pc)
-     H = ortho_center_ ( self.pa , self.pb , self.pc )
-    return
-    ma,mb,mc,
-    ha,hb,hc,
-    midpoint_ ( H,self.pa ),
-    midpoint_ ( H,self.pb ),
-    midpoint_ ( H,self.pc )
+function triangle:nine_points()
+    local ma, mb, mc, ha, hb, hc, H
+    -- Calculate the medial triangle
+    ma, mb, mc = medial_tr_(self.pa, self.pb, self.pc)
+    -- Calculate the orthic triangle
+    ha, hb, hc = orthic_tr_(self.pa, self.pb, self.pc)
+    -- Calculate the orthocenter
+    H = ortho_center_(self.pa, self.pb, self.pc)
+    
+    -- Return the points of the nine-point circle
+    return ma, mb, mc, ha, hb, hc,
+           midpoint_(H, self.pa), midpoint_(H, self.pb), midpoint_(H, self.pc)
 end
 
+
 function triangle : point (t)
-   local t1,t2,p
-   p = (self.a + self.b + self.c)
-   t1 = self.a / p
-   t2 = (self.a + self.b) / p
+  local p = (self.a + self.b + self.c)
+  local t1 = self.a / p
+  local t2 = (self.a + self.b) / p
    if t<= t1 then  
       return self.ab : point (t/t1) 
    elseif t <= t2 then
@@ -163,11 +172,10 @@
 end
 
 function triangle: symmedian_line (n)
-   local a,b,c,l
-   a = self.pa
-   b = self.pb
-   c = self.pc
-   l = self : lemoine_point ()
+   local a = self.pa
+   local b = self.pb
+   local c = self.pc
+   local l = self : lemoine_point ()
    if n==1 then 
            return line : new (b,intersection_ll_ (b,l,a,c)) 
     elseif n==2 then
@@ -184,23 +192,22 @@
    c = self.pc
    o = ortho_center_ (a,b,c)
    if n==1 then 
-      p = projection_ (a,c,b)
+        p = projection_ (a,c,b)
            return line : new (b,p)
     elseif n==2 then
         p = projection_ (a,b,c)
            return line : new (c,p)
      else
-         p = projection_ (b,c,a)
+        p = projection_ (b,c,a)
            return  line : new (a,p) 
     end
 end
 
 function triangle: bisector (n)
-   local a,b,c,i
-      a = self.pa
-      b = self.pb
-      c = self.pc
-      i = in_center_ (a,b,c)
+    local  a = self.pa
+    local  b = self.pb
+    local  c = self.pc
+    local  i = in_center_ (a,b,c)
       if n==1 then
               return line : new (b,intersection_ll_ (b,i,a,c))
        elseif n==2 then
@@ -211,10 +218,9 @@
 end
 
 function triangle: bisector_ext(n)   -- n =1 swap n=2 2 swap
-local a,b,c
-   a = self.pa
-   b = self.pb
-   c = self.pc
+ local  a = self.pa
+ local  b = self.pb
+ local  c = self.pc
  if n==1 then -- ac
          return line : new (b,bisector_ext_ (b,c,a))
   elseif n==2 then -- ab
@@ -254,21 +260,21 @@
 -----------------------
 --- Result -> circles --
 -----------------------
-function triangle: euler_circle ()
+function triangle:euler_circle()
    return circle : new (euler_center_ ( self.pa , self.pb , self.pc),midpoint_( self.pb , self.pc))
 end
 
-function triangle: circum_circle()
+function triangle:circum_circle()
 return   circle : new (circum_circle_ ( self.pa , self.pb , self.pc), self.pa )
 end
 
-function triangle: in_circle ()
+function triangle:in_circle()
    local o
    o = in_center_ ( self.pa , self.pb , self.pc)
 return  circle : new  (o, projection_ (self.pb , self.pc,o) )
 end
 
-function triangle: ex_circle (n)   -- n =1 swap n=2 2 swap
+function triangle:ex_circle (n)   -- n =1 swap n=2 2 swap
    local a,b,c,o
    a = self.pa
    b = self.pb
@@ -505,5 +511,42 @@
     end
 end
 
+-- Circle tangent to two straight lines passing through a given point
+function triangle:c_ll_p(p)
+  
+  -- Compute the bisector of the triangle 
+  local lbi = bisector(self.pa, self.pb,self.pc)
 
+  if lbi:in_out(p) then
+    -- Orthogonal projection of p onto the bisector
+    local lp = lbi:ortho_from(p)
+
+    -- Intersection of line from p to its projection with self.pa and self.pb
+    local i = intersection_ll_(p, lp.pb, self.pa, self.pb)
+
+    -- Intersection points of the line with the circle defined by (i, p)
+    local t1, t2 = intersection_lc_(self.pa, self.pb, i, p)
+
+    -- Create the main line and find orthogonal projections from t1 and t2
+    local lab = line:new(self.pa, self.pb)
+    local x = lab:ortho_from(t1).pb
+    local y = lab:ortho_from(t2).pb
+
+    -- Return two circles based on the orthogonal projections and points t1, t2
+    return circle:new(intersection_ll_(x, t1, self.pa, p), t1),
+           circle:new(intersection_ll_(y, t2, self.pa, p), t2)
+  else
+     local lab = line:new(self.pa, self.pb)
+    -- Reflection of p across the bisector
+    local q = lbi : reflection (p)
+
+    -- Compute circles from the Wallis construction
+    local c1, c2 = lab:c_l_pp(p, q)
+
+    -- Return two circles with centers and points on their circumference
+    return  c1,c2
+  end
+end
+
+
 return triangle
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_vector.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_vector.lua	2025-01-07 21:01:34 UTC (rev 73345)
+++ trunk/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_vector.lua	2025-01-07 21:02:07 UTC (rev 73346)
@@ -1,6 +1,6 @@
 -- tkz_elements_vectors.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
 -- Copyright 2024  Alain Matthes
 -- This work may be distributed and/or modified under the
 -- conditions of the LaTeX Project Public License, either version 1.3



More information about the tex-live-commits mailing list.