summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-12-04 03:01:04 +0000
committerNorbert Preining <norbert@preining.info>2023-12-04 03:01:04 +0000
commitdb0fe20663f1bcb3fcf87c3fb05a727420edd203 (patch)
treee5abdee7535ece54123168f0fa9a21fa0a627464 /macros/latex/contrib/tkz
parentde2c50ca7889fda13da11c1ccf6bdbd199ba8c2b (diff)
CTAN sync 202312040301
Diffstat (limited to 'macros/latex/contrib/tkz')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/README.md42
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex363
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex55
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex227
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex55
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex151
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex544
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex160
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex298
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex103
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex163
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex261
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex158
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex77
-rw-r--r--[-rwxr-xr-x]macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex1126
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex193
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex702
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex2
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex50
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex230
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-structure.tex61
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex145
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex207
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdfbin436012 -> 532726 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdfbin7613 -> 16392 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex71
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty32
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua (renamed from macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circles.lua)82
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua2
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua (renamed from macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipses.lua)64
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua17
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua15
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua25
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua39
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua27
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua9
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua319
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua202
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua55
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua48
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua56
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua163
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua98
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua62
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua102
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua72
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua81
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua (renamed from macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangles.lua)86
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua (renamed from macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vectors.lua)22
50 files changed, 4920 insertions, 2210 deletions
diff --git a/macros/latex/contrib/tkz/tkz-elements/README.md b/macros/latex/contrib/tkz/tkz-elements/README.md
index 96f3746c6e..75744500d4 100644
--- a/macros/latex/contrib/tkz/tkz-elements/README.md
+++ b/macros/latex/contrib/tkz/tkz-elements/README.md
@@ -1,10 +1,10 @@
# tkz-elements — for euclidean geometry
-Release 1.20b 2023/11/10
+Release 1.40c 2023/12/03
## Description
-`tkz-elements` is the first 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.1.40c` 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.
@@ -18,12 +18,12 @@ conditions of the [LaTeX Project Public License](https://www.latex-project.org/l
The package compiles with utf8 and lualatex. You need actually to load:
-- [tikz](https://ctan.org/pkg/tikz)
- [tkz-euclide](https://ctan.org/pkg/tkz-euclide)
+- or [tikz](https://ctan.org/pkg/tikz)
## Installation
-The package `tkz-elements` is (will be) present in TeXLive and MiKTeX, use the package
+The package `tkz-elements` is present in TeXLive and MiKTeX, use the package
manager to install.
You can experiment with the `tkz-elements` package by placing all of the
@@ -39,12 +39,13 @@ To use the package `tkz-elements`, place the following lines in the preamble of
your LaTeX document:
```
-\usepackage{tkz-elements}
+\usepackage{tkz-euclide,tkz-elements}
\begin{document}
\begin{tkzelements}
your code
\end{tkzelements}
\begin{tikzpicture}
+\tkzGetNodes
your code
\end{tikzpicture}
```
@@ -52,20 +53,31 @@ your LaTeX document:
If you use the `xcolor` package, load that package before `tkz-euclide` to avoid
package conflicts.
-## Documentation
-
-Documentation for `tkz-euclide` is available on `CTAN`.
-
## Examples
-All examples given in documentation will be stored on my site : [http://altermundus.fr](http://altermundus.fr) as standalone
-files, ready for compilation.
-
-Other examples, in French, are on my site.
-
+Some examples will be stored on my site : [http://altermundus.fr](http://altermundus.fr).
## History
-
+ - Version 1.40c Restructuring objects
+
+ New version for all transformations. Now, they accept all objects as parameters.
+
+ Symmetry_axial has changed its name to reflection.
+
+ Added scale to north south etc.. (point object).
+
+ Change the "point" method of the objects circle and ellipse. now the parameter is un real t (between 0 and 1) and not an angle
+
+ Added the method `check_equilateral` to know if a triangle is equilateral.
+
+
+ Added option "indirect" to the method equilateral for a line object.
+
+ Correction of the documentation. (Added sections).
+
+
+
+
- Version 1.20 Memory management: tables are emptied when the tkzelements environment is opened.
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
index 7c8c94aec4..6eb97c239b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
@@ -1,31 +1,32 @@
\newpage
-\section{Class circle} % (fold)
+\section{Class \Iclass{circle}} % (fold)
\label{sec:class_circle}
-\subsection{Attributs of a circle} % (fold)
-\label{sub:attributs_of_a_circle}
-This class is also defined by two points, on the one hand the center and on the other hand a point through which the circle passes.
+\subsection{Attributes of a circle} % (fold)
+\label{sub:attributes_of_a_circle}
+This class is also defined by two points: on the one hand, the center and on the other hand, a point through which the circle passes.
+
+\begin{mybox}
+ Creation |C.OA = circle: new (z.O,z.A) |
+\end{mybox}
\bgroup
\catcode`_=12
-
\small
-\begin{center}
-%\caption{Attributes about point circle.}
-\begin{tabular}{ll}
+\captionof{table}{Circle attributes.}
+\begin{tabular}{lll}
\toprule
-\textbf{Attributes} & \textbf{Application}\\
-\Iattr{circle}{center} & |z.A = C.AB.center|\\
-\Iattr{circle}{through} & |z.B = C.AB.through|\\
-\Iattr{circle}{type} & |C.AB.type| \tkzar |C.OA.type = circle|\\
-\Iattr{circle}{radius} & |C.AB.radius| \tkzar |r = C.OA.radius | $r$ real number\\
-\Iattr{circle}{north} & |C.AB.north| \tkzar |z.N = C.OA.north|\\
-\Iattr{circle}{south} & |C.AB.south| \tkzar |z.S = C.OA.south| \\
-\Iattr{circle}{east} & |C.AB.east| \tkzar |z.E = C.OA.east| \\
-\Iattr{circle}{west} & |C.AB.west| \tkzar |z.W = C.OA.west| \\
+\textbf{Attributes} & \textbf{Application} &\\
+\Iattr{circle}{center} & |z.A = C.AB.center| &\\
+\Iattr{circle}{through} & |z.B = C.AB.through| &\\
+\Iattr{circle}{type} & |C.AB.type| &\tkzar |C.OA.type = 'circle'|\\
+\Iattr{circle}{radius} & |C.AB.radius| &\tkzar |r = C.OA.radius | $r$ real number\\
+\Iattr{circle}{north} & |C.AB.north| &\tkzar |z.N = C.OA.north|\\
+\Iattr{circle}{south} & |C.AB.south| & \tkzar |z.S = C.OA.south| \\
+\Iattr{circle}{east} & |C.AB.east| &\tkzar |z.E = C.OA.east| \\
+\Iattr{circle}{west} & |C.AB.west| &\tkzar |z.W = C.OA.west| \\
\bottomrule %
\end{tabular}
-\end{center}
\egroup
\subsubsection{Example: circle attributes} % (fold)
@@ -76,70 +77,94 @@ Three attributes are used (south, west, radius).
\end{tikzpicture}
\hspace*{\fill}
\end{minipage}
-
-% \caption{Class Circle}
% subsubsection example_circle_attributes (end)
+% subsection attributes_of_a_circle (end)
-% subsection attributs_of_a_circle (end)
-
+\newpage
\subsection{Methods of the class circle} % (fold)
\label{sub:methods_of_the_class_circle}
\bgroup
\catcode`_=12
\small
-\begin{center}
-\begin{tabular}{ll}
+\captionof{table}{Circle methods.}
+\begin{tabular}{lll}
\toprule
-\textbf{Methods} & \textbf{Comments} \\
+\textbf{Methods} & \textbf{Comments} & \\
\midrule \\
-\Imeth{circle}{new(O,A)} & |C.OA = circle : new (z.O,z.A)| \tkzar circle center $O$ through $A$\\
-\Imeth{circle}{radius(O,r)} & |C.OA = circle : radius (z.O,2)| \tkzar circle center $O$ radius =2 cm\\
+\Imeth{circle}{new(O,A)} & |C.OA = circle : new (z.O,z.A)| & circle center $O$ through $A$\\
+\Imeth{circle}{radius(O,r)} & |C.OA = circle : radius (z.O,2)| & circle center $O$ radius =2 cm\\
\midrule
- \textbf{Points} &\\
+ \textbf{Points} &&\\
\midrule
-\Imeth{circle}{antipode (pt)} & |z.C = C.OA: antipode (z.B)| \tkzar $[BC]$ is a dimater \\
-\Imeth{circle}{inversion (pt)} & |z.Bp = C.AC:inversion (z.B)|\\
-\Imeth{circle}{set\_inversion (list of pts)} & |z.Bp,z.Ep,z.Cp = C.AC: set_inversion ( z.B, z.E, z.C )|\\
-\Imeth{circle}{midarc (z1,z2)} & |z.D = C.AB: midarc (z.B,z.C)| $D$ is the midarc of $\widearc{AB}$\\
-\Imeth{circle}{point (phi)} & |z.E = C.AB: point (-math.pi/3)|\\
-\Imeth{circle}{random\_pt(lower, upper)} & \\
-\Imeth{circle}{internal\_similitude (C)} & |z.I = C.1 : internal_similitude (C.2)| \\
-\Imeth{circle}{external\_similitude (C)} & |z.J = C.1 : external_similitude (C.2)| \\
+\Imeth{circle}{antipode (pt)} & |z.C = C.OA: antipode (z.B)| & $[BC]$ is a diameter \\
+\Imeth{circle}{inversion (pt)} & |z.Bp = C.AC: inversion (z.B)|&\\
+\Imeth{circle}{midarc (z1,z2)} & |z.D = C.AB: midarc (z.B,z.C)|& $D$ is the midarc of $\widearc{BC}$\\
+\Imeth{circle}{point (t)} & |z.E = C.AB: point (0.25)|& |t| between 0 and 1\\
+\Imeth{circle}{random\_pt(lower, upper)} & &\\
+\Imeth{circle}{internal\_similitude (C)} & |z.I = C.one : internal_similitude (C.two)| &\\
+\Imeth{circle}{external\_similitude (C)} & |z.J = C.one : external_similitude (C.two)| & \\
\midrule
- \textbf{Lines} &\\
+ \textbf{Lines} & & \\
\midrule
-\Imeth{circle}{radical\_axis (C)} & \\
-\Imeth{circle}{tangent\_at (pt)} & |z.P = C.OA: tangent_at (z.M)| $((PM) \perp (OM))$\\
-\Imeth{circle}{tangent\_from (pt)}& |z.M,z.N = C.OA: tangent_from (z.P)| \\
-\Imeth{circle}{inversion (line)} & |L or C = C.AC:inversion (L.EF)|\\
+\Imeth{circle}{radical\_axis (C)} & & \\
+\Imeth{circle}{tangent\_at (pt)} & |z.P = C.OA: tangent_at (z.M)| & $((PM) \perp (OM))$\\
+\Imeth{circle}{tangent\_from (pt)}& |z.M,z.N = C.OA: tangent_from (z.P)| &\\
+\Imeth{circle}{inversion (line)} & |L or C = C.AC: inversion (L.EF)|&\\
\midrule
- \textbf{Circles} &\\
+ \textbf{Circles}& &\\
\midrule
-\Imeth{circle}{orthogonal\_from (pt)} & |C= C.OA: orthogonal_from (z.P)| \\
+\Imeth{circle}{orthogonal\_from (pt)} & |C = C.OA: orthogonal_from (z.P)| & \\
\Imeth{circle}{orthogonal\_through (pta,ptb)} & |C = C.OA: orthogonal_through (z.z1,z.z2)|\\
-\Imeth{circle}{inversion (circle)} & |L or C = C.AC:inversion (C.EF)|\\
+\Imeth{circle}{inversion (circle)} & |L or C = C.AC: inversion (C.EF)|&\\
\midrule
- \textbf{Miscellaneous} &\\
+ \textbf{Miscellaneous} &&\\
\midrule
-\Imeth{circle}{power (pt)} &| p = C.OA: power (z.M)| \tkzar power with respect to a circle \\
-\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| \tkzar boolean \\
-\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| \tkzar boolean \\
-\Imeth{circle}{draw ()} & for further use\\
-\bottomrule %
+\Imeth{circle}{power (pt)} &|p = C.OA: power (z.M)| & power with respect to a circle \\
+\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & boolean \\
+\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & boolean \\
+\Imeth{circle}{draw ()} & for further use &\\
+\bottomrule
\end{tabular}
-\end{center}
\egroup
% subsection methods_circle (end)
-
-
-
\subsubsection{Altshiller} % (fold)
\label{ssub:altshiller}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
+ z.P = point : new (0,0)
+ z.Q = point : new (5,0)
+ z.I = point : new (3,2)
+ C.QI = circle : new (z.Q,z.I)
+ C.PE = C.QI : orthogonal_from (z.P)
+ z.E = C.PE.through
+ C.QE = circle : new (z.Q,z.E)
+ _,z.F = intersection (C.PE,C.QE)
+ z.A = C.PE: point (1/9)
+ L.AE = line : new (z.A,z.E)
+ _,z.C = intersection (L.AE,C.QE)
+ L.AF = line : new (z.A,z.F)
+ L.CQ = line : new (z.C,z.Q)
+ z.D = intersection (L.AF,L.CQ)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(P,E Q,E)
+ \tkzDrawLines[add=0 and 1](P,Q)
+ \tkzDrawLines[add=0 and 2](A,E)
+ \tkzDrawSegments(P,E E,F F,C A,F C,D)
+ \tkzDrawPoints(P,Q,E,F,A,C,D)
+ \tkzLabelPoints(P,Q,E,F,A,C,D)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\hspace*{\fill}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+ scale =.5
z.P = point : new (0,0)
z.Q = point : new (5,0)
z.I = point : new (3,2)
@@ -148,14 +173,14 @@ Three attributes are used (south, west, radius).
z.E = C.PE.through
C.QE = circle : new (z.Q,z.E)
_,z.F = intersection (C.PE,C.QE)
- z.A = C.PE: point (math.pi/180*80)
+ z.A = C.PE: point (1/9)
L.AE = line : new (z.A,z.E)
_,z.C = intersection (L.AE,C.QE)
L.AF = line : new (z.A,z.F)
L.CQ = line : new (z.C,z.Q)
z.D = intersection (L.AF,L.CQ)
-\end{tkzelements}
-\begin{tikzpicture}
+ \end{tkzelements}
+ \begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(P,E Q,E)
\tkzDrawLines[add=0 and 1](P,Q)
@@ -163,44 +188,15 @@ Three attributes are used (south, west, radius).
\tkzDrawSegments(P,E E,F F,C A,F C,D)
\tkzDrawPoints(P,Q,E,F,A,C,D)
\tkzLabelPoints(P,Q,E,F,A,C,D)
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
-z.P = point : new (0,0)
-z.Q = point : new (5,0)
-z.I = point : new (3,2)
-C.QI = circle : new (z.Q,z.I)
-C.PE = C.QI : orthogonal_from (z.P)
-z.E = C.PE.through
-C.QE = circle : new (z.Q,z.E)
-_,z.F = intersection (C.PE,C.QE)
-z.A = C.PE: point (math.pi/180*80)
-L.AE = line : new (z.A,z.E)
-_,z.C = intersection (L.AE,C.QE)
-L.AF = line : new (z.A,z.F)
-L.CQ = line : new (z.C,z.Q)
-z.D = intersection (L.AF,L.CQ)
-\end{tkzelements}
-
-
-\hspace*{\fill}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawCircles(P,E Q,E)
-\tkzDrawLines[add=0 and 1](P,Q)
-\tkzDrawLines[add=0 and 2](A,E)
-\tkzDrawSegments(P,E E,F F,C A,F C,D)
-\tkzDrawPoints(P,Q,E,F,A,C,D)
-\tkzLabelPoints(P,Q,E,F,A,C,D)
-\end{tikzpicture}
-\hspace*{\fill}
+ \end{tikzpicture}
+\end{minipage}
%subsubsection altshiller (end)
\subsubsection{Lemoine} % (fold)
\label{ssub:lemoine}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
scale = 1.6
z.A = point: new (1,0)
@@ -213,7 +209,7 @@ z.D = intersection (L.AF,L.CQ)
L.tB = C.OA: tangent_at (z.B)
L.tC = C.OA: tangent_at (z.C)
z.P = intersection (L.tA,T.bc)
- z.Q = intersection (L.tB,T.ac)
+ z.Q = intersection (L.tB,T.ca)
z.R = intersection (L.tC,T.ab)
\end{tkzelements}
\begin{tikzpicture}
@@ -226,10 +222,12 @@ z.D = intersection (L.AF,L.CQ)
\tkzDrawLines[red](A,P B,Q R,C)
\tkzDrawSegments(A,R C,P C,Q)
\end{tikzpicture}
-\end{tkzexample}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
-scale = 1.25
+scale = .75
z.A = point: new (1,0)
z.B = point: new (5,2)
z.C = point: new (1.2,2)
@@ -239,11 +237,10 @@ C.OA = circle: new (z.O,z.A)
L.tA = C.OA: tangent_at (z.A)
L.tB = C.OA: tangent_at (z.B)
L.tC = C.OA: tangent_at (z.C)
-z.P = intersection (L.tA,T.bc)
-z.Q = intersection (L.tB,T.ac)
z.R = intersection (L.tC,T.ab)
+z.P = intersection (L.tA,T.bc)
+z.Q = intersection (L.tB,T.ca)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}[rotate=90]
\tkzGetNodes
@@ -255,7 +252,7 @@ z.R = intersection (L.tC,T.ab)
\tkzDrawLines[red](A,P B,Q R,C)
\tkzDrawSegments(A,R C,P C,Q)
\end{tikzpicture}
-\hspace*{\fill}
+\end{minipage}
%\caption{Lemoine line}
% subsubsection lemoine (end)
@@ -269,9 +266,10 @@ The "inversion" method can be used on a point, a line or a circle. Depending on
\label{ssub:inversion_point}
The "inversion" method can be used on a point, a line or a circle. Depending on the type of object, the function determines the correct algorithm to use.
-\begin{tkzexample}[latex=0cm,small,code only]
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
- scale = 1.5
z.o = point: new (-1,2)
z.a = point: new (2,1)
C.oa = circle: new (z.o,z.a)
@@ -285,12 +283,14 @@ The "inversion" method can be used on a point, a line or a circle. Depending on
\tkzDrawSegments(o,a o,c)
\tkzDrawPoints(a,o,c,d)
\tkzLabelPoints(a,o,c,d)
- \tkzLabelSegment[sloped,above=1em](c,d){La puissance de c est \tkzUseLua{p}}
+ \tkzLabelSegment[sloped,above=1em](c,d){%
+ Power of c with respect to C is \tkzUseLua{p}}
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
- scale = 1.5
+ scale =.75
z.o = point: new (-1,2)
z.a = point: new (2,1)
C.oa = circle: new (z.o,z.a)
@@ -305,18 +305,19 @@ The "inversion" method can be used on a point, a line or a circle. Depending on
\tkzDrawSegments(o,a o,c)
\tkzDrawPoints(a,o,c,d)
\tkzLabelPoints(a,o,c,d)
- \tkzLabelSegment[sloped,above=1em](c,d){La puissance de c est \tkzUseLua{p}}
+ \tkzLabelSegment[sloped,above=1em](c,d){%
+ La puissance de c est \tkzUseLua{p}}
\end{tikzpicture}
-\hspace*{\fill}
+\end{minipage}
\subsubsection{Inversion: line} % (fold)
\label{ssub:inversion_line}
The result is either a straight line or a circle.
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
- scale = 1
z.o = point: new (-1,1)
z.a = point: new (1,3)
C.oa = circle: new (z.o,z.a)
@@ -333,106 +334,98 @@ The result is either a straight line or a circle.
\tkzDrawPoints(a,o,c,d,H)
\tkzLabelPoints(a,o,c,d,H)
\end{tikzpicture}
-\end{tkzexample}
-
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
- scale = 1
z.o = point: new (-1,1)
z.a = point: new (1,3)
C.oa = circle: new (z.o,z.a)
z.c = point: new (3,2)
z.d = point: new (0,4)
- L.cd = line: new (z.c,z.d)
+ L.cd = line: new (z.c,z.d)
C.OH = C.oa: inversion (L.cd)
z.O,z.H = get_points(C.OH)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawCircles(o,a O,H)
+ \tkzDrawCircles(o,a)
+ \tkzDrawCircles[new](O,H)
\tkzDrawLines(c,d o,H)
\tkzDrawPoints(a,o,c,d,H)
\tkzLabelPoints(a,o,c,d,H)
\end{tikzpicture}
- \hspace*{\fill}
+\end{minipage}
\subsubsection{Inversion: circle} % (fold)
\label{ssub:inversion_circle}
The result is either a straight line or a circle.
-\begin{tkzexample}[latex=0cm,small,code only]
- \begin{tkzelements}
- scale = 1
- z.o = point: new (-1,1)
- z.a = point: new (2,3)
- C.oa = circle: new (z.o,z.a)
- z.c = point: new (-2,1)
- z.e = point: new (-2,8)
- z.d = point: new (-2,5)
- C.ed = circle: new (z.e,z.d)
- C.co = circle: new (z.c,z.o)
- obj = C.oa: inversion (C.co)
- if obj.type == "line"
- then
- z.p,z.q = get_points(obj)
- else
- z.O,z.H = get_points(obj)
- end
- obj = C.oa: inversion(C.ed)
- if obj.type == "line"
- then
- z.p,z.q = get_points(obj)
- else
- z.O,z.H = get_points(obj)
- end
- \end{tkzelements}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(o,a c,o e,d O,H)
- \tkzDrawLines(p,q)
- \tkzDrawPoints(a,o,c,d,e,p,q,O,H)
- \tkzLabelPoints(a,o,c,d,e,p,q,O,H)
- \end{tikzpicture}
-\end{tkzexample}
-
- \begin{tkzelements}
- scale = 1
- z.o = point: new (-1,1)
- z.a = point: new (2,3)
- C.oa = circle: new (z.o,z.a)
- z.c = point: new (-2,1)
- z.e = point: new (-2,8)
- z.d = point: new (-2,5)
- C.ed = circle: new (z.e,z.d)
- C.co = circle: new (z.c,z.o)
- obj = C.oa: inversion (C.co)
- if obj.type == "line"
- then
- z.p,z.q = get_points(obj)
- else
- z.O,z.H = get_points(obj)
- end
- obj = C.oa: inversion(C.ed)
- if obj.type == "line"
- then
- z.p,z.q = get_points(obj)
- else
- z.O,z.H = get_points(obj)
- end
- \end{tkzelements}
+\begin{minipage}{.55\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+scale = .7
+z.o,z.a = point: new (-1,3),point: new (2,3)
+z.c = point: new (-2,1)
+z.e,z.d = point: new (-2,7),point: new (-3,5)
+C.oa = circle: new (z.o,z.a)
+C.ed = circle: new (z.e,z.d)
+C.co = circle: new (z.c,z.o)
+obj = C.oa: inversion (C.co)
+ if obj.type == "line"
+ then z.p,z.q = get_points(obj)
+ else z.f,z.b = get_points(obj) end
+obj = C.oa: inversion(C.ed)
+if obj.type == "line"
+then z.p,z.q = get_points(obj)
+else z.f,z.b = get_points(obj) end
+color = "orange"
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[black](o,a)
+\tkzDrawCircles[teal](c,o e,d)
+\tkzDrawCircles[\tkzUseLua{color}](f,b)
+\tkzDrawLines[\tkzUseLua{color}](p,q)
+\tkzDrawPoints(a,...,f,o,p,q)
+\tkzLabelPoints(a,...,f,o,p,q)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.45\textwidth}
+ \begin{tkzelements}
+ scale = .7
+ z.o,z.a = point: new (-1,3),point: new (2,3)
+ z.c = point: new (-2,1)
+ z.e,z.d = point: new (-2,7),point: new (-3,5)
+ C.oa = circle: new (z.o,z.a)
+ C.ed = circle: new (z.e,z.d)
+ C.co = circle: new (z.c,z.o)
+ obj = C.oa: inversion (C.co)
+ if obj.type == "line"
+ then z.p,z.q = get_points(obj)
+ else z.f,z.b = get_points(obj) end
+ obj = C.oa: inversion(C.ed)
+ if obj.type == "line"
+ then z.p,z.q = get_points(obj)
+ else z.f,z.b = get_points(obj) end
+ color = "orange"
+ \end{tkzelements}
+ \hspace{\fill}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles[black](o,a)
+ \tkzDrawCircles[teal](c,o e,d)
+ \tkzDrawCircles[\tkzUseLua{color}](f,b)
+ \tkzDrawLines[\tkzUseLua{color}](p,q)
+ \tkzDrawPoints(a,...,f,o,p,q)
+ \tkzLabelPoints(a,...,f,o,p,q)
+ \end{tikzpicture}
+\end{minipage}
+
-\hspace*{\fill}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(o,a c,o e,d O,H)
- \tkzDrawLines(p,q)
- \tkzDrawPoints(a,o,c,d,e,p,q,O,H)
- \tkzLabelPoints(a,o,c,d,e,p,q,O,H)
- \end{tikzpicture}
- \hspace*{\fill}
% subsubsection inversion (end)
% subsection methods_of_the_class_circle (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
index 0d5c00b38c..e700019fa3 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
@@ -1,17 +1,16 @@
\newpage
-\section{Classe ellipse} % (fold)
+\section{Classe \Iclass{ellipse}} % (fold)
\label{sec:classe_ellipse}
-\subsection{Attributs of an ellipse} % (fold)
-\label{sub:attributs_of_an_ellipse}
+\subsection{Attributes of an ellipse} % (fold)
+\label{sub:attributes_of_an_ellipse}
The first attributes are the three points that define the ellipse : \Iattr{ellipse}{center} , \Iattr{ellipse}{vertex} and \Iattr{ellipse}{covertex}. The first method to define an ellipse is to give its center, then the point named \tkzname{vertex} which defines the major axis and finally the point named \tkzname{covertex} which defines the minor axis.
\bgroup
\catcode`_=12
\small
-\begin{center}
-%\caption{Attributes about ellipse class.}
+\captionof{table}{Ellipse attributes.}
\begin{tabular}{ll}
\toprule
\textbf{Attributes} & \textbf{Application}\\
@@ -24,18 +23,17 @@ The first attributes are the three points that define the ellipse : \Iattr{ellip
\Iattr{ellipse}{slope}& Slope of the line passes through the foci\\
\Iattr{ellipse}{Fa}& First focus\\
\Iattr{ellipse}{Fb}& Second focus\\
-\Imeth{ellipse}{south} & See next example \ref{ssub:attributs_of_an_ellipse} \\
-\Imeth{ellipse}{north} & See next example \ref{ssub:attributs_of_an_ellipse} \\
-\Imeth{ellipse}{west} & See next example \ref{ssub:attributs_of_an_ellipse} \\
-\Imeth{ellipse}{east} & See next example \ref{ssub:attributs_of_an_ellipse} \\
+\Imeth{ellipse}{south} & See next example \ref{ssub:attributes_of_an_ellipse} \\
+\Imeth{ellipse}{north} & \\
+\Imeth{ellipse}{west} & \\
+\Imeth{ellipse}{east} & \\
\bottomrule %
\end{tabular}
-\end{center}
\egroup
-\subsubsection{Attributs of an ellipse} % (fold)
-\label{ssub:attributs_of_an_ellipse}
+\subsubsection{Atributes of an ellipse: example} % (fold)
+\label{ssub:attributes_of_an_ellipse}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
z.C = point: new (3 , 2)
@@ -61,11 +59,13 @@ The first attributes are the three points that define the ellipse : \Iattr{ellip
\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
\tkzGetNodes
\tkzDrawCircles[teal](C,A)
- \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{slope})
+ \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},
+ \tkzUseLua{slope})
\tkzDrawPoints(C,A,B,b,W,S,F1,F2)
\tkzLabelPoints(C,A,B)
\tkzDrawLine[add = .5 and .5](A,W)
- \tkzLabelSegment[pos=1.5,above,sloped](A,W){slope = \pgfmathprintnumber{\slope}}
+ \tkzLabelSegment[pos=1.5,above,sloped](A,W){%
+ slope = \pgfmathprintnumber{\tkzUseLua{slope}}}
\tkzLabelPoint[below](S){South}
\tkzLabelPoint[below left](F1){Focus 1}
\tkzLabelPoint[below left](F2){Focus 2}
@@ -113,7 +113,7 @@ z.Ve = E.vertex
\end{tikzpicture}
\hspace*{\fill}
% \caption{Class Ellipse}
-% subsection attributs_of_an_ellipse (end)
+% subsection attributes_of_an_ellipse (end)
\subsection{Methods of the class ellipse} % (fold)
@@ -128,8 +128,7 @@ To do this, you'll need to use a \pkg{tkz-elements }function: \Igfct{package}{se
\bgroup
\catcode`_=12
\small
-\begin{center}
-%\caption{elements\_ellipses.lua}
+\captionof{table}{Ellipse methods.}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Example} \\
@@ -141,10 +140,10 @@ To do this, you'll need to use a \pkg{tkz-elements }function: \Igfct{package}{se
\Imeth{ellipse}{in\_out (pt) } & pt in/out of the ellipse \\
\Imeth{ellipse}{tangent\_at (pt) } & see example \ref{ssub:method_point} \\
\Imeth{ellipse}{tangent\_from (pt) } & see example \ref{ssub:method_point} \\
-\Imeth{ellipse}{point (phi) } & vertex = point (0) covertex = point (math.pi/4) ex see \ref{ssub:method_point} \\
+\Imeth{ellipse}{point (t) } & vertex = point (0) covertex = point (0.25) ex see \ref{ssub:method_point} \\
\bottomrule
\end{tabular}
-\end{center}
+
\egroup
\subsubsection{Method \Imeth{ellipse}{new}} % (fold)
@@ -162,12 +161,13 @@ For attributes see \ref{sec:classe_ellipse}
E = ellipse: new (z.C,z.A,z.B)
a = E.Rx
b = E.Ry
- slope = math.deg(E.Sl)
+ slope = math.deg(E.slope)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles[teal](C,A)
- \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{slope})
+ \tkzDrawEllipse[red](C,\tkzUseLua{a},
+ \tkzUseLua{b},\tkzUseLua{slope})
\tkzDrawPoints(C,A,B)
\tkzLabelPoints(C,A,B)
\end{tikzpicture}
@@ -235,7 +235,8 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
\tkzDrawPolygon(A,B,C)
\tkzDrawCircles[cyan](O,A N,I)
\tkzDrawSegments(X,R A,X)
- \tkzDrawEllipse[red](N,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{ang})
+ \tkzDrawEllipse[red](N,\tkzUseLua{a},
+ \tkzUseLua{b},\tkzUseLua{ang})
\tkzDrawLines[add=.2 and .5](I,H)
\tkzDrawPoints(A,B,C,N,O,X,H,R,S,I)
\tkzLabelPoints[above](C,X)
@@ -306,8 +307,8 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
E = ellipse: radii (z.C,a,b,-math.pi/4)
z.V = E : point (0)
z.K = E : point (1)
- z.CoV = E : point (math.pi/2)
- z.X = E : point (math.pi)
+ z.CoV = E : point (0.25)
+ z.X = E : point (0.5)
L = E :tangent_at (z.V)
z.x,z.y = get_points(L)
L.ta,L.tb = E :tangent_from (z.A)
@@ -331,7 +332,7 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
\end{minipage}
\begin{minipage}{0.4\textwidth}
\begin{tkzelements}
-scale = .5
+scale = .75
z.C = point: new (2 , 3)
z.A = point: new (6 , 5)
a = value(4)
@@ -340,8 +341,8 @@ ang = math.deg(-math.pi/4)
E = ellipse: radii (z.C,a,b,-math.pi/4)
z.V = E : point (0)
z.K = E : point (1)
-z.CoV = E : point (math.pi/2)
-z.X = E : point (math.pi)
+z.CoV = E : point (0.25)
+z.X = E : point (0.5)
L = E :tangent_at (z.V)
z.x,z.y = get_points(L)
L.ta,L.tb = E :tangent_from (z.A)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
index 62ea40d1f3..099c75a278 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
@@ -1,43 +1,47 @@
\newpage
-\section{Class line} % (fold)
+\section{Class \Iclass{line}} % (fold)
\label{sec:class_line}
-\subsection{Attributs of a line} % (fold)
-\label{sub:attributs_of_a_line}
+\subsection{Attributes of a line} % (fold)
+\label{sub:attributes_of_a_line}
+
+Writing |L.AB = line: new (z.A,z.B)| creates an object of the class \tkzname{line} (the notation is arbitrary for the moment). Geometrically it is, as much ,the line passing through the points $A$ and $B$ as the segment $[AB]$. Thus we can use the midpoint of |L.AB| which is, of course, the midpoint of the segment $[AB]$. This medium is obtained with |L.AB.mid|. Note that |L.AB.pa = z.A| and |L.AB.pb = z.B|. Finally, if a line $L$ is the result of a method, you can obtain the points with |z.A,z.B = get_points (L)| or with the previous remark.
+
+\begin{mybox}
+ Creation |L.AB = line : new ( z.A , z.B ) |
+\end{mybox}
-Writing |L.AB = line: new (z.A,z.B) | creates an object of the class \tkzname{line} (the notation is arbitrary for the moment). Geometrically it is as much the line passing through the points $A$ and $B$ as the segment $[AB]$. Thus we can use the midpoint of |L.AB| which is of course the midpoint of the segment $[AB]$. This medium is obtained with |L.AB.mid|. Note that |L.AB.pa = z.A| and |L.AB.pb = z.B|. Finally, if a line $L$ is the result of a method, you can obtain the points with |z.A,z.B = get_points (L)| or with the previous remark.
The attributes are :
+\vspace{1em}
\bgroup
\catcode`_=12
-
\small
-\begin{center}
-%\caption{Attributes about line class.}
-\begin{tabular}{ll}
+\captionof{table}{Line attributes.}
+\begin{tabular}{lll}
\toprule
-\textbf{Attributes} & \textbf{Application}\\
-\Iattr{line}{pa} & First point of the segment \\
-\Iattr{line}{pb} & Second point of the segment\\
-\Iattr{line}{type} & Type is 'line'\\
-\Iattr{line}{mid} & Middle of the segment |z.M = L.AB.mid|\\
-\Iattr{line}{slope} & Slope of the line obtained with |an = L.AB.slope|\\
-\Iattr{line}{length} & Length of the segment |l = L.AB.length| \\
-\Iattr{line}{north\_pa} & See next example \\
-\Iattr{line}{north\_pb} & \\
-\Iattr{line}{south\_pa} & \\
-\Iattr{line}{south\_pb} & \\
-\Iattr{line}{east} & \\
-\Iattr{line}{west} & \\
+\textbf{Attributes} & \textbf{Application} & \\
+\Iattr{line}{pa} & First point of the segment & |z.A = L.AB.pa| \\
+\Iattr{line}{pb} & Second point of the segment & \\
+\Iattr{line}{type} & Type is 'line' & |L.AB.type = 'line'| \\
+\Iattr{line}{mid} & Middle of the segment& |z.M = L.AB.mid|\\
+\Iattr{line}{slope} & Slope of the line & obtained with |an = L.AB.slope|\\
+\Iattr{line}{length} & Length of the segment& |l = L.AB.length| \\
+\Iattr{line}{north\_pa} & See next example& d(a,north—pa)=d(a,b)=d(east,b) =etc. \\
+\Iattr{line}{north\_pb} & &\\
+\Iattr{line}{south\_pa} & &\\
+\Iattr{line}{south\_pb} & &\\
+\Iattr{line}{east} & &\\
+\Iattr{line}{west} & &\\
\bottomrule
\end{tabular}
-\end{center}
\egroup
\subsubsection{Example: attributes of class line} % (fold)
\label{ssub:example_class_line}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
scale = .5
z.a = point: new (1, 1)
@@ -61,9 +65,9 @@ The attributes are :
\tkzLabelSegment[sloped](a,b){ab = \tkzUseLua{len}}
\tkzLabelSegment[above=12pt,sloped](a,b){slope of (ab) = \tkzUseLua{sl}}
\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}\begin{tkzelements}
scale = .5
z.a = point: new (1, 1)
z.b = point: new (5, 4)
@@ -76,26 +80,30 @@ z.s = L.ab.south_pb
sl = L.ab.slope
len = L.ab.length
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPoints(a,b,m,e,r,s,w)
-\tkzLabelPoints(a,b,e,r,s,w)
-\tkzLabelPoints[above](m)
-\tkzDrawLine(a,b)
-\tkzLabelSegment[sloped](a,b){ab = \tkzUseLua{len}}
-\tkzLabelSegment[above=12pt,sloped](a,b){slope of (ab) = \tkzUseLua{sl}}
+ \tkzGetNodes
+ \tkzDrawPoints(a,b,m,e,r,s,w)
+ \tkzLabelPoints(a,b)
+ \tkzLabelPoint(r){north\_pa}
+ \tkzLabelPoint(s){south\_pb}
+ \tkzLabelPoint[below](m){mid}
+ \tkzLabelPoint[right](w){west}
+ \tkzLabelPoint[left](e){east}
+ \tkzDrawLine(a,b)
+ \tkzLabelSegment[above = 1em,sloped](a,b){ab = \pmpn{\tkzUseLua{len}}}
+ \tkzLabelSegment[above=2em,sloped](a,b){slope of (ab) = \pmpn{\tkzUseLua{sl}}}
\end{tikzpicture}
-\hspace*{\fill}
-% \caption{Class Line}
+\end{minipage}
% subsubsection example_class_line (end)
\subsubsection{Method \Imeth{line}{new} and line attributes}
\label{ssub:example_line_attributes}
Notation |L| or |L.AB| or |L.euler|. The notation is actually free.
-|L.AB| can also represent the segment. With | L.AB = line : new (z.A,z.B)|, a line is defined.
+|L.AB| can also represent the segment.
+
+With | L.AB = line : new (z.A,z.B)|, a line is defined.
\begin{minipage}{0.5\textwidth}
@@ -136,7 +144,7 @@ Notation |L| or |L.AB| or |L.euler|. The notation is actually free.
\end{tikzpicture}
\end{minipage}
% subsubsection example_line_attributes (end)
-% subsection attributs_of_a_line (end)
+% subsection attributes_of_a_line (end)
\clearpage\newpage
\subsection{Methods of the class line} % (fold)
@@ -144,64 +152,64 @@ Notation |L| or |L.AB| or |L.euler|. The notation is actually free.
Here's the list of methods for the \tkzNameObj{line} object. The results are either reals, points, lines, circles or triangles.
\subsubsection{Table of the methods from class line} % (fold)
\label{ssub:table_of_the_methods_from_class_line}
+
+\vspace{1em}
\bgroup
\catcode`_=12
\small
-\begin{center}
-%\caption{Methods from class line}
-\begin{tabular}{ll}
+\captionof{table}{Methods of the class line.}
+\begin{tabular}{lll}
\toprule
-\textbf{Methods} & \textbf{Comments} \\
+\textbf{Methods} & \textbf{Comments} & \\
\midrule
-\Imeth{line}{new(A, B)} & |L.AB = line : new(z.A,z.B)| line through the points $A$ and $B$\\
+\Imeth{line}{new(A, B)} & |L.AB = line : new(z.A,z.B)| line through the points $A$ and $B$&\\
\midrule
- \textbf{Points} &\\
+ \textbf{Points} &&\\
\midrule
-\Imeth{line}{gold\_ratio ()} & |z.C = L.AB : gold_ratio()| \tkzar gold ratio \\
-\Imeth{line}{normalize ()} & |z.C = L.AB : normalize()| \tkzar AC =1 and $C\in (AB)$ \\
-\Imeth{line}{normalize_inv ()} & |z.C = L.AB : normalize_inv()| \tkzar CB =1 and $C\in (AB)$ \\
-\Imeth{line}{barycenter (ka,kb)} & |z.C = L.AB : barycenter (1,2)| $C$ --> barycenter of |{(A,1)(B,2)}|\\
-\Imeth{line}{point (t)} & |z.C = L.AB : point (2)| \tkzar $\overrightarrow{AC} = 2\overrightarrow{AB}$\\
-\Imeth{line}{midpoint ()} & |z.M = L.AB : midpoint ()| \tkzar better is |z.M = L.AB.mid| \\
-\Imeth{line}{harmonic\_int } & |z.D = L.AB : harmonic_int (z.C)| \tkzar $D\in [AB]$ $C\notin [AB]$\\
-\Imeth{line}{harmonic\_ext (pt)} & |z.D = L.AB : harmonic_ext (z.C)| \tkzar $D\notin [AB]$ $C\in [AB]$\\
-\Imeth{line}{harmonic\_both (k)} & |z.C,z.D = L.AB : harmonic_both (tkzphi)| \tkzar ${ {CA/CB}={DA/DB}=t\varphi.}$\\
-\Imeth{line}{projection ( pt )} & |z.H = L.AB : projection (z.C)| \tkzar $CH \perp (AB)$ and $H\in (AB)$\\
-\Imeth{line}{set\_projection (...)} & projection of a list of points \\
-\Imeth{line}{symmetry\_axial ( pt )} & |z.Cp = L.AB : symmetry_axial (z.C)|\\
-\Imeth{line}{set\_symmetry\_axial (...) }&symmetry_axial of a list of points \\
-\Imeth{line}{translation ( pt )} & |z.Cp = L.AB : translation (z.C)|\\
-\Imeth{line}{set\_translation(...) }&translation of a list of points \\
-
-\Imeth{line}{square ()} & |z.C,z.D = L.AB : square () | \tkzar creates 2 points to make a square.\\
+\Imeth{line}{gold\_ratio ()} & |z.C = L.AB : gold_ratio()| & gold ratio \\
+\Imeth{line}{normalize ()} & |z.C = L.AB : normalize()| & AC =1 and $C\in (AB)$ \\
+\Imeth{line}{normalize\_inv ()} & |z.C = L.AB : normalize_inv()| & CB =1 and $C\in (AB)$ \\
+\Imeth{line}{barycenter (ka,kb)} & |z.C = L.AB : barycenter (1,2)| $C$ & barycenter of |{(A,1)(B,2)}|\\
+\Imeth{line}{point (t)} & |z.C = L.AB : point (2)| & $\overrightarrow{AC} = 2\overrightarrow{AB}$\\
+\Imeth{line}{midpoint ()} & |z.M = L.AB : midpoint ()| & better is |z.M = L.AB.mid| \\
+\Imeth{line}{harmonic\_int } & |z.D = L.AB : harmonic_int (z.C)| & $D\in [AB]$ $C\notin [AB]$\\
+\Imeth{line}{harmonic\_ext (pt)} & |z.D = L.AB : harmonic_ext (z.C)| & $D\notin [AB]$ $C\in [AB]$\\
+\Imeth{line}{harmonic\_both (k)} & |z.C,z.D = L.AB : harmonic_both (tkzphi)| & ${ {CA/CB}={DA/DB}=t\varphi.}$\\
+\Imeth{line}{square ()} & |S.AB =(L.AB : square ()) | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}\\
\midrule
- \textbf{Lines} &\\
+ \textbf{Lines} &&\\
\midrule
-\Imeth{line}{ll\_from ( pt )} & |L.CD = L.AB : ll_from (z.C)| \tkzar $(CD) \parallel (AB)$ \\
-\Imeth{line}{ortho\_from ( pt )} & |L.CD = L.AB : ortho_from (z.C)| \tkzar $(CD) \perp (AB)$\\
-\Imeth{line}{mediator ()}&|L.uv = L.AB : mediator ()| \tkzar $(u,v)$ mediator of $(A,B)$\\
+\Imeth{line}{ll\_from ( pt )} & |L.CD = L.AB : ll_from (z.C)| & $(CD) \parallel (AB)$ \\
+\Imeth{line}{ortho\_from ( pt )} & |L.CD = L.AB : ortho_from (z.C)|& $(CD) \perp (AB)$\\
+\Imeth{line}{mediator ()}&|L.uv = L.AB : mediator ()| & $(u,v)$ mediator of $(A,B)$\\
\midrule
- \textbf{Triangles} &\\
+ \textbf{Triangles} &&\\
\midrule
-\Imeth{line}{equilateral ()} & |z.C = L.AB : equilateral_tr ()| $(\overrightarrow{AB},\overrightarrow{AC})>0$ \\
-\Imeth{line}{isosceles (phi)} & |z.C = L.AB : isosceles (math.pi/6)| \\
-\Imeth{line}{gold ()} & |z.C = L.AB : gold ()| \tkzar right in $B$ and $AC = \varphi \times AB $ \\
-\Imeth{line}{euclide ()} & |z.C = L.AB : euclide ()| \tkzar $AB=AC$ and $(\overrightarrow{AB},\overrightarrow{AC}) = math.pi/5$ \\
-\Imeth{line}{golden ()} & |z.C = L.AB : golden ()| $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times math.pi/5$ \\
+\Imeth{line}{equilateral (swap)} & |T.ABC = L.AB : equilateral ()| $(\overrightarrow{AB},\overrightarrow{AC})>0$ & or < with swap \\
+\Imeth{line}{isosceles (phi)} & |T.ABC = L.AB : isosceles (math.pi/6)|& \\
+\Imeth{line}{gold ()} & |T.ABC = L.AB : gold ()| & right in $B$ and $AC = \varphi \times AB $ \\
+\Imeth{line}{euclide ()} & |T.ABC = L.AB : euclide ()| & $AB=AC$ and $(\overrightarrow{AB},\overrightarrow{AC}) = math.pi/5$ \\
+\Imeth{line}{golden ()} & |T.ABC = L.AB : golden ()| & $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times \pi/5$ \\
+\midrule
+ \textbf{Circles} &&\\
+\midrule
+\Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| & center pa through pb \\
+\Imeth{line}{circle\_swap ()} & |C.BA = L.AB : circle\_swap ()|& center pb through pa \\
\midrule
- \textbf{Circles} &\\
+ \textbf{Transformations} &&\\
\midrule
-\Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| circle center pa through pb \\
-\Imeth{line}{circle\_swap ()} & |C.BA = L.AB : circle\_swap ()| circle center pb through pa \\
+\Imeth{line}{reflection ( obj )} & |new obj = L.AB : reflection (obj|&\\
+\Imeth{line}{translation ( obj )} & |new obj = L.AB : translation (obj)|&\\
+\Imeth{line}{projection ( obj )} & |z.H = L.AB : projection (z.C)| & $CH \perp (AB)$ and $H\in (AB)$\\
\midrule
- \textbf{Miscellaneous} &\\
+ \textbf{Miscellaneous} &&\\
\midrule
-\Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| d=CH with H projection of $C$ onto (AB)\\
-\Imeth{line}{in\_out (pt)} & |b = L.AB : in_out (z.C)| $b$ is a boolean b=true if $C\in (AB)$ \\
-\Imeth{line}{slope ()} & |a = L.AB : slope()| \tkzar better is L.AB.slope \\
+\Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| & see \ref{ssub:example_distance_and_projection}\\
+\Imeth{line}{in\_out (pt)} & |b = L.AB : in_out (z.C)| $b$ is a boolean b=true if $C\in (AB)$ &\\
+\Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope \\
\bottomrule
\end{tabular}
-\end{center}
+
\egroup
% subsubsection table_of_the_methods_from_class_line (end)
@@ -270,7 +278,7 @@ _,z.E = get_points ( L.CD: ll_from (z.B))
z.c = point: new (2, 5)
z.d = point: new (5, 2)
L.ab = line: new (z.a,z.b)
- z.cp,z.dp = L.ab: set_projection(z.c,z.d)
+ z.cp,z.dp = L.ab: projection(z.c,z.d)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -288,7 +296,7 @@ z.b = point: new (4, 1)
z.c = point: new (2, 5)
z.d = point: new (5, 2)
L.ab = line: new (z.a,z.b)
-z.cp,z.dp = L.ab : set_projection(z.c,z.d)
+z.cp,z.dp = L.ab : projection(z.c,z.d)
\end{tkzelements}
\hspace*{\fill}
\begin{tikzpicture}
@@ -381,8 +389,7 @@ z.a,z.b = L.ab.pa,L.ab.pb
z.C = point: new (-3,2)
z.D = point: new (0,2)
L.AB = line : new (z.A,z.B)
- -- z.E = L.AB : translation (z.C)
- z.E,z.F = L.AB : set_translation (z.C,z.D)
+ z.E,z.F = L.AB : translation (z.C,z.D)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -399,8 +406,7 @@ z.a,z.b = L.ab.pa,L.ab.pb
z.C = point: new (-3,2)
z.D = point: new (0,2)
L.AB = line : new (z.A,z.B)
- -- z.E = L.AB : translation (z.C)
- z.E,z.F = L.AB : set_translation (z.C,z.D)
+ z.E,z.F = L.AB : translation (z.C,z.D)
\end{tkzelements}
\hspace*{\fill}
\begin{tikzpicture}
@@ -433,7 +439,7 @@ z.a,z.b = L.ab.pa,L.ab.pb
\tkzDrawPoints(A,B,C,H)
\tkzLabelPoints(A,B,C,H)
\tkzLabelSegment[above left,
- draw](C,H){$CH = \tkzUseLua{d}$}
+ draw](C,H){$CH = \tkzUseLua{d}$}
\end{tikzpicture}
\end{tkzexample}
\end{minipage}
@@ -459,6 +465,55 @@ z.a,z.b = L.ab.pa,L.ab.pb
% \caption{Method distance with line object}
% subsubsection example_distance_and_projection (end)
+
+\subsubsection{Reflection of object} % (fold)
+\label{ssub:reflection_of_object}
+
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ 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.G = point : new ( 4 , 2 )
+ L.AB = line : new ( z.A , z.B )
+ T.EFG = triangle : new (z.E,z.F,z.G)
+ T.new = L.AB : reflection (T.EFG)
+ z.Ep,z.Fp,z.Gp = get_points(T.new)
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPolygon(E,F,G)
+ \tkzDrawPolygon[new](E',F',G')
+ \tkzDrawSegment[red,dashed](E,E')
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+ 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.G = point : new ( 4 , 2 )
+ L.AB = line : new ( z.A , z.B )
+ T.EFG = triangle : new (z.E,z.F,z.G)
+ T.new = L.AB : reflection (T.EFG)
+ z.Ep,z.Fp,z.Gp = get_points(T.new)
+\end{tkzelements}
+\hspace{\fill}\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPolygon(E,F,G)
+ \tkzDrawPolygon[new](E',F',G')
+ \tkzDrawSegment[red,dashed](E,E')
+\end{tikzpicture}
+\end{minipage}
+
+
+% subsubsection reflection_of_object (end)
% subsection methods_from_class_line (end)
% section class_line (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
index 65834bf78e..321444b889 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
@@ -5,8 +5,7 @@
\bgroup
\catcode`_=12
\small
-\begin{center}
-%\caption{functions\_maths.lua }
+\captionof{table}{Math constants and functions.}
\begin{tabular}{ll}
\toprule
\textbf{contants or functions} & \textbf{Comments}\\
@@ -28,9 +27,9 @@
\Igfct{math}{angle\_normalize (a) } & to get a value between 0 and $2\pi$ \\
\Igfct{math}{radical\_center (C1,C2,C3)} & see \ref{sub:radical_center} \\
\Igfct{math}{radical\_circle (C1,C2,C3)} & see \ref{sub:radical_circle} \\
+\Igfct{math}{barycenter (\{z1,n1\},\{z2,n2\}, ...)} & barycenter of list of points \\
\bottomrule
\end{tabular}
-\end{center}
\egroup
\subsubsection{Harmonic division with tkzphi } % (fold)
@@ -132,29 +131,32 @@ If |scale = 1.2| with a = 6 then real(a) = $6 / 1.2 = 5$ .
\subsubsection{Transfer from lua to \TEX} % (fold)
\label{ssub:transfer_from_lua_to_tex}
It's possible to transfer variable from Lua to \TEX{} with
-\Igfct{package}{\textbackslash{tkzUseLua}} in the environment "tikzpicture".
-
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.A = point : new (0 , 0)
- z.B = point : new (4 , 3)
- z.C = point : new (2 , 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)
-\end{tkzelements}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawLines(A,B C,H)
-\tkzDrawPoints(A,B,C,H)
-\tkzLabelPoints(A,B,C,H)
-\tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
-\tkzLabelSegment[below left,draw](C,H){$AB = \tkzUseLua{l}$}
-\end{tikzpicture}
-\end{tkzexample}
-
+\Igfct{package}{\textbackslash{tkzUseLua}}.
+
+
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.A = point : new (0 , 0)
+ z.B = point : new (4 , 3)
+ z.C = point : new (2 , 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)
+ \end{tkzelements}
+ % possible here \tkzUseLua{L.AB.length}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B C,H)
+ \tkzDrawPoints(A,B,C,H)
+ \tkzLabelPoints(A,B,C,H)
+ \tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
+ \tkzLabelSegment[below left,draw](C,H){$AB = \tkzUseLua{l}$}
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
z.A = point : new (0 , 0)
z.B = point : new (4 , 3)
@@ -172,6 +174,7 @@ It's possible to transfer variable from Lua to \TEX{} with
\tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
\tkzLabelSegment[below left,draw](C,H){$AB = \tkzUseLua{l}$}
\end{tikzpicture}
+\end{minipage}
% subsubsection transfer_from_lua_to_tex (end)
\subsubsection{Normalized angles : Slope of lines (ab), (ac) and (ad)} % (fold)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
new file mode 100644
index 0000000000..372ca334be
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
@@ -0,0 +1,151 @@
+\newpage
+\section{Classe \Iclass{parallelogram}} % (fold)
+
+\subsection{Parallelogram attributes} % (fold)
+\label{sub:parallelogram_attributes}
+
+% subsection square_attributes (end)
+Points are created in the direct direction. A test is performed to check whether the points form a parallelogram, otherwise compilation is blocked.
+
+\begin{mybox}
+Creation | P.new = parallelogram : new (z.A,z.B,z.C,z.D)|
+\end{mybox}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Parallelogram attributes.}
+\begin{tabular}{lll}
+\toprule
+\textbf{Attributes} & \textbf{Application} & \\
+\Iattr{parallelogram}{pa} & |z.A = P.new.pa| & \\
+\Iattr{parallelogram}{pb} & |z.B = P.new.pb| & \\
+\Iattr{parallelogram}{pc} & |z.C = P.new.pc| & \\
+\Iattr{parallelogram}{pd} & |z.D = P.new.pd| & \\
+\Iattr{parallelogram}{type} & |P.new.type= 'parallelogram'|& \\
+\Iattr{parallelogram}{i} & |z.I = P.new.i| & intersection of diagonals \\
+\Iattr{parallelogram}{ab} & |P.new.ab| & line passing through two vertices \\
+\Iattr{parallelogram}{ac} & |P.new.ca| & idem. \\
+\Iattr{parallelogram}{ad} & |P.new.ad| & idem. \\
+\Iattr{parallelogram}{bc} & |P.new.bc| & idem. \\
+\Iattr{parallelogram}{bd} & |P.new.bd| & idem. \\
+\Iattr{parallelogram}{cd} & |P.new.cd| & idem. \\
+\bottomrule %
+\end{tabular}
+\egroup
+\subsubsection{Example: attributes } % (fold)
+\label{ssub:example_attributes}
+
+% subsubsection example_attributes (end)
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 1 )
+z.C = point : new ( 7 , 5 )
+z.D = point : new ( 3 , 4 )
+P.new = parallelogram : new (z.A,z.B,z.C,z.D)
+z.B = P.new.pb
+z.C = P.new.pc
+z.D = P.new.pd
+z.I = P.new.i
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 1 )
+z.C = point : new ( 7 , 5 )
+z.D = point : new ( 3 , 4 )
+P.new = parallelogram : new (z.A,z.B,z.C,z.D)
+z.B = P.new.pb
+z.C = P.new.pc
+z.D = P.new.pd
+z.I = P.new.i
+\end{tkzelements}
+ \hspace{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{minipage}
+
+
+\newpage
+
+\subsection{Parallelogram methods} % (fold)
+\label{sub:parallelogram_methods}
+
+% subsection parallelogram_methods (end)
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Parallelogram methods.}
+\begin{tabular}{ll}
+\toprule
+\textbf{Methods} & \textbf{Comments} \\
+\midrule \\
+\Imeth{parallelogram}{fourth (za,zb,zc)} & completes a triangle by parallelogram (see next example)\\
+\bottomrule %
+\end{tabular}
+\egroup
+
+\subsubsection{parallelogram with fourth method} % (fold)
+\label{ssub:parallelogram_with_fourth_method}
+
+% subsubsection parallelogram_with_fourth_method (end)
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 1 )
+z.C = point : new ( 5 , 3 )
+P.four = parallelogram : fourth (z.A,z.B,z.C)
+z.D = P.four.pd
+z.I = P.four.center
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,D,B,C)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 1 )
+z.C = point : new ( 5 , 3 )
+P.four = parallelogram : fourth (z.A,z.B,z.C)
+z.D = P.four.pd
+z.I = P.four.center
+\end{tkzelements}
+
+\hspace{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection parallelogram_with_side_method (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
index a9a1785ef1..c9b5928ff0 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
@@ -1,162 +1,351 @@
\newpage
-\section{Class point} % (fold)
+\section{Class \Iclass{point}} % (fold)
\label{sec:class_point}
-The first one is the base of the package, it is the class \tkzname{point}. This class is hybrid in the sense that it is as much about points of a plane as complex numbers. The principle is the following: the plane is provided with an orthonormal basis which allows us to determine the placement of a point using its abscissa and ordinate coordinates; in the same way any complex number can simply be considered 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 affix $z.A$. This affix will be with Lua stored in the table $z$ in the form of a couple of real numbers $(x_A,y_A)$. The first element being the real part of the complex, and the second the imaginary part. There will be an identification between the and its corresponding affix. More precisely, for Lua the name of the point is the key that allows the table to designate the pair of reals associated to the affix.
+The class on which the whole edifice rests, it's the class \Iclass{point}. This class is hybrid in the sense that it is as much about points of a plane as complex numbers. The principle is the following: the plane is provided with an orthonormal basis which allows us to determine the placement of a point using its abscissa and ordinate coordinates; in the same way any complex number can simply be considered 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, like type, argument and modulus.
-Writing |z.A = point: new (2,3) | creates an object of class point where |z.A = 2+3i|.
The creation of a point is done using the following method, but there are other possibilities. If a scaling factor has been given, the method takes it into account.
+\setbox\strutbox=\hbox{\vrule height6.8pt depth3.2pt width0pt}
-\subsection{Attributs of a point} % (fold)
-\label{sub:attributs_of_a_point}
+ \def\size{42mm}
+\begin{tikzpicture}[remember picture]
+ \node[ draw, fill=red!10] (tbl) {%
+ \centering
+ \begin{minipage}{\size}
+ \hspace{\fill} \texttt{Arguments}\hspace{\fill}
+
+ \tikz\node[minimum width=\size,font=\small,
+ draw, fill=cyan!10,
+ rectangle split, rectangle split parts=5
+ ] {
+ \texttt{re (real)\strutbox}
+ \nodepart{two}\texttt{im (real)\strutbox}
+ \nodepart{three}\texttt{type = 'point'\strutbox}
+ \nodepart{four}\texttt{argument (rad)\strutbox}
+ \nodepart{five}\texttt{modulus (cm)\strutbox}
+ };
+
+ \hspace{\fill} \texttt{Methods}\hspace{\fill}
+
+ \tikz\node[minimum width=\size,font=\small,
+ draw, fill=orange!20,sharp corners,
+ rectangle split, rectangle split parts=4
+ ] {
+ \texttt{homothety(coeff,obj)\strutbox}
+ \nodepart{two}\texttt{rotation (angle,object)\strutbox}
+ \nodepart{three}\texttt{symmetry (object)\strutbox}
+ \nodepart{four}\texttt{\ldots}
+ };
+
+ \end{minipage}
+ };
+ \node[ draw, fill=red!10,,minimum height = 2em,
+ rounded corners,anchor=south] (tc) at (tbl.north){Class |Point|};
+\end{tikzpicture}
+\hspace{5cm}\begin{tikzpicture}[remember picture]
+ \node[ draw, fill=red!10] (tbl) {%
+ \centering
+ \begin{minipage}{\size}
+ \hspace{\fill} \texttt{Arguments}\hspace{\fill}
+
+ \tikz\node[minimum width=\size,font=\small,
+ draw, fill=cyan!10,
+ rectangle split, rectangle split parts=5
+ ] {
+ \texttt{re = 1\strutbox}
+ \nodepart{two}\texttt{im = 2\strutbox}
+ \nodepart{three}\texttt{type = 'point'\strutbox}
+ \nodepart{four}\texttt{argument = atan(2)\strutbox}
+ \nodepart{five}\texttt{modulus = $\sqrt{5}$\strutbox}
+ };
+
+ \hspace{\fill} \texttt{Methods}\hspace{\fill}
+
+ \tikz\node[minimum width=\size,font=\small,
+ draw, fill=orange!20,sharp corners,
+ rectangle split, rectangle split parts=4
+ ] {
+ \texttt{homothety(coeff,obj)\strutbox}
+ \nodepart{two}\texttt{rotation (angle,object)\strutbox}
+ \nodepart{three}\texttt{symmetry (object)\strutbox}
+ \nodepart{four}\texttt{\ldots\strutbox}
+ };
+
+ \end{minipage}
+ };
+ \node[ draw, fill=red!10,remember picture,minimum height = 2em,
+ rounded corners,anchor=south] (to) at (tbl.north){object |z.A|};
+\end{tikzpicture}
+
+\begin{tikzpicture}[remember picture,overlay]
+\draw [thick,->](tc.east) -- (to.west);
+\end{tikzpicture}
+
+\subsection{Attributes of a point} % (fold)
+\label{sub:attributes_of_a_point}
% Method \Imeth{point}{new}
-|z.A = point: new (1,2)|. The point $A$ has coordinates $x=1$ and $y=2$. If you use the notation |z.A| then $A$ will be the reference of a node in \TIKZ\ or in \pkg{tkz-euclide}.
+
+\begin{mybox}
+ Creation |z.A = point: new (1,2) |
+\end{mybox}
+ The point $A$ has coordinates $x=1$ and $y=2$. If you use the notation |z.A| then $A$ will be the reference of a node in \TIKZ\ or in \pkg{tkz-euclide}.
This is the creation of a fixed point with coordinates 1 and 2 and which is named $A$. The notation |z.A| indicates that the coordinates will be stored in a table noted |z| (reference to the notation of the affixes of the complex numbers) that A is the name of the point and the key allowing access to the values.
-\bgroup
-\catcode`_=12
+\vspace{1em}
+\bgroup
\small
-\begin{center}
-%\caption{Attributes about point class.}
-\begin{tabular}{ll}
+\catcode`_=12
+\captionof{table}{Point attributes.}
+\begin{tabular}{lll}
\toprule
-\textbf{Attributes} & \textbf{Application}\\
-\Iattr{point}{re} & |z.a.re| \tkzar z.a = point:new (2,3) x = z.a.re -> x=2\\
-\Iattr{point}{im} & |z.a.im| \tkzar z.a = point:new (2,3) y= z.a.im -> y=3\\
-\Iattr{point}{type} & |z.a.type| \tkzar |z.a.type = point|\\
-\Iattr{point}{argument} & |z.a.argument| \tkzar |z.a.argument = 0.78539816339745| if z.a = 1+i\\
-\Iattr{point}{module} & |z.a.module| \tkzar |z.a.module = 1.4142135623731| if z.a = 1+i\\
+\textbf{Attributes} & \textbf{Application}\\
+\Iattr{point}{re} & |z.A.re| &\tkzar |z.A = point:new (1,2) x = z.A.re|=1\\
+\Iattr{point}{im} & |z.A.im| &\tkzar |z.A = point:new (1,2) y= z.A.im|=2\\
+\Iattr{point}{type} & |z.A.type| &\tkzar |z.A.type = 'point'|\\
+\Iattr{point}{argument} & |z.A.argument| &\tkzar |z.A.argument $\approx$ 0.78539816339745|\\
+\Iattr{point}{module} & |z.A.module| &\tkzar |z.A.module| $\approx$ |2.2360...| =$\sqrt{5}$\\
\bottomrule
\end{tabular}
-\end{center}
\egroup
+\newpage
\subsubsection{Example:point attributes} % (fold)
\label{ssub:example_point_attributes}
-\begin{tkzexample}[latex=0cm,small,code only]
+
\begin{tkzelements}
- z.O = point: new (0 , 0)
- z.a = point: new (2, 3)
- x = z.a.re
- y = z.a.im
- ty = z.a.type
- arg = z.a.argument
- m = z.a.modulus
+ z.M = point: new (1,2)
\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzInit[ymax=4,xmax=7]
- \tkzGrid
- \tkzDrawPoints(a,O)
- \tkzLabelPoints[above](O,a)
- \tkzLabelPoint[below](a){
- \begin{minipage} {5cm}
- x=\tkzUseLua{x}\\ y=\tkzUseLua{y}\\ type =\tkzUseLua{ty}\\ argument = \tkzUseLua{arg} \\ module = \tkzUseLua{m}
- \end{minipage}}
-\end{tikzpicture}
-\end{tkzexample}
+\hspace*{\fill}
+
+\begin{verbatim}
\begin{tkzelements}
- z.O = point: new (0 , 0)
- z.a = point: new (2, 3)
- x = z.a.re
- y = z.a.im
- ty = z.a.type
- arg = z.a.argument
- m = z.a.modulus
+ z.M = point: new (1,2)
\end{tkzelements}
+\end{verbatim}
+\pgfkeys{/pgf/number format/.cd,std,precision=2}
+\let\pmpn\pgfmathprintnumber
+\DeleteShortVerb{\|}
- \hspace*{\fill}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzInit[ymax=5,xmax=7]
- \tkzGrid
- \tkzDrawPoints(a,O)
- \tkzLabelPoints[above](O,a)
- \tkzLabelPoint[below right](a){
- \begin{minipage} {5cm}
- x=\tkzUseLua{x}\\ y=\tkzUseLua{y}\\
- type =\tkzUseLua{ty}\\ argument = \tkzUseLua{arg} \\
- module = \tkzUseLua{m}
- \end{minipage}}
+\begin{verbatim}
+\begin{tikzpicture}[scale = 1]
+\pgfkeys{/pgf/number format/.cd,std,precision=2}
+\let\pmpn\pgfmathprintnumber
+\tkzDefPoints{2/4/M,2/0/A,0/0/O,0/4/B}
+\tkzLabelPoints(O)
+\tkzMarkAngle[fill=gray!30,size=1](A,O,M)
+\tkzLabelAngle[pos=1,right](A,O,M){%
+$\theta \approx \pmpn{\tkzUseLua{z.M.argument}}$ rad}
+\tkzDrawSegments(O,M)
+\tkzLabelSegment[above,sloped](O,M){%
+$|z_M| =\sqrt{5}\approx \pmpn{\tkzUseLua{z.M.modulus}}$ cm}
+\tkzLabelPoint[right](M){$M : z_M = 1 + 2i$}
+\tkzDrawPoints(M,A,O,B)
+\tkzPointShowCoord(M)
+\tkzLabelPoint[below,teal](A){$\tkzUseLua{z.M.re}$}
+\tkzLabelPoint[left,teal](B){$\tkzUseLua{z.M.im}$}
+\tkzDrawSegments[->,add = 0 and 0.25](O,B O,A)
+\end{tikzpicture}
+\end{verbatim}
+
+
+\begin{center}
+ \begin{tikzpicture}
+ \pgfkeys{/pgf/number format/.cd,std,precision=2}
+ \let\pmpn\pgfmathprintnumber
+ \tkzDefPoints{2/4/M,2/0/A,0/0/O,0/4/B}
+ \tkzLabelPoints(O)
+ \tkzMarkAngle[fill=gray!30,size=1](A,O,M)
+ \tkzLabelAngle[pos=1,right](A,O,M){%
+ $\theta \approx \pmpn{\tkzUseLua{z.M.argument}}$ rad}
+ \tkzDrawSegments(O,M)
+ \tkzLabelSegment[above,sloped](O,M){%
+ $|z_M| =\sqrt{5}\approx \pmpn{\tkzUseLua{z.M.modulus}}$ cm}
+ \tkzLabelPoint[right](M){$M : z_M = 1 + 2i$}
+ \tkzDrawPoints(M,A,O,B)
+ \tkzPointShowCoord(M)
+ \tkzLabelPoint[below,teal](A){$\tkzUseLua{z.M.re}$}
+ \tkzLabelPoint[left,teal](B){$\tkzUseLua{z.M.im}$}
+ \tkzDrawSegments[->,add = 0 and 0.25](O,B O,A)
+ \begin{scope}[every annotation/.style={fill=lightgray!15,anchor = east}]
+ \node [annotation,font =\small,text width=6cm] at (current bounding box.west) {
+Attributes of \texttt{z.M}
+ \begin{itemize}
+ \item \texttt{z.M.re} = 1
+ \item \texttt{z.M.im} = 2
+ \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
+ \end{itemize}
+ };
+ \end{scope}
\end{tikzpicture}
+\end{center}
+
+\MakeShortVerb{\|}
\hspace*{\fill}
% \caption{Class Point}
% subsubsection example_point_attributes (end)
-% subsection attributs_of_a_point (end)
+% subsection attributes_of_a_point (end)
+
+\subsubsection{Argand diagram} % (fold)
+\label{ssub:argand_diagram}
+\normalsize
+\begin{minipage}{\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.A = point : new ( 2 , 3 )
+ z.O = point : new ( 0 , 0 )
+ z.I = point : new ( 1 , 0 )
+ \end{tkzelements}
+ \hspace{\fill}\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzInit[xmin=-4,ymin=-4,xmax=4,ymax=4]
+ \tkzDrawCircle[dashed,red](O,A)
+ \tkzPointShowCoord(A)
+ \tkzDrawPoint(A)
+ \tkzLabelPoint[above right](A){\normalsize $a+ib$}
+ \tkzDrawX\tkzDrawY
+ \tkzDrawSegment(O,A)
+ \tkzLabelSegment[above,anchor=south,sloped](O,A){ OA = modulus of $z_A$}
+ \tkzLabelAngle[anchor=west,pos=.5](I,O,A){$\theta$ = argument of $z_A$}
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+
+\begin{minipage}{\textwidth}
+ \begin{tkzelements}
+ z.A = point : new ( 2 , 3 )
+ z.O = point : new ( 0 , 0 )
+ z.I = point : new ( 1 , 0 )
+ \end{tkzelements}
+ \hspace{\fill}\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzInit[xmin=-4,ymin=-4,xmax=4,ymax=4]
+ \tkzDrawCircle[dashed,red](O,A)
+ \tkzPointShowCoord(A)
+ \tkzDrawPoint(A)
+ \tkzLabelPoint[above right](A){\normalsize $a+ib$}
+ \tkzDrawX\tkzDrawY
+ \tkzDrawSegment(O,A)
+ \tkzLabelSegment[above,anchor=south,sloped](O,A){ OA = modulus of $z_A$}
+ \tkzLabelAngle[anchor=west,pos=.5](I,O,A){$\theta$ = argument of $z_A$}
+ \end{tikzpicture}
+ \hspace{\fill}
+\end{minipage}
+
+% subsubsection argand_diagram (end)
+\newpage
\subsection{Methods of the class point} % (fold)
\label{sub:methods_of_the_class_point}
-The methods described in the following table are standard. You'll find them in most of the examples at the end of this documentation. The result of the different methods presented in the following table is a \tkzNameObj{point}. A word about methods beginning with |set_|. The purpose is to be able to apply a method to a list of points.
+The methods described in the following table are standard. You'll find them in most of the examples at the end of this documentation. The result of the different methods presented in the following table is a \tkzNameObj{point}.
+\vspace{1em}
\bgroup
\catcode`_=12
-
\small
-\begin{center}
-%\caption{Methods from elements\_points.lua }
-\begin{tabular}{ll}
+\captionof{table}{Methods of the class point.}
+\begin{tabular}{lll}
\toprule
-\textbf{Methods} & \textbf{Application} \\
+\textbf{Methods} & \textbf{Application}& \\
\midrule
+ new (a,b) & |z.a = point : new(1,2)| &\tkzar affix z.a=1+2i \\
+ polar (radius, phi) & |z.a = point : polar(1,math.pi/3)| &\tkzar affix $cos(\pi/3)+sin(\pi/3)i$ \\
+ polar_deg (radius, phi) & phi in deg &\tkzar polar coordinates phi deg \\
\midrule
- \textbf{Points} &\\
+ \textbf{Points} &&\\
\midrule
- new (a,b) & |z.a = point : new(1,2)| \tkzar affix z.a=1+2i \\
- polar (radius, phi) & |z.a = point : polar(1,math.pi/3)| \tkzar affix $cos(\pi/3)+sin(\pi/3)i$ \\
- polar_deg (radius, phi) & phi in deg \tkzar polar coordinates phi deg \\
- north(d) & see \ref{sub:power_v2} |d| distance to the point 1 if empty \\
+ north(d) & see \ref{sub:power_v2} |d| distance to the point & d=1 1 if empty \\
south(d) & \\
east(d) & \\
west(d) & \\
- symmetry(z) & |z.c = z.a:symmetry(z.b)| \tkzar c symmetry of b with respect to a\\
- set\_symmetry (...) & |z.bp,z.cp = z.a : symmetry(z.b,z.c)| \tkzar list of points\\
- rotation(angle , pt) & |z.c = z.a : rotation (math.pi/2,z.b)| \tkzar affix; rotation center a\\
- set\_rotation (angle,...)& \\
- homothety(k,pt) & |z.c = z.a : homothety (2,z.b)| \\
- set\_homothety (k,...) & \\
- normalize() & |z.b = z.a: normalize () | \tkzar |z.b| = 1 and z.a = k$\times$ z.b \\
+ normalize() & |z.b = z.a: normalize ()| &\tkzar |z.b| = 1 and z.a = k$\times$ z.b \\
+ get_points (obj) & retrieves points from the object & \\
+ \midrule
+ \textbf{Transformations} &&\\
+ \midrule
+ symmetry(obj) & obj : point,line,etc. &\tkzar z.a:symmetry (C.OH) \\
+ rotation(angle , obj) & point,line,etc. &\tkzar rotation center a\\
+ homothety(k,obj) & |z.c = z.a : homothety (2,z.b)| & \\
\bottomrule %
\end{tabular}
-\end{center}
+\egroup
+
+\subsubsection{Example: method \Imeth{point}{north (d)} } % (fold)
+\label{ssub:example_method_imeth_point_north_d}
- \egroup
+If |d| is absent then it is considered equal to 1.
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.O = point : new ( 0, 0 )
+ z.A = z.O : east ()
+ z.Ap = z.O : east (2) : north (2)
+ z.B = z.O : north ()
+ z.C = z.O : west ()
+ z.D = z.O : south ()
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPoints(A,B,C,D,O,A')
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+ scale = 1.5
+ z.O = point : new ( 0, 0 )
+ z.A = z.O : east ()
+ z.Ap = z.O : east (2) : north (2)
+ z.B = z.O : north ()
+ z.C = z.O : west ()
+ z.D = z.O : south ()
+\end{tkzelements}
+\hspace{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPoints(A,B,C,D,O,A')
+ \tkzLabelPoints(A,B,C,D,O,A')
+\end{tikzpicture}
+\end{minipage}
+% subsubsection example_method_imeth_point_north_d (end)
\subsubsection{Example: method \Imeth{point}{polar} } % (fold)
\label{ssub:example_polar_method}
\begin{minipage}{0.6\textwidth}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
- scale = .5
z.O = point: new (0, 0)
z.A = point: new (3, 0)
- z.F = point: polar (3, math.pi/6)
+ z.F = point: polar (3, math.pi/3)
\end{tkzelements}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle(O,A)
- \tkzDrawSegments[new](O,A)
- \tkzDrawSegments[purple](O,F)
- \tkzDrawPoints(A,O,F)
- \tkzLabelPoints(A,O,F)
- \end{tikzpicture}
- \end{tkzexample}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircle(O,A)
+ \tkzDrawSegments[new](O,A)
+ \tkzDrawSegments[purple](O,F)
+ \tkzDrawPoints(A,O,F)
+ \tkzLabelPoints[below right=6pt](A,O,F)
+\end{tikzpicture}
+\end{tkzexample}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\begin{tkzelements}
- scale = .5
+ scale = .75
z.O = point: new (0, 0)
z.A = point: new (3, 0)
- z.F = point: polar (3, math.pi/6)
+ z.F = point: polar (3, math.pi/3)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -168,50 +357,153 @@ The methods described in the following table are standard. You'll find them in m
\end{tikzpicture}
\hspace*{\fill}
\end{minipage}
-% \caption{Method polar}
-
% subsubsection example_polar_method (end)
-\subsubsection{Example: rotation of points method \Imeth{point}{set\_rotation}} % (fold)
+\subsubsection{Example: rotation of points} % (fold)
\label{ssub:example_rotation_of_points}
+\begin{minipage}{.6\textwidth}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
- z.a = point: new(0, -1)
- z.b = point: new(4, 0)
- z.o = point: new(6, -2)
- z.ap,z.bp = z.o : set_rotation (math.pi/2,z.a,z.b)
+ z.a = point: new(0, -1)
+ z.b = point: new(4, 0)
+ z.o = point: new(6, -2)
+ z.ap,z.bp = z.o : rotation (math.pi/2,z.a,z.b)
\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines(o,a o,a' o,b o,b')
- \tkzDrawPoints(a,a',b,b',o)
- \tkzLabelPoints(a,a',b,b',o)
- \tkzDrawArc(o,a)(a')
- \tkzDrawArc(o,b)(b')
- \end{tikzpicture}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(o,a o,a' o,b o,b')
+ \tkzDrawPoints(a,a',b,b',o)
+ \tkzLabelPoints(b,b',o)
+ \tkzLabelPoints[below left](a,a')
+ \tkzDrawArc(o,a)(a')
+ \tkzDrawArc(o,b)(b')
+ \end{tikzpicture}
\end{tkzexample}
-
+\end{minipage}
+\begin{minipage}{.4\textwidth}
\begin{tkzelements}
- scale = .5
- z.a = point: new(0, -1)
- z.b = point: new(4, 0)
- z.o = point: new(6, -2)
- z.ap,z.bp = z.o : set_rotation (math.pi/2,z.a,z.b)
+ scale = .5
+ z.a = point: new(0, -1)
+ z.b = point: new(4, 0)
+ z.o = point: new(6, -2)
+ z.ap,z.bp = z.o : rotation (math.pi/2,z.a,z.b)
\end{tkzelements}
-
-
\hspace*{\fill}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines(o,a o,a' o,b o,b')
- \tkzDrawPoints(a,a',b,b',o)
- \tkzLabelPoints(a,a',b,b',o)
- \tkzDrawArc(o,a)(a')
- \tkzDrawArc(o,b)(b')
- \end{tikzpicture}
-\hspace*{\fill}
-%\caption{Rotation of points}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(o,a o,a' o,b o,b')
+ \tkzDrawPoints(a,a',b,b',o)
+ \tkzLabelPoints(b,b',o)
+ \tkzLabelPoints[below left](a,a')
+ \tkzDrawArc(o,a)(a')
+ \tkzDrawArc(o,b)(b')
+\end{tikzpicture}
+\end{minipage}
% subsubsection example_rotation_of_points (end)
+
+\subsubsection{Object rotation} % (fold)
+\label{ssub:object_rotation}
+Rotate a triangle by an angle of $\pi/6$ around $O$.
+
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+\begin{tkzelements}
+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.C = T.ABC.pc
+T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
+z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
+\end{tkzelements}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \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')
+\end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+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.C = T.ABC.pc
+T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
+z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
+\end{tkzelements}
+
+\hspace{\fill}\begin{tikzpicture}
+ \tkzGetNodes
+ \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)
+ \begin{scope}
+ \tkzDrawArc[delta=0,->,dashed,red](O,A)(A')
+ \tkzDrawSegments[dashed,red](O,A O,A')
+ \end{scope}
+
+\end{tikzpicture}
+\end{minipage}
+% subsubsection object_rotation (end)
+
+\subsubsection{Object symmetry} % (fold)
+\label{ssub:object_symmetry}
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.a = point: new(0,-1)
+ z.b = point: new(2, 0)
+ L.ab = line : new (z.a,z.b)
+ C.ab = circle : new (z.a,z.b)
+ z.o = point: new(1,1)
+ z.ap,z.bp = get_points (z.o: symmetry (C.ab))
+ \end{tkzelements}
+
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(a,b a',b')
+ \tkzDrawLines(a,a' b,b')
+ \tkzDrawLines[red](a,b a',b')
+ \tkzDrawPoints(a,a',b,b',o)
+ \tkzLabelPoints(a,a',b,b',o)
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+ z.a = point: new(0, -1)
+ z.b = point: new(2, 0)
+ L.ab = line : new (z.a,z.b)
+ C.ab = circle : new (z.a,z.b)
+ z.o = point: new(1, 1)
+ z.ap,z.bp = get_points (z.o: symmetry (C.ab))
+\end{tkzelements}
+
+\hspace{\fill}\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles(a,b a',b')
+\tkzDrawLines(a,a' b,b')
+\tkzDrawLines[red](a,b a',b')
+\tkzDrawPoints(a,a',b,b',o)
+\tkzLabelPoints(a,a',b,b',o)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection object_symmetry (end)
% subsection methods_of_the_class_point (end)
% section class_point (end)
\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
new file mode 100644
index 0000000000..1e1a23b1d4
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
@@ -0,0 +1,160 @@
+\newpage
+\section{Classe \Iclass{Quadrilateral}} % (fold)
+
+\subsection{Quadrilateral Attributes} % (fold)
+\label{sub:quadrilateral_attributes}
+
+Points are created in the direct direction. A test is performed to check whether the points form a rectangle, otherwise compilation is blocked.
+
+\begin{mybox}
+Creation | Q.new = rectangle : new (z.A,z.B,z.C,z.D)|
+\end{mybox}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{rectangle attributes.}
+\begin{tabular}{lll}
+\toprule
+\textbf{Attributes} & \textbf{Application} & \\
+\Iattr{quadrilateral}{pa} & |z.A = Q.new.pa| & \\
+\Iattr{quadrilateral}{pb} & |z.B = Q.new.pb| & \\
+\Iattr{quadrilateral}{pc} & |z.C = Q.new.pc| & \\
+\Iattr{quadrilateral}{pd} & |z.D = Q.new.pd| & \\
+\Iattr{quadrilateral}{type} & |Q.new.type= 'quadrilateral'| &\\
+\Iattr{quadrilateral}{i} & |z.I = Q.new.i| & intersection of diagonals\\
+\Iattr{quadrilateral}{g} & |z.G = Q.new.g| & barycenter\\
+\Iattr{quadrilateral}{a} & |AB = Q.new.a| & barycenter\\
+\Iattr{quadrilateral}{b} & |BC = Q.new.b| & barycenter\\
+\Iattr{quadrilateral}{c} & |CD = Q.new.c| & barycenter\\
+\Iattr{quadrilateral}{d} & |DA = Q.new.d| & barycenter\\
+\Iattr{quadrilateral}{ab} & |Q.new.ab| & line passing through two vertices \\
+\Iattr{quadrilateral}{ac} & |Q.new.ca| & idem. \\
+\Iattr{quadrilateral}{ad} & |Q.new.ad| & idem. \\
+\Iattr{quadrilateral}{bc} & |Q.new.bc| & idem. \\
+\Iattr{quadrilateral}{bd} & |Q.new.bd| & idem. \\
+\Iattr{quadrilateral}{cd} & |Q.new.cd| & idem. \\
+\bottomrule
+\end{tabular}
+\egroup
+
+\subsubsection{Quadrilateral attributes} % (fold)
+\label{ssub:quadrilateral_attributes}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 5 , 1 )
+z.D = point : new ( -1 , 4 )
+Q.ABCD = quadrilateral : new ( z.A , z.B , z.C , z.D )
+z.I = Q.ABCD.i
+z.G = Q.ABCD.g
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawSegments(A,C B,D)
+\tkzDrawPoints(A,B,C,D,I,G)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 5 , 1 )
+z.D = point : new ( -1 , 4 )
+Q.ABCD = quadrilateral : new ( z.A , z.B , z.C , z.D )
+z.I = Q.ABCD.i
+z.G = Q.ABCD.g
+\end{tkzelements}
+
+\hspace{\fill}\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawSegments(A,C B,D)
+\tkzDrawPoints(A,B,C,D,I,G)
+\end{tikzpicture}
+\end{minipage}
+
+% subsubsection quadrilateral_attributes (end)
+% subsection quadrilateral_attributes (end)
+
+\subsection{Quadrilateral methods} % (fold)
+\label{sub:quadrilateral_methods}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Quadrilateral methods.}
+\begin{tabular}{ll}
+\toprule
+\textbf{Methods} & \textbf{Comments} \\
+\midrule \\
+\Imeth{quadrilateral}{cyclic ()} & inscribed ? (see next example)\\
+\bottomrule %
+\end{tabular}
+\egroup
+
+\subsubsection{Inscribed quadrilateral} % (fold)
+\label{ssub:inscribed_quadrilateral}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.D = point : polar ( 4 , 2*math.pi/3 )
+L.DB = line : new (z.D,z.B)
+T.equ = L.DB : equilateral ()
+z.C = T.equ.pc
+Q.new = quadrilateral : new (z.A,z.B,z.C,z.D)
+bool = Q.new : cyclic ()
+if bool == true then
+C.cir = triangle : new (z.A,z.B,z.C): circum_circle ()
+z.O = C.cir.center
+end
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B,C,D)
+\tkzDrawCircle(O,A)
+\ifthenelse{\equal{\tkzUseLua{bool}}{true}}{
+\tkzDrawCircle(O,A)}{}
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.D = point : polar ( 4 , 2*math.pi/3 )
+L.DB = line : new (z.D,z.B)
+T.equ = L.DB : equilateral ()
+z.C = T.equ.pc
+Q.new = quadrilateral : new (z.A,z.B,z.C,z.D)
+bool = Q.new : cyclic ()
+if bool == true then
+C.cir = triangle : new (z.A,z.B,z.C): circum_circle ()
+z.O = C.cir.center
+end
+\end{tkzelements}
+\hspace{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B,C,D)
+\tkzDrawCircle(O,A)
+\ifthenelse{\equal{\tkzUseLua{bool}}{true}}{
+\tkzDrawCircle(O,A)}{}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection inscribed_quadrilateral (end)
+
+% subsection quadrilateral_methods (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
new file mode 100644
index 0000000000..29e9fb89d4
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
@@ -0,0 +1,298 @@
+\newpage
+\section{Classe \Iclass{rectangle}} % (fold)
+
+\subsection{Rectangle attributes} % (fold)
+\label{sub:rectangle_attributes}
+
+
+Points are created in the direct direction. A test is performed to check whether the points form a rectangle, otherwise compilation is blocked.
+
+\begin{mybox}
+Creation | R.ABCD = rectangle : new (z.A,z.B,z.C,z.D)|
+\end{mybox}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{rectangle attributes.}
+\begin{tabular}{lll}
+\toprule
+\textbf{Attributes} & \textbf{Application} & \\
+\Iattr{rectangle}{pa} & |z.A = R.ABCD.pa| & \\
+\Iattr{rectangle}{pb} & |z.B = R.ABCD.pb| & \\
+\Iattr{rectangle}{pc} & |z.C = R.ABCD.pc| & \\
+\Iattr{rectangle}{pd} & |z.D = R.ABCD.pd| & \\
+\Iattr{rectangle}{type} & |R.ABCD.type= 'rectangle'| &\\
+\Iattr{rectangle}{center} & |z.I = R.ABCD.center| & center of the rectangle\\
+\Iattr{rectangle}{length} & |R.ABCD.length| & the length \\
+\Iattr{rectangle}{width} & |R.ABCD.width| & the width \\
+\Iattr{rectangle}{diagonal} & |R.ABCD.diagonal| & diagonal length\\
+\Iattr{rectangle}{ab} & |R.ABCD.ab| & line passing through two vertices \\
+\Iattr{rectangle}{ac} & |R.ABCD.ca| & idem. \\
+\Iattr{rectangle}{ad} & |R.ABCD.ad| & idem. \\
+\Iattr{rectangle}{bc} & |R.ABCD.bc| & idem. \\
+\Iattr{rectangle}{bd} & |R.ABCD.bd| & idem. \\
+\Iattr{rectangle}{cd} & |R.ABCD.cd| & idem. \\
+\bottomrule
+\end{tabular}
+\egroup
+
+\subsubsection{Example} % (fold)
+\label{ssub:example}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 4 , 4)
+z.D = point : new ( 0 , 4)
+R.new = rectangle : new (z.A,z.B,z.C,z.D)
+z.I = R.new.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\hspace{\fill}\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+ scale =1.5
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 0 )
+ z.C = point : new ( 4 , 2)
+ z.D = point : new ( 0 , 2)
+ R.new = rectangle : new (z.A,z.B,z.C,z.D)
+ z.I = R.new.center
+ \end{tkzelements}
+
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawSegment[dashed](A,C)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C,D)
+ \tkzDrawPoints[red](I)
+ \tkzLabelPoint[right = 10pt](I){$I$\\ |R.new.center|}
+ \tkzLabelSegment[sloped,above](C,D){|R.new.length| = \pmpn{\tkzUseLua{R.new.length}}}
+ \tkzLabelSegment[sloped,above](A,C){|R.new.diagonal| = \pmpn{\tkzUseLua{R.new.diagonal}}}
+ % \tkzUseLua{R.new.length} and \tkzUseLua{R.new.diagonal} to get the values.
+\end{tikzpicture}
+\end{minipage}
+% subsubsection example (end)
+% subsection rectangle_attributes (end)
+
+\newpage
+\subsection{Rectangle methods} % (fold)
+\label{sub:rectangle_methods}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Rectangle methods.}
+\begin{tabular}{lll}
+\toprule
+\textbf{Methods} & \textbf{Comments} & \\
+\midrule
+\Imeth{rectangle}{angle (zi,za,angle)} &|R.ang = rectangle : angle (z.I,z.A)| ; |z.A | &vertex ; ang angle between 2 vertices\\
+\midrule
+\Imeth{rectangle}{gold (za,zb)} & |R.gold = rectangle : gold (z.A,z.B)| &length/width = $\phi$\\
+\midrule
+\Imeth{rectangle}{diagonal (za,zc)} &|R.diag = rectangle : diagonal (z.I,z.A)| &$I$ square center $A$ first vertex\\
+\midrule
+\Imeth{rectangle}{side (za,zb,d)} &|S.IA = rectangle : side (z.I,z.A)|& $I$ square center $A$ first vertex\\
+\midrule
+\Imeth{rectangle}{get\_lengths ()} &|S.IA = rectangle : get_lengths ()|& $I$ square center $A$ first vertex\\
+\bottomrule %
+\end{tabular}
+\egroup
+
+\subsubsection{Angle method} % (fold)
+\label{ssub:angle_method}
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+scale = .5
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 4 , 3 )
+P.ABCD = rectangle : angle ( z.C , z.A , math.pi/6)
+z.B = P.ABCD.pb
+z.C = P.ABCD.pc
+z.D = P.ABCD.pd
+z.I = P.ABCD.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C)
+\tkzLabelPoints(A,B,C,D)
+\tkzDrawPoints[new](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+scale = .5
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 4 , 3 )
+P.ABCD = rectangle : angle ( z.C , z.A , math.pi/6)
+z.B = P.ABCD.pb
+z.C = P.ABCD.pc
+z.D = P.ABCD.pd
+z.I = P.ABCD.center
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[new](I)
+\tkzLabelSegment[sloped,above](A,B){|rectangle: angle (z.C,z.A,math.pi/6)|}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection angle_method (end)
+
+\subsubsection{Side method} % (fold)
+\label{ssub:side_method}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 3 )
+R.side = rectangle : side (z.A,z.B,3)
+z.C = R.side.pc
+z.D = R.side.pd
+z.I = R.side.center
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 3 )
+R.side = rectangle : side (z.A,z.B,3)
+z.C = R.side.pc
+z.D = R.side.pd
+z.I = R.side.center
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\tkzLabelSegment[sloped,above](A,B){|rectangle : side (z.A,z.B,3)|}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection side_method (end)
+
+\subsubsection{Diagonal method} % (fold)
+\label{ssub:diagonal_method}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.E = point : new ( 0 , 0 )
+z.G = point : new ( 4 , 3 )
+R.diag = rectangle : diagonal (z.E,z.G)
+z.F = R.diag.pb
+z.H = R.diag.pd
+z.I = R.diag.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(E,F,G,H)
+\tkzDrawPoints(E,F,G,H)
+\tkzLabelPoints((E,F)
+\tkzLabelPoints[above](G,H)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.C = point : new ( 4 , 3 )
+R.diag = rectangle : diagonal (z.A,z.C)
+z.B = R.diag.pb
+z.D = R.diag.pd
+z.I = R.diag.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\tkzLabelSegment[sloped,above](A,B){|rectangle : diagonal (z.A,z.C)|}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection diagonal_method (end)
+
+\subsubsection{Gold method} % (fold)
+\label{ssub:gold_method}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.X = point : new ( 0 , 0 )
+z.Y = point : new ( 4 , 2 )
+R.gold = rectangle : gold (z.A,z.B)
+z.C = R.gold.pc
+z.D = R.gold.pd
+z.I = R.gold.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+z.X = point : new ( 0 , 0 )
+z.Y = point : new ( 4 , 2 )
+R.gold = rectangle : gold (z.X,z.Y)
+z.Z = R.gold.pc
+z.W = R.gold.pd
+z.I = R.gold.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(X,Y,Z,W)
+\tkzDrawPoints(X,Y,Z,W)
+\tkzLabelPoints(X,Y)
+\tkzLabelPoints[above](Z,W)
+\tkzDrawPoints[red](I)
+\tkzLabelSegment[sloped,above](X,Y){|rectangle : gold (z.X,z.Y)|}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection gold_method (end)
+% subsection rectangle_methods (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
new file mode 100644
index 0000000000..4a25afdfe5
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
@@ -0,0 +1,103 @@
+\newpage
+\section{Classe \Iclass{Regular Polygon}} % (fold)
+
+\subsection{regular\_polygon attributes} % (fold)
+\label{sub:regular_polygon_attributes}
+
+\begin{mybox}
+Creation | RP.IA = regular_polygon : new (z.I,z.A,6)|
+\end{mybox}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Regular\_polygon attributes.}
+\begin{tabular}{ll}
+\toprule
+\textbf{Attributes} & \textbf{Application} \\
+\Iattr{square}{center} & |z.I = RP.IA.center| \\
+\Iattr{square}{table} & array containing all vertex affixes \\
+\Iattr{square}{through} & first vertex \\
+\Iattr{square}{circle} & defines the circle with center I passing through A \\
+\Iattr{square}{type} & |RP.IA.type= 'regular\_polygon'| \\
+\Iattr{square}{side} & |s = RP.IA.side| ; s = length of side\\
+\Iattr{square}{exradius}& |S.AB.exradius| ; radius of the circumscribed circle \\
+\Iattr{square}{inradius}& |S.AB.inxradius| ; radius of the inscribed circle \\
+\Iattr{square}{proj} & |RP.IA.proj| ; projection of the center on one side \\
+\Iattr{square}{angle} & |RP.IA.angle| ; angle formed by the center and 2 consecutive vertices \\
+\bottomrule %
+\end{tabular}
+\egroup
+
+\subsubsection{Pentagon} % (fold)
+\label{ssub:pentagon}
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.O = point: new (0,0)
+z.I = point: new (1,3)
+z.A = point: new (2,0)
+RP.five = regular_polygon : new (z.I,z.A,5)
+RP.five : name ("P_")
+C.ins = circle: radius (z.I,RP.five.inradius)
+z.H = RP.five.proj
+\end{tkzelements}
+\begin{tikzpicture}
+\def\nb{\tkzUseLua{RP.five.nb}}
+\tkzGetNodes
+\tkzDrawCircles(I,A I,H)
+\tkzDrawPolygon(P_1,P_...,P_\nb)
+\tkzDrawPoints[red](P_1,P_...,P_\nb,H,I)
+\tkzLabelPoints[red](I,A,H)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+ z.O = point: new (0,0)
+ z.I = point: new (1,3)
+ z.A = point: new (2,0)
+ RP.five = regular_polygon : new (z.I,z.A,5)
+ RP.five : name ("P_")
+ C.ins = circle : radius ( z.I , RP.five.inradius )
+ z.H = RP.five.proj
+ \end{tkzelements}
+ \hspace{\fill}
+ \begin{tikzpicture}
+ \def\nb{\tkzUseLua{RP.five.nb}}
+ \tkzGetNodes
+ \tkzDrawCircles(I,A I,H)
+ \tkzDrawPolygon(P_1,P_...,P_\nb)
+ \tkzDrawPoints[red](P_1,P_...,P_\nb,H,I)
+ \tkzLabelPoints[red](I,A,H)
+ \end{tikzpicture}
+\end{minipage}
+% subsubsection pentagon (end)
+% subsection regular_polygon_attributes (end)
+
+\subsection{regular\_polygon methods} % (fold)
+\label{sub:regular_polygon_methods}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Circle methods.}
+\begin{tabular}{ll}
+\toprule
+\textbf{Methods} & \textbf{Comments} \\
+\midrule \\
+\Imeth{regular\_polygon}{new(O,A,n)} &|RP.five = regular_polygon : new (z.I,z.A,5)| ; I center A first vertex 5 sides \\
+\midrule
+\textbf{Circle} &\\
+\midrule
+\Imeth{regular\_polygon}{incircle ()} & |C.IH = RP.five : incircle ()|\\
+\midrule
+\textbf{Points} &\\
+\midrule
+\Imeth{regular\_polygon}{name (string)} & see\ref{ssub:pentagon} \\
+\bottomrule %
+\end{tabular}
+\egroup
+
+% subsection regular_polygon_methods (end)
+
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
new file mode 100644
index 0000000000..15996c203f
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
@@ -0,0 +1,163 @@
+\newpage
+\section{Classe \Iclass{square}} % (fold)
+
+\subsection{Square attributes} % (fold)
+\label{sub:square_attributes}
+
+% subsection square_attributes (end)
+Points are created in the direct direction. A test is performed to check whether the points form a square, otherwise compilation is blocked.
+\begin{mybox}
+Creation | S.AB = square : new (z.A,z.B,z.C,z.D)|
+\end{mybox}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Square attributes.}
+\begin{tabular}{lll}
+\toprule
+\textbf{Attributes} & \textbf{Application} & \\
+\Iattr{square}{pa} & |z.A = S.AB.pa| & \\
+\Iattr{square}{pb} & |z.B = S.AB.pb| & \\
+\Iattr{square}{pc} & |z.C = S.AB.pc| & \\
+\Iattr{square}{pd} & |z.D = S.AB.pd| & \\
+\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}{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 \\
+\Iattr{square}{ac} & |S.AB.ca| & idem. \\
+\Iattr{square}{ad} & |S.AB.ad| & idem. \\
+\Iattr{square}{bc} & |S.AB.bc| & idem. \\
+\Iattr{square}{bd} & |S.AB.bd| & idem. \\
+\Iattr{square}{cd} & |S.AB.cd| & idem. \\
+\bottomrule %
+\end{tabular}
+\egroup
+\subsubsection{Example: square attributes } % (fold)
+\label{ssub:example_square_attributes}
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 4 , 4)
+z.D = point : new ( 0 , 4)
+S.new = square : new ( z.A , z.B ,z.C,z.D)
+z.I = S.new.center
+z.H = S.new.proj
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[orange](I,A I,H)
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D,H,I)
+\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,H){\pmpn{\tkzUseLua{S.new.inradius}}}
+\tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 0 )
+ z.C = point : new ( 4 , 4)
+ z.D = point : new ( 0 , 4)
+ S.new = square : new ( z.A , z.B ,z.C,z.D)
+ z.I = S.new.center
+ z.H = S.new.proj
+ \end{tkzelements}
+ \hspace{\fill}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles[orange](I,A I,H)
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPoints(A,B,C,D,H,I)
+ \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,H){\pmpn{\tkzUseLua{S.new.inradius}}}
+ \tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
+ \end{tikzpicture}
+\end{minipage}
+
+
+\newpage
+
+\subsection{Square methods} % (fold)
+\label{sub:square_methods}
+
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Square methods.}
+\begin{tabular}{lll}
+\toprule
+\textbf{Methods} & \textbf{Comments}& \\
+\midrule
+\Imeth{square}{rotation (zi,za)} &|S.IA = square : rotation (z.I,z.A)| &$I$ square center $A$ first vertex\\
+\midrule
+\Imeth{square}{side (za,zb)} & |S.AB = square : side (z.A,z.B)|& AB is the first side (direct)\\
+\bottomrule %
+\end{tabular}
+\egroup
+
+\subsubsection{Square with side method} % (fold)
+\label{ssub:square_with_side_method}
+%
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ scale = 2
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 2 , 1 )
+ S.side = square : side (z.A,z.B)
+ z.B = S.side.pb
+ z.C = S.side.pc
+ z.D = S.side.pd
+ z.I = S.side.center
+\end{tkzelements}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C,D)
+ \tkzDrawPoints[red](I)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+scale = 2
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 2 , 1 )
+S.side = square : side (z.A,z.B)
+z.B = S.side.pb
+z.C = S.side.pc
+z.D = S.side.pd
+z.I = S.side.center
+\end{tkzelements}
+\hspace{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](C,D)
+\tkzDrawPoints[red](I)
+\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
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
index 45515c3b7a..7b051cd723 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
@@ -1,73 +1,78 @@
\newpage
-\section{Classe triangle} % (fold)
+\section{Classe \Iclass{triangle}} % (fold)
\label{sec:classe_triangle}
-\subsection{Attributs of a triangle} % (fold)
-\label{sub:attributs_of_a_triangle}
-The triangle object is created using the \Imeth{triangle}{new} method, for example with | T.abc = triangle : new (z.a,z.b,z.c)| (See examples: \ref{sub:alternate}; \ref{sub:apollonius_circle}; \ref{sub:excircle} ). Multiple attributes are then created.
+\subsection{Attributes of a triangle} % (fold)
+\label{sub:attributes_of_a_triangle}
+The triangle object is created using the \Imeth{triangle}{new} method, for example with
+\begin{mybox}
+ Creation | T.ABC = triangle : new ( z.A , z.B , z.C ) |
+\end{mybox}
+(See examples: \ref{sub:alternate}; \ref{sub:apollonius_circle}; \ref{sub:excircles} ). Multiple attributes are then created.
\bgroup
\catcode`_=12
\small
-\begin{center}
-%\caption{Attributes about triangle class.}
+\captionof{table}{Triangle attributes.}
\begin{tabular}{ll}
\toprule
\textbf{Attributes} & \textbf{Application}\\
-\Iattr{triangle}{pa} &\\
-\Iattr{triangle}{pb} &\\
-\Iattr{triangle}{pc} &\\
-\Iattr{triangle}{circumcenter} & \\
-\Iattr{triangle}{centroid} &\\
-\Iattr{triangle}{incenter} &\\
-\Iattr{triangle}{orthocenter} &\\
-\Iattr{triangle}{eulercenter} & \\
+\Iattr{triangle}{pa} &T.ABC.pa \\
+\Iattr{triangle}{pb} &T.ABC.pb \\
+\Iattr{triangle}{pc} &T.ABC.pc \\
+\Iattr{triangle}{type} & 'triangle' \\
+\Iattr{triangle}{circumcenter} & T.ABC.circumcenter\\
+\Iattr{triangle}{centroid} &T.ABC.centroid\\
+\Iattr{triangle}{incenter} &T.ABC.incenter\\
+\Iattr{triangle}{orthocenter} &T.ABC.orthocenter\\
+\Iattr{triangle}{eulercenter} &T.ABC.eulercenter \\
+\Iattr{triangle}{spiekercenter} &T.ABC.spiekercenter \\
\Iattr{triangle}{a}& It's the length of the side opposite the first vertex \\
\Iattr{triangle}{b}& It's the length of the side opposite the second verte\\
\Iattr{triangle}{c}& It's the length of the side opposite the third vertex \\
\Iattr{triangle}{alpha}& Vertex angle of the first vertex\\
\Iattr{triangle}{beta}& Vertex angle of the second vertex\\
-\Iattr{triangle}{gamma}& Vertex angle of the third vertex\\
-\Iattr{triangle}{ab}& Line defined by the first two points of the triangle\\
+\Iattr{triangle}{gamma}& Vertex angle of the third vertex\\
+\Iattr{triangle}{ab}& Line defined by the first two points of the triangle\\
\Iattr{triangle}{ac}& Line defined by the first point and the last point\\
\Iattr{triangle}{bc}& Line defined by the last two points of the triangle\\
\bottomrule %
\end{tabular}
-\end{center}
\egroup
\subsubsection{Example: triangle attributes} % (fold)
\label{ssub:example_triangle_attributes}
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.a = point: new (0 , 0)
- z.b = point: new (4 , 0)
- z.c = point: new (0 , 3)
- T.abc = triangle : new (z.a,z.b,z.c)
- z.O = T.abc.circumcenter
- z.I = T.abc.incenter
- z.H = T.abc.orthocenter
- z.G = T.abc.centroid
- a = T.abc.a
- b = T.abc.b
- c = T.abc.c
- alpha = T.abc.alpha
- beta = T.abc.beta
- gamma = T.abc.gamma
-\end{tkzelements}
-
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawPolygon(a,b,c)
- \tkzDrawPoints(a,b,c,O,G,I,H)
- \tkzLabelPoints(a,b,c,O,G,I)
- \tkzLabelPoints[above right](H)
- \tkzDrawCircles(O,a)
- \tkzLabelSegment[sloped](a,b){\tkzUseLua{c}}
- \tkzLabelSegment[sloped,above](b,c){\tkzUseLua{a}}
-\end{tikzpicture}
-\end{tkzexample}
-
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.a = point: new (0 , 0)
+ z.b = point: new (4 , 0)
+ z.c = point: new (0 , 3)
+ T.abc = triangle : new (z.a,z.b,z.c)
+ z.O = T.abc.circumcenter
+ z.I = T.abc.incenter
+ z.H = T.abc.orthocenter
+ z.G = T.abc.centroid
+ a = T.abc.a
+ b = T.abc.b
+ c = T.abc.c
+ alpha = T.abc.alpha
+ beta = T.abc.beta
+ gamma = T.abc.gamma
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(a,b,c)
+ \tkzDrawPoints(a,b,c,O,G,I,H)
+ \tkzLabelPoints(a,b,c,O,G,I)
+ \tkzLabelPoints[above right](H)
+ \tkzDrawCircles(O,a)
+ \tkzLabelSegment[sloped](a,b){\tkzUseLua{c}}
+ \tkzLabelSegment[sloped,above](b,c){\tkzUseLua{a}}
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
scale = 1.2
z.a = point: new (0 , 0)
@@ -85,7 +90,6 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
beta = T.abc.beta
gamma = T.abc.gamma
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -97,11 +101,11 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
\tkzLabelSegment[sloped](a,b){\tkzUseLua{c}}
\tkzLabelSegment[sloped,above](b,c){\tkzUseLua{a}}
\end{tikzpicture}
-\hspace*{\fill}
-% \caption{Class Triangle}
+\end{minipage}
+
% subsubsection example_triangle_attributes (end)
-% subsection attributs_of_a_triangle (end)
+% subsection attributes_of_a_triangle (end)
\subsection{Methods of the class triangle} % (fold)
\label{sub:methods_of_the_class_triangle}
@@ -110,13 +114,11 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
\catcode`_=12
\small
\begin{minipage}{\textwidth}
-\begin{center}
-%\caption{Methods of the class triangle}
+\captionof{table}{triangle methods.}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Comments} \\
\midrule
-triangle = {} class triangle \\
\Imeth{triangle}{new} (a, b ,c) & |T.ABC = triangle : new (z.A,z.B,z.C)| \\
... & |T| or |T.name| with what you want for name, is possible.\\
\midrule
@@ -134,7 +136,7 @@ triangle = {} class triangle \\
\Imeth{triangle}{base (u,v) } & |z.D = T.ABC: base(1,1)| \tkzar ABDC is a parallelogram \\
\Imeth{triangle}{projection (p) } & Projection of a point on the sides \\
\Imeth{triangle}{euler\_points () } & Euler points of euler circle \\
-\Imeth{triangle}{nine\_points () } & Points of the euler circle \\
+\Imeth{triangle}{nine\_points () } & 9 Points of the euler circle \\
\Imeth{triangle}{parallelogram ()} & |z.D = T.ABC : parallelogram ()| \tkzar ABCD is a parallelogram\\
\midrule
\textbf{Lines} &\\
@@ -149,7 +151,6 @@ triangle = {} class triangle \\
\Imeth{triangle}{antiparallel(pt,n)} & n=0 antiparallel through pt to $(BC)$, n=1 to $(AC)$ etc.\\
\bottomrule
\end{tabular}
-\end{center}
\end{minipage}
\egroup
@@ -169,15 +170,13 @@ triangle = {} class triangle \\
\Imeth{triangle}{euler\_circle ()} & C.|NP = T.ABC : euler_circle ()| \tkzar $N$ euler point
\footnote{ The midpoint of each side of the triangle, the foot of each altitude, the midpoint of the line segment from each vertex of the triangle to the orthocenter.} \\
\Imeth{triangle}{circum\_circle ()} & |C.OA = T.ABC : circum ()| Triangle's circumscribed circle \\
-\Imeth{triangle}{in\_circle ()} & Inscribed circle of the triangle\\
-\Imeth{triangle}{ex\_circle (n)} & Circle tangent to three lines defined by the sides of the triangle \\
+\Imeth{triangle}{in\_circle ()} & Inscribed circle of the triangle\\
+\Imeth{triangle}{ex\_circle (n)} & Circle tangent to the three sides of the triangle ; n =1 swap ; n=2 2 swap \\
\Imeth{triangle}{first\_lemoine\_circle ()} & The center is the midpoint between Lemoine point and the circumcenter.\footnote{
Through the Lemoine point draw lines parallel to the triangle's sides. The points where the parallel lines intersect the sides of ABC
then lie on a circle known as the first Lemoine circle. } \\
\Imeth{triangle}{second\_lemoine\_circle ()} & see example \ref{sub:antiparallel_through_lemoine_point}\\
\Imeth{triangle}{spieker\_circle ()} & The incircle of the medial triangle\\
-\Imeth{triangle}{ex\_circle(n) } & |z.o,z.p,z.q,z.r = T.ABC: ex_circle ()|\\
-... & n=0 ex_circle opposed to $A$ p,q,r projections of o on the sides \\
\midrule
\textbf{Triangles} &\\
\midrule
@@ -208,11 +207,151 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
\egroup
% subsubsection methods_of_the_class_triangle (end)
+\subsubsection{Euler line} % (fold)
+\label{ssub:euler_line}
+
+\begin{tkzexample}[latex=0cm,small,code only]
+\begin{tkzelements}
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.C = point: new (1.5 , 3.5)
+ T.ABC = triangle: new (z.A,z.B,z.C)
+ z.O = T.ABC.circumcenter
+ z.G = T.ABC.centroid
+ z.N = T.ABC.eulercenter
+ z.H = T.ABC.orthocenter
+ z.P,z.Q,z.R = get_points (T.ABC: orthic())
+ z.K,z.I,z.J = get_points (T.ABC: medial ())
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines[blue](O,H)
+ \tkzDrawCircle[red](N,I)
+ \tkzDrawCircles[teal](O,A)
+ \tkzDrawSegments(A,P B,Q C,R)
+ \tkzDrawSegments[red](A,I B,J C,K)
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G)
+ \tkzLabelPoints(A,B,C,I,J,K,P,Q,R,H)
+ \tkzLabelPoints[below](N,O,G)
+\end{tikzpicture}
+\end{tkzexample}
+
+\begin{tkzelements}
+ scale =1
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.C = point: new (1.5 , 3.5)
+ T.ABC = triangle: new (z.A,z.B,z.C)
+ z.O = T.ABC.circumcenter
+ z.G = T.ABC.centroid
+ z.N = T.ABC. eulercenter
+ z.H = T.ABC. orthocenter
+ z.P,z.Q,z.R = get_points (T.ABC: orthic())
+ z.K,z.I,z.J = get_points (T.ABC: medial ())
+\end{tkzelements}
+\hspace*{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[blue](O,H)
+\tkzDrawCircle[red](N,I)
+\tkzDrawCircles[teal](O,A)
+\tkzDrawSegments(A,P B,Q C,R)
+\tkzDrawSegments[red](A,I B,J C,K)
+\tkzDrawPolygons(A,B,C)
+\tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G)
+\tkzLabelPoints(A,B,C,I,J,K,P,Q,R)
+\tkzLabelPoints[below](N,O,G,H)
+\end{tikzpicture}
+\hspace*{\fill}
+%\caption{Euler line}
+% subsubsection euler_line (end)
-% subsection methods_of_the_class_triangle (end)
+\subsection{Harmonic division and bisector} % (fold)
+\label{sub:harmonic_division_and_bisector}
+
+\begin{tkzexample}[small,code only]
+\begin{tkzelements}
+ scale = .75
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.M = point: new (5 , 4)
+ T.AMB = triangle : new (z.A,z.M,z.B)
+ L.AB = T.AMB.ca
+ L.bis = T.AMB : bisector (1)
+ z.C = L.bis.pb
+ L.bisext = T.AMB : bisector_ext (1)
+ z.D = intersection (L.bisext,L.AB)
+ L.CD = line: new (z.C,z.D)
+ z.O = L.CD.mid
+ L.AM = line: new (z.A,z.M)
+ L.LL = L.AM : ll_from (z.B)
+ L.MC = line: new (z.M,z.C)
+ L.MD = line: new (z.M,z.D)
+ z.E = intersection (L.LL,L.MC)
+ z.F = intersection (L.LL,L.MD)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,M)
+ \tkzDrawCircle[purple](O,C)
+ \tkzDrawSegments[purple](M,E M,D E,F)
+ \tkzDrawSegments(D,B)
+ \tkzDrawPoints(A,B,M,C,D,E,F)
+ \tkzLabelPoints[below right](A,B,C,D,E)
+ \tkzLabelPoints[above](M,F)
+ \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M)
+ \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B)
+ \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
+ \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M)
+ \tkzMarkAngles[mark=|](B,M,F M,F,B)
+ \tkzMarkSegments(B,E B,M B,F)
+\end{tikzpicture}
+\end{tkzexample}
+
+\begin{tkzelements}
+ scale =.75
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.M = point: new (5 , 4)
+ T.AMB = triangle : new (z.A,z.M,z.B)
+ L.AB = T.AMB.ca
+ L.bis = T.AMB : bisector (1)
+ z.C = L.bis.pb
+ L.bisext = T.AMB : bisector_ext (1)
+ z.D = intersection (L.bisext,L.AB)
+ L.CD = line: new (z.C,z.D)
+ z.O = L.CD.mid
+ L.AM = line: new (z.A,z.M)
+ L.LL = L.AM : ll_from (z.B)
+ L.MC = line: new (z.M,z.C)
+ L.MD = line: new (z.M,z.D)
+ z.E = intersection (L.LL,L.MC)
+ z.F = intersection (L.LL,L.MD)
+\end{tkzelements}
+\hspace*{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,M)
+ \tkzDrawCircle[purple](O,C)
+ \tkzDrawSegments[purple](M,E M,D E,F)
+ \tkzDrawSegments(D,B)
+ \tkzDrawPoints(A,B,M,C,D,E,F)
+ \tkzLabelPoints[below right](A,B,C,D,E)
+ \tkzLabelPoints[above](M,F)
+ \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M)
+ \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B)
+ \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
+ \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M)
+ \tkzMarkAngles[mark=|](B,M,F M,F,B)
+ \tkzMarkSegments(B,E B,M B,F)
+\end{tikzpicture}
+\hspace*{\fill}
+% subsection harmonic_division_and_bisector (end)
+% subsection methods_of_the_class_triangle (end)
% section classe_triangle (end)
\endinput
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
index 53bdb06558..e993ce9abe 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
@@ -1,98 +1,64 @@
\newpage
-\section{Classes and objects} % (fold)
-\label{sec:classes_and_objects}
-
-\subsection{Objects} % (fold)
-\label{sub:objects}
-The object types currently defined and used are \tkzNameObj{point}, \tkzNameObj{line}, \tkzNameObj{circle}, \tkzNameObj{triangle} and \tkzNameObj{ellipse}.
-
-They can be created directly using the method \Imeth{obj}{new} and, with the exception of the \Iclass{class}{point} class, by giving points. Objects can also be obtained by applying methods to other objects. For example, |T.ABC : circum_circle ()| creates an object \tkzNameObj{circle}. Some object attributes are also objects, such as |T.ABC.bc| which creates the object \tkzNameObj{line}, a straight line passing through the last two points defining the triangle.
-
-Attributes are accessed using the classic method, so |T.pc| gives the third of the triangle and |C.center| gives the center of the circle, but I've added a |get_points| function that returns the points of an object. This applies to straight lines (pa and pc), triangles (pa, pb and pc) and circles (center and through).
-
-Example: |z.O,z.T = get_points (C)| recovers the center and a point of the circle.
-% subsection objects (end)
-
-\subsection{tkz\_elements\_point.lua: complex numbers library} % (fold)
-\label{sub:complex_numbers}
-
-Unless you want to create your own functions, you won't need to know and use complex numbers. However, in some cases it may be useful to implement some of their properties.
-
-|za = point (1,2 )| and \ |zb = point (1,-1)| define two affixes which are |za = 1+2i| and
-
- |zb = 1-i|. The notation may come as a surprise, as I used the term "point". The aim here was not to create a complete library on complex numbers, but to be able to use their main properties in relation to points. I didn't want to have two different levels, and since a unique connection can be established between the points of the plane and the complexes, I decided not to mention the complex numbers! But they are there.
-
-The above entries must not be confused with the following ones :
-
-|z.a = point : new (1,2) | and |z.b = point : new (1,-1) |.
-
-Here we define two "point" objects that are in the form of an affix in the |z| table.
-|z.a = za| only if |scale = 1| and |z.a| creates a point named |a|. This point is an object and you can use its attributes, as well as methods referring to points.
-
-That said, |z.a| is indeed an affix, and it's possible to use the methods and metamethods associated with complex numbers.
-
-\bgroup
-\catcode`_=12
-\small
-\begin{minipage}{\textwidth}
-\begin{center}
-%\caption{Metamethods and methods about point class.}
-\begin{tabular}{ll}
- \toprule
- \textbf{Metamethods} & \textbf{Application} \\
- \midrule
-__add(z1,z2) & |z.a + z.b| \tkzar affix \\
-__sub(z1,z2) & |z.a - z.b| \tkzar affix\\
-__unm(z) & |- z.a| \tkzar affix\\
-__mul(z1,z2) & |z.a * z.b| \tkzar affix\\
-__concat(z1,z2)& |z.a .. z.b| \tkzar dot product = real number \footnote{If $O$ is the origin of the complex plan, then we get the dot product of the vectors $\overrightarrow{Oa}$ and $\overrightarrow{Ob}$} \\
-__pow(z1,z2) & |z.a ^ z.b| \tkzar determinant = real number\\
-__div(z1,z2) & |z.a / z.b| \tkzar affix \\
-__tostring(z) & tex.print(tostring(z)) \tkzar displays the affix \\
-__tonumber(z) & tonumber(z) \tkzar affix or nil\\
-__eq(z1,z2) & eq (z.a,z.b) \tkzar boolean\\
-\bottomrule
-\end{tabular}
-\end{center}
-\end{minipage}
-\egroup
-
-\bgroup
-\catcode`_=12
-\small
-\begin{center}
-%\caption{Metamethods and methods about point class.}
-\begin{tabular}{ll}
- \toprule
-\textbf{Methods} & \textbf{Application}\\
-\midrule
-\Imeth{point}{conj(z)}& |z.a : conj()| \tkzar affix (conjugate) \\
-\Imeth{point}{mod(z)}& |z.a : mod()| \tkzar real number = modulus |z.a|\\
-\Imeth{point}{abs (z)}& |z.a : abs()| \tkzar real number = modulus \\
-\Imeth{point}{norm (z)} & |z.a : norm()| \tkzar norm (real number ) \\
-\Imeth{point}{arg (z)}& |z.a : arg()| \tkzar real number = argument of z.a (in rad)\\
-\Imeth{point}{get(z)}& |z.a : get()| \tkzar re and im (two real numbers ) \\
-\Imeth{point}{sqrt(z)}& |z.a : sqrt()| \tkzar affix \\
-\bottomrule
-\end{tabular}
-\end{center}
-\egroup
-
-The class is provided with two specific metamethods.
-
-\begin{itemize}
- \item Since concatenation makes little sense here, the operation associated with |..| is the scalar or dot product. If |z1 = a+ib| and |z2 = c+id| then
-
- |z1..z2 = (a+ib) .. (c+id) = (a+ib) (c-id) = ac+bd + i(bc-ad) |
-
- There's also a mathematical function, |dot_product|, which takes three arguments. See example \ref{ssub:dot_or_scalar_product}
-
-
- \item With the same idea, the operation associated with |^| is the determinant i.e.
-
- |z1 ^ z2 = (a+ib) ^ (c+id) = ad - bc From (a-ib) (c+id) = ac+bd + i(ad - bc)| we take the imaginary part.
-
-\end{itemize}
-% subsection complex_numbers (end)
-% section classes_and_objects (end)
+
+\section{Class and object} % (fold)
+\label{sec:class_and_object}
+
+\subsection{Class} % (fold)
+\label{sub:class}
+
+ Object-oriented programming (OOP) is defined as a programming model built on the concept of objects. An object can be defined as a data table that has unique attributes and methods (operations) that define its behavior.
+
+ \vspace{1em}
+A class is essentially a user-defined data type. It describes the contents of the objects that belong to it. A class is a blueprint of an object, providing initial values for attributes and implementations of methods\footnote{action which an object is able to perform.} common to all objects of a certain kind.
+% subsection class (end)
+
+\subsection{Object} % (fold)
+\label{sub:object}
+ An Object is an instance of a class. Each object contains attributes and methods. Attributes are information or object characteristics stored in the date table (called field). The methods define behavior.
+
+ \vspace{1em}
+ All objects in the package are typed. The object types currently defined and used are: \tkzNameObj{point}, \tkzNameObj{line}, \tkzNameObj{circle}, \tkzNameObj{triangle}, \tkzNameObj{ellipse}, \tkzNameObj{quadrilateral}, \tkzNameObj{square}, \tkzNameObj{rectangle}, \tkzNameObj{parallelogram} and \tkzNameObj{regular\_polygon}.
+
+They can be created directly using the method \Imeth{obj}{new} by giving points, with the exception of the \Iclass{class}{point} class which requires a pair of reals, and \Iclass{class}{regular\_polygon} which needs two points and an integer.
+
+ Objects can also be obtained by applying methods to other objects. For example, |T.ABC : circum_circle ()| creates an object \tkzNameObj{circle}. Some object attributes are also objects, such as |T.ABC.bc| which creates the object \tkzNameObj{line}, a straight line passing through the last two points defining the triangle.
+
+ \vspace{1em}
+
+ \subsubsection{Attributes} % (fold)
+ \label{ssub:attributes}
+ Attributes are accessed using the classic method, so |T.pc| gives the third point of the triangle and |C.OH.center| gives the center of the circle, but I've added a |get_points| function that returns the points of an object. This applies to straight lines (pa and pc), triangles (pa, pb and pc) and circles (center and through).
+
+ \vspace{1em}
+ Example: |z.O,z.T = get_points (C)| recovers the center and a point of the circle.
+ % subsubsection attributes (end)
+
+\subsubsection{Methods} % (fold)
+\label{ssub:methods}
+
+A method is an operation (function or procedure) associated (linked) with an object.
+
+Example: The point object is used to vertically determine a new point object located at a certain distance from it (here 2). Then it is possible to rotate objects around it.
+
+\begin{verbatim}
+ \begin{tkzelements}
+ z.A = point (1,0)
+ z.B = z.A : north (2)
+ z.C = z.A : rotation (math.pi/3,z.B)
+ tex.print(tostring(z.C))
+ \end{tkzelements}
+\end{verbatim}
+
+
+\begin{tkzelements}
+ z.A = point (1,0)
+ z.B = z.A : north (2)
+ z.C = z.A : rotation (math.pi/3,z.B)
+ tex.print(tostring("The coordinates of $C$ are: " .. z.C.re .." and "..z.C.im))
+\end{tkzelements}
+
+
+% subsubsection methods (end)
+% subsection object (end)
+% section class_and_object (end)
\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
index 444033e75b..f25d02d569 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
@@ -3,49 +3,56 @@
\section{Writing Convention} % (fold)
\label{sec:writing_convention}
-Writing conventions for real numbers are the same as for \pkg{Lua}.
-The package introduces complex numbers (see \ref{sub:complex_numbers}) in order to associate them with points. |z1 = point (1,2)| designates the affix |z1=1+2i|, |z1| is a complex number, but here it's not a object point (related to objects in object-oriented programming).
+\subsection{Miscellaneous} % (fold)
+\label{sub:miscellanous}
-|z.A = point : new (1,2)| creates an object point $A$ with coordinates 1 and 2, which are stored as an affix in the table |z|. The key is $A$ and the value |1+2i| (or (1,2) if you prefer.)
+\begin{itemize}
+ \item Numerical variable: the writing conventions for real numbers are the same as for \pkg{Lua}.
+ \item Complex numbers: as for real numbers but to define them you must write |za = point (1,2)|. Mathematically, this corresponds to 1+2i, which you can find with |tex.print(tostring(za))|.(see \ref{sub:complex_numbers})
+ \item Boolean: you can write |bool = true| or |bool = false| then with Lua you can use the code :\\
+ \begin{mybox}
+|if bool == ... then ... else ... end|
+\end{mybox}
+
+ and outside the environment \tkzNameEnv{tkzelements} you can use the macro
+\begin{mybox}
+ |\fthenelse{\equal{\tkzUseLua{bool}}{true}}{ ... }{ ... }|
+\end{mybox}
+
+ after loading the \tkzNamePack{ifthen} package.
+
+ \item String: if st = "Euler's formula" then \begin{mybox}
+ |\tkzUseLua{st}| gives |Euler's formula|
+ \end{mybox}
+
+
+\end{itemize}
+% subsection miscellanous (end)
\subsection{Assigning a Name to a Point} % (fold)
\label{sub:assigning_a_name_to_a_point}
-The basic object is the point which belongs to the class point. A point can be created in two ways: either directly |z.A = point : new (1,2)|, or as the result of a function or a method.
Currently the only obligation is to store the points in the table |z| \footnote{To place the point M in the table, simply write |z.M| = \ldots or |z["M"]|= \ldots} if you want to use them in \TIKZ\ or \pkg{tkz-euclide}. If it is a point which will not be used, then you can designate it as you wish by respecting the conventions of Lua.
-More generally, with |z.A = point: new (a,b)|, we define a complex number |z.A = a+bi|, where $a$ and $b$ are the coordinates of point $A$. The name $A$ of a point is the key associated with a complex number noted |z.A| whose affix is |a+ib|, with $a$ and $b$ unique coordinates of $A$.
-
-
-There are two cases. Either you want to keep the point to use it with the package that will allow you to draw, or the point is intermediate and you can abandon it.
-
-\vspace{12pt}
-In the second case, simply don't store the point in the |z| table. For example, |A = point : new (1,2)| defines a point $A$ that will not be transferred. Another way of avoiding a transfer is to assign |nil| to the point: |z.A = nil| before exiting the environment \tkzNameEnv{tkzelements}.
-
- In the first case, you must store the point in the table |z|. The points which occur in the environment \tkzNameEnv{tkzelements} must respect a convention which is |z.name| such that |name| will be the name of the corresponding \tkzname{node}. \footnote{ However, that a point can be deleted with |z.name = nil|.}
+ The points which occur in the environment \tkzNameEnv{tkzelements} must respect a convention which is |z.name| such that |name| will be the name of the corresponding \tkzname{node}.
What are the conventions for designating |name|? You have to respect the Lua conventions in particular cases.
\begin{enumerate}
\item The use of prime is 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 One possibility, however, in order to have a more explicit code is to suppose that you want to designate a point by "euler". It would be possible for example to 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}
-\lefthand\ The syntax |z.name| is important, it allows to store the data of the point in a table named |z|, which will be used for the transition to the program that will perform the plots and place the labels.
-
-Point names: You can use the lower case and unaccented upper case.
-The names of the points follow the rules of convention for writing identifiers in lua.
-The name starts with a letter "A to Z" or "a to z" or an underscore "|_|" followed by zero or more letters, underscores, and digits (0 to 9).
-
-You should avoid identifiers starting with an underscore followed by one or more uppercase letters.
-
-In general, the points used in geometry are lower or upper case letters. The use of underscore is also frequent. So it is possible to write |z.T_a|.
-
-\lefthand\ Another use in geometry that can be used with \TIKZ{} is the apostrophe. Unfortunately, the apostrophe is necessary to use strings. There are several ways to get around this difficulty.
-The simplest one, which keeps the syntax consistent, is that if you want to use |A'| as a point name, you can use |Ap|. When switching to \TIKZ{} |Ap| will be replaced by |A'|. All names of more than one character ending in |p| will have the letter |p| replaced by an apostrophe |'|.
+Here are some different ways of naming a point:
+\begin{mybox}
+\begin{itemize}
+ \item |z.A = point : new (1,2)|
+ \item |z.Bp = point : new (3,4)| --> this gives |B'| in the \tkzNameEnv{tikzpicture}
+ \item |z.H_a = T.ABC : altitude ()| --> this gives |H_a| in the \tkzNameEnv{tikzpicture} code and $H_a$ in the display.
+\end{itemize}
+\end{mybox}
% subsection assigning_a_name_to_a_point (end)
\subsection{Assigning a Name to Other Objects} % (fold)
@@ -54,32 +61,32 @@ The simplest one, which keeps the syntax consistent, is that if you want to use
You have the choice to give a name to objects other than points. That said, it is preferable to respect certain rules in order to make the code easier to read.
I have chosen for my examples the following conventions: first of all I store the objects in tables: |L.name| for lines and segments, |C.name| for circles, |T.name| for triangles, |E.name| for ellipses.
-For lines, I use the names of the two points. So if a line passes through points $A$ and $B$, I name the line |L.AB|. It is possible if only one line is named to simply name it |L| but this should be avoided so as not to create bad practices.
+For lines, I use the names of the two points. So if a line passes through points $A$ and $B$, I name the line |L.AB|.
-For circles, I name |C.AB| the circle of center $A$ passing through $B$, but siomething like |C.euler| or |C.external| is fine.
+For circles, I name |C.AB| the circle of center $A$ passing through $B$, but something like |C.euler| or |C.external| is fine.
-For triangles, I name |T.ABC| the triangle whose vertices are $A$, $B$ and $C$.
+For triangles, I name |T.ABC| the triangle whose vertices are $A$, $B$ and $C$ but |T.feuerbach|.
For ellipses, I name |E.ABC| the ellipse with center $A$ through vertex $B$ and covertex $C$.
% subsection assigning_a_name_to_other_objects(end)
\subsection{Writing conventions for attributes, methods.} % (fold)
-\label{sub:writing_conventions_for_attributs_methods_and_functions}
+\label{sub:writing_conventions_for_attributes_methods_and_functions}
You must use the conventions of Lua, so
\begin{itemize}
- \item To obtain an attribute, for all objects, the convention is identical: |object.attribute|. For example, for the point $A$ we access its abscissa with |z.A.re| and its ordinate with |z.A.im|; as for its type we obtain it with |z.A.type|. To get the south pole of the circle |C.OA| you need to write: |C.OA.south|.
+ \item To obtain an \Amacro{attribute}, for all objects, the convention is identical: |object.attribute|. For example, for the point $A$ we access its abscissa with |z.A.re| and its ordinate with |z.A.im|; as for its type we obtain it with |z.A.type|. To get the south pole of the circle |C.OA| you need to write: |C.OA.south|.
- \item To use a method such as obtaining the incircle of a triangle ABC, just write
+ \item To use a method such as obtaining the incircle of a triangle ABC, just write
- |z.i,z.i_a,z.i_b,z.i_c = T.ABC : in_circle ()| (you get the center and its projections on the sides), but to get only the incenter you write |T.ABC.incenter|.
+ |C.incircle = T.ABC : in_circle ()|.
\item Some methods need a parameter. For example, to know the distance between a point $C$ to the line $(A,B)$ we will write
|d = L.AB : distance (z.C)|.
- \item Use the underscore to store a result you don't want to use. If you only need the second point of an intersection between a line and a circle, you would write
+ \item Use the \Amacro{underscore} to store a result you don't want to use. If you only need the second point of an intersection between a line and a circle, you would write
|_,z.J = intersection (L.AB , C.OC)|.
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
index 68c894037c..f9658252c2 100755..100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
@@ -6,34 +6,36 @@
\subsection{D'Alembert 1} % (fold)
\label{sub:d_alembert_1}
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.A = point : new (0,0)
- z.a = point : new (4,0)
- z.B = point : new (7,-1)
- z.b = point : new (5.5,-1)
- z.C = point : new (5,-4)
- z.c = point : new (4.25,-4)
- C.Aa = circle : new (z.A,z.a)
- C.Bb = circle : new (z.B,z.b)
- C.Cc = circle : new (z.C,z.c)
- z.I = C.Aa : external_similitude (C.Bb)
- z.J = C.Aa : external_similitude (C.Cc)
- z.K = C.Cc : external_similitude (C.Bb)
- z.Ip = C.Aa : internal_similitude (C.Bb)
- z.Jp = C.Aa : internal_similitude (C.Cc)
- z.Kp = C.Cc : internal_similitude (C.Bb)
-\end{tkzelements}
-\begin{tikzpicture}[rotate=-60]
- \tkzGetNodes
- \tkzDrawCircles(A,a B,b C,c)
- \tkzDrawPoints(A,B,C,I,J,K,I',J',K')
- \tkzDrawSegments[new](I,K A,I A,J B,I B,K C,J C,K)
- \tkzDrawSegments[purple](I,J' I',J I',K)
- \tkzLabelPoints(I,J,K,I',J',K')
-\end{tikzpicture}
-\end{tkzexample}
-
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.A = point : new (0,0)
+ z.a = point : new (4,0)
+ z.B = point : new (7,-1)
+ z.b = point : new (5.5,-1)
+ z.C = point : new (5,-4)
+ z.c = point : new (4.25,-4)
+ C.Aa = circle : new (z.A,z.a)
+ C.Bb = circle : new (z.B,z.b)
+ C.Cc = circle : new (z.C,z.c)
+ z.I = C.Aa : external_similitude (C.Bb)
+ z.J = C.Aa : external_similitude (C.Cc)
+ z.K = C.Cc : external_similitude (C.Bb)
+ z.Ip = C.Aa : internal_similitude (C.Bb)
+ z.Jp = C.Aa : internal_similitude (C.Cc)
+ z.Kp = C.Cc : internal_similitude (C.Bb)
+ \end{tkzelements}
+ \begin{tikzpicture}[rotate=-60]
+ \tkzGetNodes
+ \tkzDrawCircles(A,a B,b C,c)
+ \tkzDrawPoints(A,B,C,I,J,K,I',J',K')
+ \tkzDrawSegments[new](I,K A,I A,J B,I B,K C,J C,K)
+ \tkzDrawSegments[purple](I,J' I',J I',K)
+ \tkzLabelPoints(I,J,K,I',J',K')
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .5
z.A = point : new (0,0)
@@ -52,7 +54,6 @@ z.Ip = C.Aa : internal_similitude (C.Bb)
z.Jp = C.Aa : internal_similitude (C.Cc)
z.Kp = C.Cc : internal_similitude (C.Bb)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}[rotate=30]
\tkzGetNodes
@@ -62,40 +63,39 @@ z.Kp = C.Cc : internal_similitude (C.Bb)
\tkzDrawSegments[purple](I,J' I',J I',K)
\tkzLabelPoints(I,J,K,I',J',K')
\end{tikzpicture}
-\hspace*{\fill}
-\vspace*{\fill}
-%\caption{D'Alembert I}
-
+\end{minipage}
% subsection d_alembert_1 (end)
\subsection{D'Alembert 2} % (fold)
\label{sub:d_alembert_2}
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- scale = .75
- z.A = point : new (0,0)
- z.a = point : new (5,0)
- z.B = point : new (7,-1)
- z.b = point : new (3,-1)
- z.C = point : new (5,-4)
- z.c = point : new (2,-4)
- C.Aa = circle : new (z.A,z.a)
- C.Bb = circle : new (z.B,z.b)
- C.Cc = circle : new (z.C,z.c)
- z.i,z.j = get_points (C.Aa : radical_axis (C.Bb))
- z.k,z.l = get_points (C.Aa : radical_axis (C.Cc))
- z.m,z.n = get_points (C.Bb : radical_axis (C.Cc))
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(A,a B,b C,c)
- \tkzDrawLines[new](i,j k,l m,n)
-\end{tikzpicture}
-\end{tkzexample}
-
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+ \begin{verbatim}
+ \begin{tkzelements}
+ scale = .75
+ z.A = point : new (0,0)
+ z.a = point : new (5,0)
+ z.B = point : new (7,-1)
+ z.b = point : new (3,-1)
+ z.C = point : new (5,-4)
+ z.c = point : new (2,-4)
+ C.Aa = circle : new (z.A,z.a)
+ C.Bb = circle : new (z.B,z.b)
+ C.Cc = circle : new (z.C,z.c)
+ z.i,z.j = get_points (C.Aa : radical_axis (C.Bb))
+ z.k,z.l = get_points (C.Aa : radical_axis (C.Cc))
+ z.m,z.n = get_points (C.Bb : radical_axis (C.Cc))
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(A,a B,b C,c)
+ \tkzDrawLines[new](i,j k,l m,n)
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
- scale = .75
+ scale = .5
z.A = point : new (0,0)
z.a = point : new (5,0)
z.B = point : new (7,-1)
@@ -116,15 +116,13 @@ z.Kp = C.Cc : internal_similitude (C.Bb)
\tkzDrawCircles(A,a B,b C,c)
\tkzDrawLines[new](i,j k,l m,n)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{D'alembert II}
-
+\end{minipage}
% subsection d_alembert_2 (end)
\subsection{Alternate} % (fold)
\label{sub:alternate}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
@@ -148,9 +146,10 @@ z.Kp = C.Cc : internal_similitude (C.Bb)
\tkzLabelPoints[above](C,D,E)
\tkzMarkSegments(A,C C,E)
\end{tikzpicture}
-\end{tkzexample}
-
-
+\end{verbatim}
+\end{minipage}
+\hspace*{\fill}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
@@ -162,8 +161,6 @@ z.D = intersection (L.AI,T.bc)
L.LLC = T.ab: ll_from (z.C)
z.E = intersection (L.AI,L.LLC)
\end{tkzelements}
-
-\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygon(A,B,C)
@@ -176,8 +173,7 @@ z.E = intersection (L.AI,L.LLC)
\tkzLabelPoints[above](C,D,E)
\tkzMarkSegments(A,C C,E)
\end{tikzpicture}
-\hspace*{\fill}
-
+\end{minipage}
% subsection alternate (end)
\subsection{Apollonius circle} % (fold)
@@ -261,14 +257,13 @@ scale=.75
scale =.75
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
- L.AB = line: new (z.A,z.B)
z.M = point: new (5 , 4)
T.AMB = triangle: new (z.A,z.M,z.B)
+ L.AB = T.AMB.ca
z.I = T.AMB.incenter
L.MI = line: new (z.M,z.I)
z.C = intersection (L.AB , L.MI)
- z.J = L.MI: ortho_from (z.M)
- L.MJ = line: new (z.M,z.J)
+ L.MJ = L.MI: ortho_from (z.M)
z.D = intersection (L.AB , L.MJ)
L.CD = line: new (z.C,z.D)
z.O = L.CD.mid
@@ -298,7 +293,7 @@ scale=.75
z.B = point: new (6 , 0)
z.M = point: new (5 , 4)
T.AMB = triangle: new (z.A,z.M,z.B)
- L.AB = T.AMB.ac
+ L.AB = T.AMB.ca
z.I = T.AMB.incenter
L.MI = line: new (z.M,z.I)
z.C = intersection (L.AB , L.MI)
@@ -357,10 +352,10 @@ scale=.75
L.ApS = line: new (z.Ap,z.S)
z.O2 = L.ApS.mid
L.BI = line: new (z.B,z.I)
- z.Bp = intersection (T.ABC.ac , L.BI)
+ z.Bp = intersection (T.ABC.ca , L.BI)
z.z = L.BI.north_pa
L.Bz = line: new (z.B,z.z)
- z.T = intersection (L.Bz,T.ABC.ac)
+ z.T = intersection (L.Bz,T.ABC.ca)
L.Bpt = line: new (z.Bp,z.T)
z.O3 = L.Bpt.mid
\end{tkzelements}
@@ -399,10 +394,10 @@ z.S = intersection (L.Ay,T.ABC.bc)
L.ApS = line: new (z.Ap,z.S)
z.O2 = L.ApS.mid
L.BI = line: new (z.B,z.I)
-z.Bp = intersection (T.ABC.ac , L.BI)
+z.Bp = intersection (T.ABC.ca , L.BI)
z.z = L.BI.north_pa
L.Bz = line: new (z.B,z.z)
-z.T = intersection (L.Bz,T.ABC.ac)
+z.T = intersection (L.Bz,T.ABC.ca)
L.Bpt = line: new (z.Bp,z.T)
z.O3 = L.Bpt.mid
\end{tkzelements}
@@ -420,39 +415,38 @@ z.O3 = L.Bpt.mid
\tkzDrawLine(O1,O2)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Apollonius circles in a triangle}
-
-
% subsection apollonius_circles (end)
\subsection{Archimedes} % (fold)
\label{sub:archimedes}
-\begin{tkzexample}[small,code only]
-\begin{tkzelements}
- z.O_1 = point: new (0, 0)
- z.O_2 = point: new (0, 1)
- z.A = point: new (0, 3)
- z.F = point: polar (3, math.pi/6)
- L = line: new (z.F,z.O_1)
- C = circle: new (z.O_1,z.A)
- z.E = intersection (L,C)
- T = triangle: new (z.F,z.E,z.O_2)
- z.x = T: parallelogram ()
- L = line: new (z.x,z.O_2)
- C = circle: new (z.O_2,z.A)
- z.C,z.D = intersection (L ,C)
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(O_1,A O_2,A)
- \tkzDrawSegments[new](O_1,A E,F C,D)
- \tkzDrawSegments[purple](A,E A,F)
- \tkzDrawPoints(A,O_1,O_2,E,F,C,D)
- \tkzLabelPoints(A,O_1,O_2,E,F,C,D)
-\end{tikzpicture}
-\end{tkzexample}
-
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.O_1 = point: new (0, 0)
+ z.O_2 = point: new (0, 1)
+ z.A = point: new (0, 3)
+ z.F = point: polar (3, math.pi/6)
+ L = line: new (z.F,z.O_1)
+ C = circle: new (z.O_1,z.A)
+ z.E = intersection (L,C)
+ T = triangle: new (z.F,z.E,z.O_2)
+ z.x = T: parallelogram ()
+ L = line: new (z.x,z.O_2)
+ C = circle: new (z.O_2,z.A)
+ z.C,z.D = intersection (L ,C)
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(O_1,A O_2,A)
+ \tkzDrawSegments[new](O_1,A E,F C,D)
+ \tkzDrawSegments[purple](A,E A,F)
+ \tkzDrawPoints(A,O_1,O_2,E,F,C,D)
+ \tkzLabelPoints(A,O_1,O_2,E,F,C,D)
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
z.O_1 = point: new (0, 0)
z.O_2 = point: new (0, 1)
@@ -467,7 +461,6 @@ z.O3 = L.Bpt.mid
C = circle: new (z.O_2,z.A)
z.C,z.D = intersection (L ,C)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -477,11 +470,9 @@ z.O3 = L.Bpt.mid
\tkzDrawPoints(A,O_1,O_2,E,F,C,D)
\tkzLabelPoints(A,O_1,O_2,E,F,C,D)
\end{tikzpicture}
-\hspace*{\fill}
- %\caption{Archimedes}
-
+\end{minipage}
+%\subsection{Bankoff circle} % (fold)
-\subsection{Bankoff circle} % (fold)
\label{sub:bankoff_circle}
\begin{tkzexample}[small,code only]
\begin{tkzelements}
@@ -548,6 +539,7 @@ z.O3 = L.Bpt.mid
\begin{tkzelements}
+ scale = 1.25
z.A = point: new (0 , 0)
z.B = point: new (10 , 0)
L.AB = line : new (z.A,z.B)
@@ -610,9 +602,6 @@ z.O3 = L.Bpt.mid
\end{scope}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Bankoff circle}
-
-
% subsection bankoff_circle (end)
\subsection{Excircles} % (fold)
@@ -691,192 +680,8 @@ z.O3 = L.Bpt.mid
\tkzMarkRightAngles[fill=gray!15](J_a,T_a,B J_b,T_b,C J_c,T_c,A)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Ex-circles}
-
-
-
% subsection excircles (end)
-\subsection{Harmonic division and bisector} % (fold)
-\label{sub:harmonic_division_and_bisector}
-
-\begin{tkzexample}[small,code only]
-\begin{tkzelements}
- scale = .75
- z.A = point: new (0 , 0)
- z.B = point: new (6 , 0)
- z.M = point: new (5 , 4)
- T.AMB = triangle : new (z.A,z.M,z.B)
- L.AB = T.AMB.ac
- L.bis = T.AMB : bisector (1)
- z.C = L.bis.pb
- L.bisext = T.AMB : bisector_ext (1)
- z.D = intersection (L.bisext,L.AB)
- L.CD = line: new (z.C,z.D)
- z.O = L.CD.mid
- L.AM = line: new (z.A,z.M)
- L.LL = L.AM : ll_from (z.B)
- L.MC = line: new (z.M,z.C)
- L.MD = line: new (z.M,z.D)
- z.E = intersection (L.LL,L.MC)
- z.F = intersection (L.LL,L.MD)
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawPolygon(A,B,M)
- \tkzDrawCircle[purple](O,C)
- \tkzDrawSegments[purple](M,E M,D E,F)
- \tkzDrawSegments(D,B)
- \tkzDrawPoints(A,B,M,C,D,E,F)
- \tkzLabelPoints[below right](A,B,C,D,E)
- \tkzLabelPoints[above](M,F)
- \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M)
- \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B)
- \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
- \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M)
- \tkzMarkAngles[mark=|](B,M,F M,F,B)
- \tkzMarkSegments(B,E B,M B,F)
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
- scale =.75
- z.A = point: new (0 , 0)
- z.B = point: new (6 , 0)
- z.M = point: new (5 , 4)
- T.AMB = triangle : new (z.A,z.M,z.B)
- L.AB = T.AMB.ac
- L.bis = T.AMB : bisector (1)
- z.C = L.bis.pb
- L.bisext = T.AMB : bisector_ext (1)
- z.D = intersection (L.bisext,L.AB)
- L.CD = line: new (z.C,z.D)
- z.O = L.CD.mid
- L.AM = line: new (z.A,z.M)
- L.LL = L.AM : ll_from (z.B)
- L.MC = line: new (z.M,z.C)
- L.MD = line: new (z.M,z.D)
- z.E = intersection (L.LL,L.MC)
- z.F = intersection (L.LL,L.MD)
-\end{tkzelements}
-
-
- \hspace*{\fill}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawPolygon(A,B,M)
- \tkzDrawCircle[purple](O,C)
- \tkzDrawSegments[purple](M,E M,D E,F)
- \tkzDrawSegments(D,B)
- \tkzDrawPoints(A,B,M,C,D,E,F)
- \tkzLabelPoints[below right](A,B,C,D,E)
- \tkzLabelPoints[above](M,F)
- \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M)
- \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B)
- \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
- \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M)
- \tkzMarkAngles[mark=|](B,M,F M,F,B)
- \tkzMarkSegments(B,E B,M B,F)
- \end{tikzpicture}
- \hspace*{\fill}
- %\caption{Harmonic division and bisector}
-
-
-
-
-% subsection harmonic_division_and_bisector (end)
-
-\subsection{Excircle} % (fold)
-\label{sub:excircle}
-
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.a = point: new (1,2)
- z.b = point: new (5,1)
- z.c = point: new (2,4)
- T.abc = triangle: new (z.a,z.b,z.c)
- z.o,z.p = get_points (T.abc: ex_circle ())
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines[add=1 and 1](a,b b,c a,c)
- \tkzDrawPoints(a,b,c,o,p)
- \tkzDrawCircles(o,p)
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
- z.a = point: new (1,2)
- z.b = point: new (5,1)
- z.c = point: new (2,4)
- T.abc = triangle: new (z.a,z.b,z.c)
- z.o,z.p = get_points (T.abc: ex_circle ())
-\end{tkzelements}
-
- \hspace*{\fill}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines[add=1 and 1](a,b b,c a,c)
- \tkzDrawPoints(a,b,c,o,p)
- \tkzDrawCircles(o,p)
- \end{tikzpicture}
- \hspace*{\fill}
- %\caption{Ex-circles}
-
-
-%
-% subsection excircle (end)
-
-\subsection{In/Out of a circle or a disk} % (fold)
-\label{sub:in_out_of_a_circle}
-
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- scale = 1.25
- z.A = point: new (0,0)
- z.B = point: new (1,2)
- z.X = point: new (-2,2)
- C = circle : new (z.A,z.B)
- if C:in_out(z.X) -- in_out_disk
- then
- tex.print("In")
- else
- tex.print("Out")
- end
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle(A,B)
- \tkzDrawPoints(A,B,X)
- \tkzLabelPoints(A,B,X)
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
-scale = 2
-z.A = point: new (0,0)
-z.B = point: new (1,2)
-z.X = point: new (-2,2)
-C = circle : new (z.A,z.B)
-if C:in_out(z.X)
-then
- tex.print("In")
-else
- tex.print("Out")
-end
- z.M = C: point (math.pi/6)
-\end{tkzelements}
-\hspace*{\fill}\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle(A,B)
- \tkzDrawPoints(A,B,X,M)
- \tkzLabelPoints(A,B,X,M)
-\end{tikzpicture}\hspace*{\fill}
-
-% subsection in_out_of_a_circle (end)
-%
\subsection{Orthogonal circle through} % (fold)
\label{sub:orthogonal_circle_through}
@@ -918,9 +723,6 @@ end
\tkzLabelPoints[right](O,A,z1,z2,c)
\end{tikzpicture}
\hspace*{\fill}
- %\caption{Orthogonal circle through}
-
-
% subsection orthogonal_circle_through (end)
\subsection{Devine ratio} % (fold)
@@ -934,8 +736,8 @@ L.AB = line: new (z.A,z.B)
z.C = L.AB: gold_ratio ()
L.AC = line: new (z.A,z.C)
z.O_1 = L.AC.mid
-z.G,z.H = L.AB: square ()
-z.E,z.F = L.AC: square ()
+_,_,z.G,z.H = get_points(L.AB: square ())
+_,_,z.E,z.F = get_points(L.AC: square ())
L.CB = line: new (z.C,z.B)
z.O_2 = L.CB.mid
z.O_0 = L.AB.mid
@@ -969,8 +771,8 @@ L.AB = line: new (z.A,z.B)
z.C = L.AB: gold_ratio ()
L.AC = line: new (z.A,z.C)
z.O_1 = L.AC.mid
-z.G,z.H = L.AB: square ()
-z.E,z.F = L.AC: square ()
+_,_,z.G,z.H = get_points(L.AB: square ())
+_,_,z.E,z.F = get_points(L.AC: square ())
L.CB = line: new (z.C,z.B)
z.O_2 = L.CB.mid
z.O_0 = L.AB.mid
@@ -998,10 +800,6 @@ z.L = intersection (L.AR,L.BG)
\tkzLabelPoints(A,B,C,K,E,F,G,H,O_0,O_1,O_2,R,S,T,L)
\end{tikzpicture}
\hspace*{\fill}
- %\caption{Devine or gold ratio}
-
-
-
% subsection devine_ratio (end)
\subsection{Director circle} % (fold)
@@ -1070,82 +868,32 @@ z.K = L.K.pb
\tkzMarkRightAngles(A,P,H J,L,K)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Director circle}
% subsection director_circle (end)
-\subsection{Distance} % (fold)
-\label{sub:distance}
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.A = point : new (0 , 0)
- z.B = point : new (4 , 3)
- z.C = point : new (2 , 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)
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines(A,B C,H)
- \tkzDrawPoints(A,B,C,H)
- \tkzLabelPoints(A,B,C,H)
- \tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
- \tkzLabelSegment[below left,draw](C,H){$AB =\tkzUseLua{l}$}
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
-z.A = point : new (0 , 0)
-z.B = point : new (4 , 3)
-z.C = point : new (2 , 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)
-\end{tkzelements}
-
-\hspace*{\fill}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawLines(A,B C,H)
-\tkzDrawPoints(A,B,C,H)
-\tkzLabelPoints(A,B,C,H)
-\tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
-\tkzLabelSegment[below left,draw](C,H){$AB =\tkzUseLua{l}$}
-\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Distance to a line}
-
-
-
-% subsection distance (end)
\subsection{Gold division} % (fold)
\label{sub:gold_division}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
- 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 ()
- z.k = L.JB: ortho_from (z.K)
- L.Kk = line:new (z.K,z.k)
- _,z.G = intersection (L.Kk,C.BA)
- L.EG = line:new (z.E,z.G)
- z.C = intersection (L.EG,L.AB)
- z.O = C.AB: antipode (z.B)
+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)
\end{tkzelements}
-\begin{tikzpicture}
-\tkzGetNodes
+ \begin{tikzpicture}
+ \tkzGetNodes
\tkzDrawArc[delta=5](O,B)(G)
\tkzDrawCircles(A,B B,A)
\tkzDrawSegments(A,E B,E O,I)
@@ -1153,7 +901,7 @@ z.H = L.AB : projection (z.C)
\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{tikzpicture}
\end{tkzexample}
\begin{tkzelements}
@@ -1186,11 +934,6 @@ z.O = C.AB: antipode (z.B)
\tkzLabelPoints(A,B,C,E,I,J,G,O,K)
\end{tikzpicture}
\hspace*{\fill}
- %\caption{gold division}
-
-
-
-
% subsection gold_division (end)
\subsection{Ellipse} % (fold)
@@ -1232,18 +975,16 @@ b = E.Ry
slope = math.deg(E.slope)
\end{tkzelements}
- \hspace*{\fill}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles[teal](C,A)
- \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{slope})
- \tkzDrawPoints(C,A,B,b)
- \tkzLabelPoints(C,A,B)
- \end{tikzpicture}
- \hspace*{\fill}
- %\caption{Ellipse}
-
-% subsection ellipse (end)
+\hspace*{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[teal](C,A)
+\tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{slope})
+\tkzDrawPoints(C,A,B,b)
+\tkzLabelPoints(C,A,B)
+\end{tikzpicture}
+\hspace*{\fill}
+ % subsection ellipse (end)
\subsection{Ellipse with radii} % (fold)
\label{sub:ellipse_with_radii}
@@ -1258,7 +999,7 @@ a = math.sqrt(32)
ang = math.deg(math.pi/4)
E = ellipse: radii (z.C,a,b,math.pi/4)
z.V = E : point (0)
-z.CoV = E : point (math.pi/2)
+z.CoV = E : point (0.25)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -1276,7 +1017,7 @@ a = math.sqrt(32)
ang = math.deg(math.pi/4)
E = ellipse: radii (z.C,a,b,math.pi/4)
z.V = E : point (0)
-z.CoV = E : point (math.pi/2)
+z.CoV = E : point (0.25)
\end{tkzelements}
\hspace*{\fill}
@@ -1285,8 +1026,6 @@ z.CoV = E : point (math.pi/2)
\tkzDrawEllipse[blue](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{ang})
\tkzDrawPoints(C,V,CoV)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Ellipse with radii}
% subsection ellipse_with_radii (end)
\subsection{Ellipse\_with\_foci} % (fold)
@@ -1350,10 +1089,6 @@ z.G = L.tb.pb
\tkzDrawLines(K,F K,G)
\end{tikzpicture}
\hspace*{\fill}
- %\caption{Ellipse with foci}
-
-
-
% subsection ellipse_with_foci (end)
\subsection{Euler relation} % (fold)
@@ -1418,74 +1153,12 @@ _,z.E = intersection (L.Ow, C.OA)
\tkzMarkRightAngles[fill=gray!20,opacity=.4](C,H,I A,K,J)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Euler relation}
% subsection euler_relation (end)
-\subsection{Euler line} % (fold)
-\label{sub:euler_line}
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.A = point: new (0 , 0)
- z.B = point: new (6 , 0)
- z.C = point: new (1.5 , 3.5)
- T.ABC = triangle: new (z.A,z.B,z.C)
- z.O = T.ABC.circumcenter
- z.G = T.ABC.centroid
- z.N = T.ABC. eulercenter
- z.H = T.ABC. orthocenter
- z.P,z.Q,z.R = get_points (T.ABC: orthic())
- z.K,z.I,z.J = get_points (T.ABC: medial ())
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines[blue](O,H)
- \tkzDrawCircle[red](N,I)
- \tkzDrawCircles[teal](O,A)
- \tkzDrawSegments(A,P B,Q C,R)
- \tkzDrawSegments[red](A,I B,J C,K)
- \tkzDrawPolygons(A,B,C)
- \tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G)
- \tkzLabelPoints(A,B,C,I,J,K,P,Q,R,H)
- \tkzLabelPoints[below](N,O,G)
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
- scale =1
- z.A = point: new (0 , 0)
- z.B = point: new (6 , 0)
- z.C = point: new (1.5 , 3.5)
- T.ABC = triangle: new (z.A,z.B,z.C)
- z.O = T.ABC.circumcenter
- z.G = T.ABC.centroid
- z.N = T.ABC. eulercenter
- z.H = T.ABC. orthocenter
- z.P,z.Q,z.R = get_points (T.ABC: orthic())
- z.K,z.I,z.J = get_points (T.ABC: medial ())
-\end{tkzelements}
-
-\hspace*{\fill}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawLines[blue](O,H)
-\tkzDrawCircle[red](N,I)
-\tkzDrawCircles[teal](O,A)
-\tkzDrawSegments(A,P B,Q C,R)
-\tkzDrawSegments[red](A,I B,J C,K)
-\tkzDrawPolygons(A,B,C)
-\tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G)
-\tkzLabelPoints(A,B,C,I,J,K,P,Q,R)
-\tkzLabelPoints[below](N,O,G,H)
-\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Euler line}
-% subsection euler_line (end)
-
\subsection{External angle} % (fold)
\label{sub:external_angle}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale =.8
z.A = point: new (0 , 0)
@@ -1509,8 +1182,9 @@ _,z.E = intersection (L.Ow, C.OA)
\tkzLabelPoints[above](C)
\tkzLabelPoints(A,B,D)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .8
z.A = point: new (0 , 0)
@@ -1523,7 +1197,6 @@ z.D = intersection (T.ext.ab,T.ABC.ab)
z.E = z.C: symmetry (z.B)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -1537,14 +1210,13 @@ z.E = z.C: symmetry (z.B)
\tkzLabelPoints[above](C)
\tkzLabelPoints(A,B,D)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{External angle}
+\end{minipage}
% subsection external_angle (end)
\subsection{Internal angle} % (fold)
\label{sub:internal_angle}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale = .8
z.A = point: new (0 , 0)
@@ -1570,8 +1242,9 @@ z.E = z.C: symmetry (z.B)
\tkzLabelPoints[above](C,D,E)
\tkzMarkSegments(A,C C,E)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale =.8
z.A = point: new (0 , 0)
@@ -1585,8 +1258,6 @@ L.LL = T.ab: ll_from (z.C)
L.AD = line: new (z.A,z.D)
z.E = intersection (L.LL,L.AD)
\end{tkzelements}
-
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -1600,14 +1271,13 @@ z.E = intersection (L.LL,L.AD)
\tkzLabelPoints[above](C,D,E)
\tkzMarkSegments(A,C C,E)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Internal angle}
+\end{minipage}
%subsection internal_angle (end)
\subsection{Feuerbach theorem} % (fold)
\label{sub:nine_points}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale = 1.5
z.A = point: new (0 , 0)
@@ -1647,8 +1317,9 @@ z.E = intersection (L.LL,L.AD)
\tkzDrawPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I)
\tkzLabelPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = 1
z.A = point: new (0 , 0)
@@ -1687,18 +1358,13 @@ z.F = intersection (L.LH,C.IH) -- feuerbach
\tkzDrawPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I)
\tkzLabelPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Feuerbach theorem}
-
-
-
-
+\end{minipage}
% subsection nine_points (end)
\subsection{Gold ratio with segment} % (fold)
\label{sub:gold_ratio_with_segment}
-
- \begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
\begin{tkzelements}
z.A = point: new (0 , 0)
z.B = point: new (8 , 0)
@@ -1719,14 +1385,15 @@ z.F = intersection (L.LH,C.IH) -- feuerbach
\tkzDrawArc[delta=20](M,A)(K)
\tkzLabelPoints(A,B,C)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
scale = .5
z.A = point: new (0 , 0)
z.B = point: new (8 , 0)
L.AB = line: new (z.A,z.B)
-z.X,z.Y = L.AB: square ()
+_,_,z.X,z.Y = get_points(L.AB: square ())
L.BX = line: new (z.B,z.X)
z.M = L.BX.mid
C.MA = circle: new (z.M,z.A)
@@ -1744,14 +1411,13 @@ z.C = intersection (L.AK,L.AB)
\tkzDrawArc[delta=20](M,A)(K)
\tkzLabelPoints(A,B,C)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Gold ration with a segment}
+\end{minipage}
%subsection gold_ratio_with_segment (end)
\subsection{Gold Arbelos} % (fold)
\label{sub:gold_arbelos}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
scale = .6
z.A = point: new (0 , 0)
@@ -1772,14 +1438,15 @@ z.C = intersection (L.AK,L.AB)
\tkzDrawPoints(A,C,B,O_1,O_2,O_0)
\tkzLabelPoints(A,C,B)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
scale = .4
z.A = point: new (0 , 0)
z.C = point: new (6 , 0)
L.AC = line: new (z.A,z.C)
-z.x,z.y = L.AC: square ()
+_,_,z.x,z.y = get_points(L.AC: square ())
z.O_1 = L.AC . mid
C = circle: new (z.O_1,z.x)
z.B = intersection (L.AC,C)
@@ -1794,16 +1461,15 @@ z.O_0 = L.AB.mid
\tkzGetNodes
\tkzDrawCircles(O_1,C O_2,B O_0,B O_1,x)
\tkzDrawPoints(A,C,B,O_1,O_2,O_0,x)
-\tkzLabelPoints(A,C,B)
+\tkzLabelPoints[below right](A,C,B)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Gold Arbelos}
+\end{minipage}
% subsection gold_arbelos (end)
\subsection{Harmonic division v1} % (fold)
\label{sub:harmonic_division_v1}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale=.75
z.A = point: new (0 , 0)
@@ -1835,8 +1501,9 @@ z.C = intersection (L.XG,L.AB)
\tkzLabelPoints(A,B,G,E,F,C,D)
\tkzMarkSegments(F,B B,E)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale=.75
z.A = point: new (0 , 0)
@@ -1869,14 +1536,13 @@ z.C = intersection (L.XG,L.AB)
\tkzLabelPoints(A,B,G,E,F,C,D)
\tkzMarkSegments(F,B B,E)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Harmonic division V1}
+\end{minipage}
% subsection harmonic_division_v1 (end)
\subsection{Harmonic division v2} % (fold)
\label{sub:harmonic_division_v2}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale = .5
z.A = point: new (0 , 0)
@@ -1901,8 +1567,9 @@ z.C = intersection (L.XG,L.AB)
\tkzDrawPoints(A,...,G,X)
\tkzLabelPoints(A,...,G,X)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .5
z.A = point: new (0 , 0)
@@ -1929,14 +1596,13 @@ z.C = intersection (L.GX,L.AB)
\tkzDrawPoints(A,...,G,X)
\tkzLabelPoints(A,...,G,X)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Harmonic division V2}
+\end{minipage}
% subsection harmonic_division_v2 (end)
\subsection{Menelaus} % (fold)
\label{sub:menelaus}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
@@ -1957,8 +1623,9 @@ z.C = intersection (L.GX,L.AB)
\tkzDrawPoints(P,Q,R,A,B,C)
\tkzLabelPoints(A,B,C,P,Q,R)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
@@ -1981,8 +1648,7 @@ z.R = intersection (L.BC,L.PX)
\tkzDrawPoints(P,Q,R,A,B,C)
\tkzLabelPoints(A,B,C,P,Q,R)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Menelaus}
+\end{minipage}
% subsection menelaus (end)
\subsection{Radical axis v1} % (fold)
@@ -1990,24 +1656,24 @@ z.R = intersection (L.BC,L.PX)
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
- 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 (-math.pi)
- 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{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -2029,7 +1695,7 @@ 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 (-math.pi)
+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)
@@ -2039,7 +1705,6 @@ L.ApBp = line : new (z.Ap,z.Bp)
z.M = intersection (L.AB,L.ApBp)
z.H = L.XY : projection (z.M)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -2049,8 +1714,6 @@ z.H = L.XY : projection (z.M)
\tkzDrawLines[red](A,M A',M X,Y E,F)
\tkzDrawLines[red,add=1 and 3](M,H)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Radical axis v1}
% subsection radical_axis_v1 (end)
\subsection{Radical axis v2} % (fold)
@@ -2116,7 +1779,6 @@ _,z.Kp = get_points (L.MKp)
\tkzDrawPoints(O,O',T,M,T',K,K')
\tkzLabelPoints(O,O',T,T',K,K',M)
\end{tikzpicture}\hspace*{\fill}
-%\caption{Radical axis v2}
% subsection radical_axis_v2 (end)
\subsection{Radical axis v3} % (fold)
@@ -2177,7 +1839,6 @@ _,z.Tp = get_points (L)
\tkzDrawArc(M,T')(T)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Radical axis v3}
% subsection radical_axis_v3 (end)
\subsection{Radical axis v4} % (fold)
@@ -2237,13 +1898,12 @@ _,z.Tp = get_points (L)
\tkzDrawArc(M,T)(B)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Radical axis v4}
% subsection radical_axis_v4 (end)
\subsection{Radical center} % (fold)
\label{sub:radical_center}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.O = point : new (0,0)
z.x = point : new (1,0)
@@ -2263,7 +1923,6 @@ _,z.Tp = get_points (L)
L.OOp = line : new (z.O,z.Op)
z.H = L.OOp : projection (z.X)
\end{tkzelements}
-
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,a O',b P,z)
@@ -2271,8 +1930,9 @@ _,z.Tp = get_points (L)
\tkzDrawPoints(O,O',P,a,a',b,b',X,H)
\tkzLabelPoints[below right](O,O',P,H)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
z.O = point : new (0,0)
z.x = point : new (1,0)
@@ -2300,14 +1960,13 @@ z.H = L.OOp : projection (z.X)
\tkzDrawPoints(O,O',P,a,a',b,b',X,H)
\tkzLabelPoints[below right](O,O',P,H)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Radical center}
+\end{minipage}
% subsection radical_center (end)
\subsection{Radical circle} % (fold)
\label{sub:radical_circle}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale = .25
z.A = point: new (0,0)
@@ -2331,8 +1990,9 @@ z.H = L.OOp : projection (z.X)
\tkzDrawPoints(A,B,C)
\tkzLabelPoints(A,B,C)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .25
z.A = point: new (0,0)
@@ -2358,8 +2018,7 @@ z.H = L.OOp : projection (z.X)
\tkzDrawPoints(A,B,C)
\tkzLabelPoints(A,B,C)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Radical circle}
+\end{minipage}
% subsection radical_circle (end)
\subsection{Hexagram} % (fold)
@@ -2418,7 +2077,7 @@ z.H = L.OOp : projection (z.X)
\end{tkzexample}
\begin{tkzelements}
-scale = 1.5
+scale = 2
E = {}
z.A = point: new (0 , 0)
z.B = point: new (5 , 1)
@@ -2472,7 +2131,6 @@ _,z.W = intersection (L.ZO,E)
\tkzDrawEllipse[blue](N,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{ang})
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Hexagram Lemoine,Pascal}
% subsection hexagram (end)
\subsection{Gold Arbelos properties} % (fold)
@@ -2511,7 +2169,7 @@ _,z.W = intersection (L.ZO,E)
C.DC = circle: new (z.D,z.C)
z.U,z.V = intersection (C.DC,C1)
L.UV = line :new (z.U,z.V)
- z.R ,z.S = L.UV : set_projection (z.O_2,z.O_3)
+ z.R ,z.S = L.UV : projection (z.O_2,z.O_3)
L.O1D = line : new (z.O_1,z.D)
z.W = intersection (L.UV,L.O1D)
z.O = C.DC : inversion (z.W)
@@ -2578,7 +2236,7 @@ z.O_7 = L.CD.mid
C.DC = circle: new (z.D,z.C)
z.V,z.U = intersection (C.DC,C1)
L.UV = line :new (z.U,z.V)
-z.R ,z.S = L.UV : set_projection (z.O_2,z.O_3)
+z.R ,z.S = L.UV : projection (z.O_2,z.O_3)
L.O1D = line : new (z.O_1,z.D)
z.W = intersection (L.UV,L.O1D)
z.O = C.DC : inversion (z.W)
@@ -2614,7 +2272,6 @@ z.O = C.DC : inversion (z.W)
\tkzLabelPoints[below right](B,U,W,O_7)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Gold Arbelos properties}
% subsection gold_arbelos_properties (end)
\subsection{Apollonius circle v1 with inversion} % (fold)
@@ -2636,7 +2293,7 @@ z.O = C.DC : inversion (z.W)
C.euler = T.ABC: euler_circle ()
C.apo = C.ortho : inversion (C.euler)
z.O = C.apo.center
- z.xa,z.xb,z.xc = C.ortho : set_inversion (z.Ea,z.Eb,z.Ec)
+ z.xa,z.xb,z.xc = C.ortho : inversion (z.Ea,z.Eb,z.Ec)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -2673,7 +2330,7 @@ z.O = C.DC : inversion (z.W)
C.euler = T.ABC: euler_circle ()
C.apo = C.ortho : inversion (C.euler)
z.O = C.apo.center
- z.xa,z.xb,z.xc = C.ortho : set_inversion (z.Ea,z.Eb,z.Ec)
+ z.xa,z.xb,z.xc = C.ortho : inversion (z.Ea,z.Eb,z.Ec)
\end{tkzelements}
\hspace*{\fill}
@@ -2695,7 +2352,6 @@ z.O = C.DC : inversion (z.W)
\tkzLabelPoints(A,B,C,O,S,N)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Apollonius circle V1}
% subsection apollonius_circle_v1_with_inversion (end)
\subsection{Apollonius circle v2} % (fold)
@@ -2743,7 +2399,7 @@ z.O = C.DC : inversion (z.W)
\end{tkzexample}
\begin{tkzelements}
-scale =.5
+scale =.3
z.A = point: new (0,0)
z.B = point: new (6,0)
z.C = point: new (0.8,4)
@@ -2843,7 +2499,6 @@ z.S,z.T = get_points (C: orthogonal_from (z.C_2))
\tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Orthogonal circles v1 }
% subsection orthogonal_circles_v1 (end)
\subsection{Orthogonal circles v2} % (fold)
@@ -2921,7 +2576,6 @@ z.M = L.OOp.mid
\tkzLabelPoint[above left](O'){$O'$}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Orthogonal circles v2}
% subsection orthogonal_circles_v2 (end)
\subsection{Orthogonal circle to two circles} % (fold)
@@ -2958,6 +2612,7 @@ z.M = L.OOp.mid
\end{tkzexample}
\begin{tkzelements}
+ scale = 1.25
z.O = point : new (-1,0)
z.B = point : new (0,2)
z.Op = point : new (4,-1)
@@ -2974,7 +2629,6 @@ z.K = L.K.pb
z.Tp = L.Tp.pb
z.Kp = L.Kp.pb
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
@@ -2988,7 +2642,6 @@ z.Kp = L.Kp.pb
\tkzLabelPoints(O,O',T,T',M,K,K')
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Orthogonal to two circles}
% \subsection{Orthogonal to two circles} % (fold)
\subsection{Midcircles} % (fold)
@@ -3039,37 +2692,37 @@ z.Kp = L.Kp.pb
_,z.G = intersection (L.AP0,C.O4P0)
z.H = intersection (L.BP0,C.O4P0)
z.Ap = z.M_1: symmetry (z.A)
- z.H_4,z.F,z.E,z.H_0 = L.AB : set_projection (z.O_4,z.G,z.H,z.P_0)
+ z.H_4,z.F,z.E,z.H_0 = L.AB : projection (z.O_4,z.G,z.H,z.P_0)
\end{tkzelements}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle[thin,fill=green!10](O_4,P_0)
- \tkzDrawCircle[purple,fill=purple!10,opacity=.5](O_5,C)
- \tkzDrawSemiCircles[teal](O_0,B)
- \tkzDrawSemiCircles[thin,teal,fill=teal!20,opacity=.5](O_1,C O_2,B)
- \tkzDrawSemiCircles[new](M_2,B)
- \tkzDrawSemiCircles[new](M_1,A')
- \tkzDrawArc[purple,delta=0](M_0,P_0)(C)
- \tkzDrawSegments[very thin](A,B A,P B,Q)
- \tkzDrawSegments[step 1](O_0,P_0 B,J G,J G,O_0 H,O_2)
- \tkzDrawSegments[ultra thin,purple](M_1,P_0 M_2,P_0 M_1,M_0 M_0,P_1 M_0,P_0 M_1,J)
- \tkzDrawPoints(A,B,C,P_0,P_2,P_1,M_0,M_1,M_2,J,P,Q,S)
- \tkzDrawPoints(O_0,O_1,O_2,O_4,O_5,G,H)
- \tkzMarkRightAngle[size=.2,fill=gray!20,opacity=.4](O_0,P_0,M_0)
- \tkzLabelPoints[below](A,B,C,M_0,M_1,M_2,O_1,O_2,O_0)
- \tkzLabelPoints[above](P_0,O_5,O_4)
- \tkzLabelPoints[above](P_1,J)
- \tkzLabelPoints[above](P_2,P,Q,S)
- \tkzLabelPoints[above right](H,E)
- \tkzLabelPoints[above left](F,G)
- \tkzLabelPoints[below right](H_0)
- \tkzLabelCircle[below=4pt,font=\scriptsize](O_1,C)(80){$(\beta)$}
- \tkzLabelCircle[below=4pt,font=\scriptsize](O_2,B)(80){$(\gamma)$}
- \tkzLabelCircle[below=4pt,font=\scriptsize](O_0,B)(110){$(\alpha)$}
- \tkzLabelCircle[left,font=\scriptsize](O_4,P_2)(60){$(\delta)$}
- \tkzLabelCircle[above left,font=\scriptsize](O_5,C)(40){$(\epsilon)$}
- \end{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircle[thin,fill=green!10](O_4,P_0)
+\tkzDrawCircle[purple,fill=purple!10,opacity=.5](O_5,C)
+\tkzDrawSemiCircles[teal](O_0,B)
+\tkzDrawSemiCircles[thin,teal,fill=teal!20,opacity=.5](O_1,C O_2,B)
+\tkzDrawSemiCircles[color = orange](M_2,B)
+\tkzDrawSemiCircles[color = orange](M_1,A')
+\tkzDrawArc[purple,delta=0](M_0,P_0)(C)
+\tkzDrawSegments[very thin](A,B A,P B,Q)
+\tkzDrawSegments[color=cyan](O_0,P_0 B,J G,J G,O_0 H,O_2)
+\tkzDrawSegments[ultra thin,purple](M_1,P_0 M_2,P_0 M_1,M_0 M_0,P_1 M_0,P_0 M_1,J)
+\tkzDrawPoints(A,B,C,P_0,P_2,P_1,M_0,M_1,M_2,J,P,Q,S)
+\tkzDrawPoints(O_0,O_1,O_2,O_4,O_5,G,H)
+\tkzMarkRightAngle[size=.2,fill=gray!20,opacity=.4](O_0,P_0,M_0)
+\tkzLabelPoints[below](A,B,C,M_0,M_1,M_2,O_1,O_2,O_0)
+\tkzLabelPoints[above](P_0,O_5,O_4)
+\tkzLabelPoints[above](P_1,J)
+\tkzLabelPoints[above](P_2,P,Q,S)
+\tkzLabelPoints[above right](H,E)
+\tkzLabelPoints[above left](F,G)
+\tkzLabelPoints[below right](H_0)
+\tkzLabelCircle[below=4pt,font=\scriptsize](O_1,C)(80){$(\beta)$}
+\tkzLabelCircle[below=4pt,font=\scriptsize](O_2,B)(80){$(\gamma)$}
+\tkzLabelCircle[below=4pt,font=\scriptsize](O_0,B)(110){$(\alpha)$}
+\tkzLabelCircle[left,font=\scriptsize](O_4,P_2)(60){$(\delta)$}
+\tkzLabelCircle[above left,font=\scriptsize](O_5,C)(40){$(\epsilon)$}
+\end{tikzpicture}
\end{tkzexample}
\begin{tkzelements}
@@ -3116,7 +2769,7 @@ C.O4P0 = circle : new (z.O_4,z.P_0)
_,z.G = intersection (L.AP0,C.O4P0)
z.H = intersection (L.BP0,C.O4P0)
z.Ap = z.M_1: symmetry (z.A)
-z.H_4,z.F,z.E,z.H_0 = L.AB : set_projection (z.O_4,z.G,z.H,z.P_0)
+z.H_4,z.F,z.E,z.H_0 = L.AB : projection (z.O_4,z.G,z.H,z.P_0)
\end{tkzelements}
\hspace*{\fill}
@@ -3149,7 +2802,6 @@ z.H_4,z.F,z.E,z.H_0 = L.AB : set_projection (z.O_4,z.G,z.H,z.P_0)
\tkzLabelCircle[above left,font=\scriptsize](O_5,C)(40){$(\epsilon)$}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Midcircles}
% subsection midcircles (end)
\subsection{Pencil v1} % (fold)
@@ -3212,7 +2864,6 @@ z.O = L.BA.mid
\tkzLabelLine[pos=1.25,right]( M_0,M_1){$(\Delta)$}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Pencil v1}
% subsection pencil_v1 (end)
\subsection{Pencil v2} % (fold)
@@ -3283,7 +2934,8 @@ z.O = L.BA.mid
\subsection{Power v1} % (fold)
\label{sub:power_v1}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.O = point : new (0,0)
z.A = point : new (2,-2)
@@ -3302,10 +2954,11 @@ z.O = L.BA.mid
\tkzLabelPoints(O,A,A',M,B)
\tkzDrawSegments[-Triangle](M,A M,A')
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
-scale = 1.25
+scale = 1
z.O = point : new (0,0)
z.A = point : new (2,-2)
z.M = point : new (-6,0)
@@ -3325,13 +2978,13 @@ z.B = intersection (L.AM, C.OA)
\tkzLabelPoints(O,A,A',M,B)
\tkzDrawSegments[-Triangle](M,A M,A')
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Power v1}
+\end{minipage}
% subsection power_v1 (end)
\subsection{Power v2} % (fold)
\label{sub:power_v2}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.O = point : new (0,0)
z.A = point : new (2,2)
@@ -3354,10 +3007,11 @@ z.B = intersection (L.AM, C.OA)
\tkzLabelPoints[below left](A',B)
\tkzDrawSegments(M,A M,A')
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
-scale = 1.25
+scale = 1
z.O = point : new (0,0)
z.A = point : new (2,2)
z.M = point : new (-1.5,0)
@@ -3379,8 +3033,8 @@ z.U,z.V = intersection (L.mM,C.OA)
\tkzLabelPoints(O,A,M,U,V,m)
\tkzLabelPoints[below left](A',B)
\tkzDrawSegments(M,A M,A')
-\end{tikzpicture}\hspace*{\fill}
- %\caption{Power v2}
+\end{tikzpicture}
+\end{minipage}
% subsection power_v2 (end)
\subsection{Reim v1} % (fold)
@@ -3390,9 +3044,9 @@ z.U,z.V = intersection (L.mM,C.OA)
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 (math.pi/6)
- z.D = C.AE : point (-math.pi/180*40)
- z.F = C.AE : point (-math.pi/180*100)
+ 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)
@@ -3419,20 +3073,20 @@ z.U,z.V = intersection (L.mM,C.OA)
\end{tkzexample}
\begin{tkzelements}
-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 (math.pi/6)
-z.D = C.AE : point (-math.pi/180*40)
-z.F = C.AE : point (-math.pi/180*100)
-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)
\end{tkzelements}
\hspace*{\fill}
@@ -3451,7 +3105,6 @@ z.O = intersection (L.EC,L.FD)
\tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Reim v1}
% subsection reim_v1 (end)
\subsection{Reim v2} % (fold)
@@ -3464,7 +3117,7 @@ z.O = intersection (L.EC,L.FD)
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 (1.2*math.pi)
+ 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)
@@ -3491,7 +3144,7 @@ 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 (1.2*math.pi)
+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)
@@ -3512,7 +3165,6 @@ z.n,z.np = get_points (C.BC: tangent_at (z.N))
\tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Reim v2}
% subsection reim_v2 (end)
\subsection{Reim v3} % (fold)
@@ -3597,13 +3249,12 @@ z.n,z.np = get_points (C.BC: tangent_at (z.N))
\tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Reim v3}
% subsection reim_v3 (end)
\subsection{Tangent and circle} % (fold)
\label{sub:tangent_and_circle}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (1,0)
z.B = point: new (2,2)
@@ -3624,8 +3275,9 @@ z.n,z.np = get_points (C.BC: tangent_at (z.N))
\tkzDrawLines(E,i E,j k,l)
\tkzLabelPoints[right,font=\small](A,B,E,S,M)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
z.A = point: new (1,0)
z.B = point: new (2,2)
@@ -3647,19 +3299,18 @@ z.k,z.l = get_points (C.AB: tangent_at (z.B))
\tkzDrawLines(E,i E,j k,l)
\tkzLabelPoints[right,font=\small](A,B,E,S,M)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Tangent and circle}
+\end{minipage}
% subsection tangent_and_circle (end)
\subsection{Homothety} % (fold)
\label{sub:homothety}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (0,0)
z.B = point: new (1,2)
z.E = point: new (-3,2)
- z.C,z.D = z.E : set_homothety(2,z.A,z.B)
+ z.C,z.D = z.E : homothety(2,z.A,z.B)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -3668,14 +3319,15 @@ z.k,z.l = get_points (C.AB: tangent_at (z.B))
\tkzDrawCircles(A,B C,D)
\tkzDrawLines(E,C E,D)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
scale = .6
z.A = point: new (0,0)
z.B = point: new (1,2)
z.E = point: new (-3,2)
-z.C,z.D = z.E : set_homothety(2,z.A,z.B)
+z.C,z.D = z.E : homothety(2,z.A,z.B)
\end{tkzelements}
\hspace*{\fill}\begin{tikzpicture}
\tkzGetNodes
@@ -3683,14 +3335,14 @@ z.C,z.D = z.E : set_homothety(2,z.A,z.B)
\tkzLabelPoints(A,B,C,E)
\tkzDrawCircles(A,B C,D)
\tkzDrawLines(E,C E,D)
-\end{tikzpicture}\hspace*{\fill}
-%\caption{Homothety}
+\end{tikzpicture}
+\end{minipage}
% subsection homothety (end)
\subsection{Tangent and chord} % (fold)
\label{sub:tangent_and_chord}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
scale = .8
z.A = point: new (0 , 0)
@@ -3714,11 +3366,12 @@ z.C,z.D = z.E : set_homothety(2,z.A,z.B)
\tkzDrawLine(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](B,D,A b2,B,A)
+ \tkzFillAngles[teal!20,opacity=.3](A,D,B b2,B,A)
\tkzLabelPoints(A,B,C,D,H,O)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
scale = 0.75
z.A = point: new (0 , 0)
@@ -3744,11 +3397,10 @@ z.H = L.AB: projection (z.O)
\tkzDrawLine(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](B,D,A b2,B,A)
+\tkzFillAngles[teal!20,opacity=.3](A,D,B b2,B,A)
\tkzLabelPoints(A,B,C,D,H,O)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Tangent and chord}
+\end{minipage}
% subsection tangent_and_chord (end)
@@ -3757,33 +3409,33 @@ z.H = L.AB: projection (z.O)
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
- z.O = point: new (0 , 0)
- z.B = point: new (0 , 2)
- z.P = point: new (1 , -.5)
- C.OB = circle : new (z.O,z.B)
- C.PB = circle : new (z.P,z.B)
- _,z.A = intersection (C.OB,C.PB)
- z.D = C.PB: point(math.pi/3)
- z.C = C.PB: point(-math.pi/3)
- z.E = C.OB: point(-math.pi/180*50)
- L.AB = line : new (z.A,z.B)
- L.CD = line : new (z.C,z.D)
- z.G = intersection (L.AB,L.CD)
- L.GE = line : new (z.G,z.E)
- z.F,_ = intersection (L.GE,C.OB)
- T.CDE = triangle: new (z.C,z.D,z.E)
- T.BFD = triangle: new (z.B,z.F,z.D)
- z.w = T.CDE.circumcenter
- z.x = T.BFD.circumcenter
- L.GB = line : new (z.G,z.B)
- L.GE = line : new (z.G,z.E)
- L.GD = line : new (z.G,z.D)
- C.xB = circle : new (z.x,z.B)
- C.xF = circle : new (z.x,z.F)
- C.xD = circle : new (z.x,z.D)
- z.Ap = intersection (L.GB,C.xB)
- z.Ep = intersection (L.GE,C.xF)
- z.Cp = intersection (L.GD,C.xD)
+z.O = point: new (0 , 0)
+z.B = point: new (0 , 2)
+z.P = point: new (1 , -.5)
+C.OB = circle : new (z.O,z.B)
+C.PB = circle : new (z.P,z.B)
+_,z.A = intersection (C.OB,C.PB)
+z.D = C.PB: point(0.85)
+z.C = C.PB: point(0.5)
+z.E = C.OB: point(0.6)
+L.AB = line : new (z.A,z.B)
+L.CD = line : new (z.C,z.D)
+z.G = intersection (L.AB,L.CD)
+L.GE = line : new (z.G,z.E)
+z.F,_ = intersection (L.GE,C.OB)
+T.CDE = triangle: new (z.C,z.D,z.E)
+T.BFD = triangle: new (z.B,z.F,z.D)
+z.w = T.CDE.circumcenter
+z.x = T.BFD.circumcenter
+L.GB = line : new (z.G,z.B)
+L.GE = line : new (z.G,z.E)
+L.GD = line : new (z.G,z.D)
+C.xB = circle : new (z.x,z.B)
+C.xF = circle : new (z.x,z.F)
+C.xD = circle : new (z.x,z.D)
+z.Ap = intersection (L.GB,C.xB)
+z.Ep,_ = intersection (L.GE,C.xF)
+z.Cp,_ = intersection (L.GD,C.xD)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -3812,9 +3464,9 @@ z.P = point: new (1 , -.5)
C.OB = circle : new (z.O,z.B)
C.PB = circle : new (z.P,z.B)
_,z.A = intersection (C.OB,C.PB)
-z.D = C.PB: point(math.pi/3)
-z.C = C.PB: point(-math.pi/3)
-z.E = C.OB: point(-math.pi/180*50)
+z.D = C.PB: point(0.85)
+z.C = C.PB: point(0.5)
+z.E = C.OB: point(0.6)
L.AB = line : new (z.A,z.B)
L.CD = line : new (z.C,z.D)
z.G = intersection (L.AB,L.CD)
@@ -3855,13 +3507,13 @@ z.Cp,_ = intersection (L.GD,C.xD)
\end{scope}
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Three chords}
% subsection three_chords (end)
\subsection{Three tangents} % (fold)
\label{sub:three_tangents}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (-1 , 0)
z.C = point: new (4 , -1.5)
@@ -3891,8 +3543,9 @@ z.Cp,_ = intersection (L.GD,C.xD)
\tkzLabelPoints[above right](E,F)
\tkzLabelPoints[below](C)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .75
z.A = point: new (-1 , 0)
@@ -3925,14 +3578,13 @@ z.I = intersection (L.TA,L.TC)
\tkzLabelPoints[above right](E,F)
\tkzLabelPoints[below](C)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Three tangents}
+\end{minipage}
% subsection three_tangents (end)
\subsection{Midarc} % (fold)
\label{sub:midarc}
-
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (-1,0)
z.B = point: new (2,4)
@@ -3947,8 +3599,9 @@ z.I = intersection (L.TA,L.TC)
\tkzDrawPoints(A,...,D)
\tkzLabelPoints(A,...,D)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .5
z.A = point: new (-1,0)
@@ -3957,21 +3610,22 @@ C.AB = circle: new (z.A,z.B)
z.C = z.A: rotation (math.pi/3,z.B)
z.D = C.AB: midarc (z.B,z.C)
\end{tkzelements}
-
-\hspace*{\fill}\begin{tikzpicture}
+\hspace*{\fill}
+\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPoints(A,B,C)
\tkzDrawCircles(A,B)
\tkzDrawPoints(A,...,D)
\tkzLabelPoints(A,...,D)
-\end{tikzpicture}\hspace*{\fill}
-%\caption{Midarc}
+\end{tikzpicture}
+\end{minipage}
% subsection midarc (end)
\subsection{Lemoine Line without macro} % (fold)
\label{sub:lemoine_line_without_macro}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
scale = 1.6
z.A = point: new (1,0)
@@ -4003,8 +3657,9 @@ z.D = C.AB: midarc (z.B,z.C)
\tkzDrawLines[red](Ar,Al Br,Q Cr,Cl)
\tkzDrawSegments(A,R C,P C,Q)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = 0.75
z.A = point: new (1,0)
@@ -4038,14 +3693,14 @@ z.R = intersection (L.tC,L.AB)
\tkzDrawLines[red](Ar,Al Br,Q Cr,Cl)
\tkzDrawSegments(A,R C,P C,Q)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Lemoine Line without macro}
+\end{minipage}
% subsection lemoine_line_without_macro (end)
\subsection{First Lemoine circle} % (fold)
\label{sub:first_lemoine_circle}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (1,1)
z.B = point: new (5,1)
@@ -4063,8 +3718,9 @@ z.R = intersection (L.tC,L.AB)
\tkzLabelPoints(A,B,C,o,w,O,L)
\tkzDrawCircles(o,w O,A)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
z.A = point: new (1,1)
z.B = point: new (5,1)
@@ -4074,8 +3730,6 @@ z.O = T.circumcenter
z.o,z.w = get_points (T : first_lemoine_circle ())
z.L = T : lemoine_point ()
\end{tkzelements}
-
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -4084,8 +3738,7 @@ z.L = T : lemoine_point ()
\tkzLabelPoints(A,B,C,o,w,O,L)
\tkzDrawCircles(o,w O,A)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{First Lemoine circle}
+\end{minipage}
% subsection first_lemoine_circle (end)
\subsection{First and second Lemoine circles} % (fold)
@@ -4101,17 +3754,17 @@ z.L = T : lemoine_point ()
z.O = T.circumcenter
z.o,z.p = get_points (T : first_lemoine_circle ())
L.ab = line : new (z.a,z.b)
- L.ac = line : new (z.a,z.c)
+ L.ca = line : new (z.c,z.a)
L.bc = line : new (z.b,z.c)
z.L,z.x = get_points (T : second_lemoine_circle ())
C.first_lemoine = circle : new (z.o,z.p)
z.y1,z.y2 = intersection (L.ab,C.first_lemoine)
z.y5,z.y6 = intersection (L.bc,C.first_lemoine)
- z.y3,z.y4 = intersection (L.ac,C.first_lemoine)
+ z.y3,z.y4 = intersection (L.ca,C.first_lemoine)
C.second_lemoine = circle : new (z.L,z.x)
z.x1,z.x2 = intersection (L.ab,C.second_lemoine)
z.x3,z.x4 = intersection (L.bc,C.second_lemoine)
- z.x5,z.x6 = intersection (L.ac,C.second_lemoine)
+ z.x5,z.x6 = intersection (L.ca,C.second_lemoine)
L.y1y6 = line : new (z.y1,z.y6)
L.y4y5 = line : new (z.y4,z.y5)
L.y2y3 = line : new (z.y2,z.y3)
@@ -4138,17 +3791,17 @@ T = triangle: new (z.a,z.b,z.c)
z.O = T.circumcenter
z.o,z.p = get_points (T : first_lemoine_circle ())
L.ab = line : new (z.a,z.b)
-L.ac = line : new (z.a,z.c)
+L.ca = line : new (z.c,z.a)
L.bc = line : new (z.b,z.c)
z.L,z.x = get_points (T : second_lemoine_circle ())
C.first_lemoine = circle : new (z.o,z.p)
z.y1,z.y2 = intersection (L.ab,C.first_lemoine)
z.y5,z.y6 = intersection (L.bc,C.first_lemoine)
-z.y3,z.y4 = intersection (L.ac,C.first_lemoine)
+z.y3,z.y4 = intersection (L.ca,C.first_lemoine)
C.second_lemoine = circle : new (z.L,z.x)
z.x1,z.x2 = intersection (L.ab,C.second_lemoine)
z.x3,z.x4 = intersection (L.bc,C.second_lemoine)
-z.x5,z.x6 = intersection (L.ac,C.second_lemoine)
+z.x5,z.x6 = intersection (L.ca,C.second_lemoine)
L.y1y6 = line : new (z.y1,z.y6)
L.y4y5 = line : new (z.y4,z.y5)
L.y2y3 = line : new (z.y2,z.y3)
@@ -4167,7 +3820,6 @@ L.y2y3 = line : new (z.y2,z.y3)
\tkzDrawSegments(L,O x1,x4 x2,x5 x3,x6)
\end{tikzpicture}
\hspace*{\fill}
-%\caption{First and second Lemoine circles}
% subsection first_and_second_lemoine_circles (end)
\subsection{Inversion} % (fold)
@@ -4187,7 +3839,7 @@ L.y2y3 = line : new (z.y2,z.y3)
z.H = L.AE : projection (z.t1)
z.Bp,
z.Ep,
- z.Cp = C.AC: set_inversion ( z.B, z.E, z.C )
+ z.Cp = C.AC: inversion ( z.B, z.E, z.C )
\end{tkzelements}
\begin{tikzpicture}
@@ -4215,7 +3867,7 @@ L.AE = line: new (z.A,z.E)
z.H = L.AE : projection (z.t1)
z.Bp,
z.Ep,
-z.Cp = C.AC: set_inversion ( z.B, z.E, z.C )
+z.Cp = C.AC: inversion ( z.B, z.E, z.C )
\end{tkzelements}
\hspace*{\fill}
@@ -4229,13 +3881,13 @@ z.Cp = C.AC: set_inversion ( z.B, z.E, z.C )
\tkzLabelPoints[above](C')
\end{tikzpicture}
\hspace*{\fill}
-%\caption{Inversion}
% subsection inversion (end)
\subsection{Gergonne point} % (fold)
\label{sub:gergonne_point}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{verbatim}
\begin{tkzelements}
z.a = point: new(1,0)
z.b = point: new(6,2)
@@ -4244,7 +3896,7 @@ z.Cp = C.AC: set_inversion ( z.B, z.E, z.C )
z.g = T : gergonne_point ()
z.i = T.incenter
z.ta,z.tb,z.tc = get_points (T : intouch ())
-end{elements}
+end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygons(a,b,c)
@@ -4253,8 +3905,9 @@ end{elements}
\tkzDrawSegments (a,ta b,tb c,tc)
\tkzDrawCircle(i,ta)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
z.a = point: new(1,0)
z.b = point: new(6,2)
@@ -4274,14 +3927,15 @@ z.ta,z.tb,z.tc = get_points (T : intouch ())
\tkzDrawSegments (a,ta b,tb c,tc)
\tkzDrawCircle(i,ta)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Gergonne point}
+\end{minipage}
% subsection gergonne_point (end)
\subsection{Antiparallel through Lemoine point} % (fold)
\label{sub:antiparallel_through_lemoine_point}
-\begin{tkzexample}[latex=0cm,small,code only]
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
\begin{tkzelements}
z.a = point: new (0,0)
z.b = point: new (5,0)
@@ -4305,8 +3959,9 @@ z.ta,z.tb,z.tc = get_points (T : intouch ())
\tkzDrawSegments(x_0,x_1 y_0,y_1 z_0,z_1)
\tkzDrawCircle(L,x_0)
\end{tikzpicture}
-\end{tkzexample}
-
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
z.a = point: new (0,0)
z.b = point: new (5,0)
@@ -4331,6 +3986,5 @@ z.z_0,z.z_1 = get_points (L.anti)
\tkzDrawSegments(x_0,x_1 y_0,y_1 z_0,z_1)
\tkzDrawCircle(L,x_0)
\end{tikzpicture}
-\hspace*{\fill}
-%\caption{Antiparallels}
+\end{minipage}
% subsection antiparallel_through_lemoine_point (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex
deleted file mode 100644
index 5d47e005a7..0000000000
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex
+++ /dev/null
@@ -1,193 +0,0 @@
-\newpage
-\section{How to use} % (fold)
-\label{sec:how_to_use}
-
-You need to load either \TIKZ{} or \pkg{tkz-euclide} if you want to use these packages to get your plots, then you need to load \pkg{tkz-elements}.
-
-Loading \pkg{tkz-elements} allows you to use the \env{elements} environment. However, you can use the macro \tkzcname{directlua} or the \env{luacode} environment (the package \pkg{luacode} is loaded automatically).
-
-
-\subsection{Environment elements} % (fold)
-\label{sub:environment_elements}
-
-You must first create an environment \tkzNameEnv{tkzelements}, then in this environment you create the fixed points of your figure. (For the moment, you place the environment \env{elements} before the environment \env{tikzpicture} but it is possible to place it inside the latter.)
-
-In the following example, three fixed points are used (lines 8, 9 and 10), the first object \tkzNameObj{point} $A$ is created by
-
-|z.A = point: new (2 , 4)|.
-
-Then we create a \tkzNameObj{triangle} (line 11)
-
-|T.ABC = triangle: new (z.A,z.B,z.C)|
-
-Once the triangle has been created, you can either use its attributes or a method associated with the triangle object. In all cases, the result is either a number or a new object.
-
-In order to obtain the circle inscribed in this triangle, we use a method of the \tkzname{triangle}. We obtain a new object, a circle, which I call |C.Ii|. A circle is defined by its center and a point through which it passes. $I$ is the center and $i$ is the projection of this center on the side opposed to the first point of the triangle.
-
-There are several ways of obtaining these two points. As in the example, |get_points| is a function that extracts the points from the object given as an argument. You can also use the circle attributes: |z.I = C.Ii.center| and |z.i = CIi.through|. The first method is obviously simpler, but less explicit. Another possibility would be to obtain the center as an attribute of the triangle |z.I = T.ABC.incircle| and then project this center onto one of the sides, for example |z.i = T.ABC.bc : projection (z.I)|. An explanation is in order: |T.ABC.bc | is the straight line defined by the last two points of the triangle (see triangle attributes \ref{sec:classe_triangle}).
-
-Then we look for the circumscribed circle, which is obtained using a method of the triangle object. We define the circumscribed \tkzNameObj{circle} named |C.WA|.
-
-|C.WA = T.ABC : circum_circle ()| (line 16)
-
-| z.W,_ = get_points (C.WA)| is used to get the center but possible is
-
- |z.W = T.ABC.circumcircle|
-
-The south pole of the circle with center $W$ passing through $A$ is given by an attribute of the object \tkzNameObj{circle}.
-
-We finally look for the intersection of two lines.
-
-Line 17 an object line is created. Line 18 I name a line object already created (it's a triangle attribute).
-
-All points are defined and stored in the |z| table. The macro \tkzcname{tkzGetNodes} retrieves the keys and associated values from this table and creates the nodes to be used by \TIKZ\ or \pkg{tkz-euclide}.
-
-\begin{tkzexample}[small,code only,num]
-% !TEX TS-program = lualatex
-\documentclass{article}
-\usepackage{tkz-euclide}
-\usepackage{tkz-elements}
-\begin{document}
-
-\begin{tkzelements}
- z.A = point: new (2 , 4)
- z.B = point: new (0 , 0)
- z.C = point: new (8 , 0)
- T.ABC = triangle: new (z.A,z.B,z.C)
- C.Ii = T.ABC: in_circle ()
- z.I,z.i = get_points (C.Ii)
- C.WA = T.ABC : circum_circle ()
- z.W,_ = get_points (C.WA)
- z.O = C.WA.south
- L.AO = line: new (z.A,z.O)
- L.BC = T.ABC.bc
- z.I_A = intersection (L.AO,L.BC)
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(W,A I,i)
- \tkzDrawArc(O,C)(B)
- \tkzDrawPolygon(A,B,C)
- \tkzDrawSegments[new](A,O B,O C,O)
- \tkzDrawLine(B,I)
- \tkzDrawPoints(A,B,C,I,I_A,W,O)
- \tkzFillAngles[green!20,opacity=.3](A,O,B A,C,B)
- \tkzFillAngles[teal!20,opacity=.3](O,B,C B,C,O B,A,O O,A,C)
- \tkzLabelPoints(I,I_A,W,B,C)
- \tkzLabelPoints[above](A)
-\end{tikzpicture}
-\end{document}
-\end{tkzexample}
-
-\begin{tkzelements}
- scale =.75
- z.A = point: new (2 , 4)
- z.B = point: new (0 , 0)
- z.C = point: new (8 , 0)
- T.ABC = triangle: new (z.A,z.B,z.C)
- C.Ii = T.ABC: in_circle ()
- z.I,z.i = get_points (C.Ii)
- C.WA = T.ABC : circum_circle ()
- z.W,_ = get_points (C.WA)
- z.O = C.WA.south
- L.AO = line: new (z.A,z.O)
- L.BC = T.ABC.bc
- z.I_A = intersection (L.AO,L.BC)
-\end{tkzelements}
-
-\hspace*{\fill}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawCircles(W,A I,i)
-\tkzDrawArc(O,C)(B)
-\tkzDrawPolygon(A,B,C)
-\tkzDrawSegments[new](A,O B,O C,O)
-\tkzDrawLine(B,I)
-\tkzDrawPoints(A,B,C,I,I_A,W,O)
-\tkzFillAngles[green!20,opacity=.3](A,O,B A,C,B)
-\tkzFillAngles[teal!20,opacity=.3](O,B,C B,C,O B,A,O O,A,C)
-\tkzLabelPoints(I,I_A,W,B,C,O)
-\tkzLabelPoints[above](A)
-\end{tikzpicture}
-\hspace*{\fill}
-% subsection environment_elements (end)
-
-\subsection{Fom Lua to tkz-euclide or TikZ} % (fold)
-\label{sub:fom_lua_to_tkz_euclide_or_tikz}
-
-\subsubsection{Points transfer} % (fold)
-\label{ssub:points_transfer}
-We use an environment \tkzname{tkzelements} outside an environment \tkzname{tikzpicture} which allows us to carry out all the necessary calculations, then we launch the macro \tkzcname{tkzGetNodes} which transforms the affixes of the table \tkzname{z} into a list of \tkzname{Nodes}. It only remains to draw.
-
-Currently the drawing program is either \TIKZ\ or \pkg{tkz-euclide}. You have the possibility to use another package to trace but for that you have to create a macro similar to \tkzcname{tkzGetNodes}. Of course, this package must be able to store the points as does \TIKZ\ or \pkg{tkz-euclide}.
-
-\vspace*{1em}
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\def\tkzGetNodes{\directlua{%
- for K,V in pairs(z) do
- local KS,n,sd,ft
- KS = tostring(K)
- n = string.len(KS)
- if n >1 then
- _,_,ft, sd = string.find( KS , "(.+)(.)" )
- if sd == "p" then K=ft.."'" end
- end
- tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\")
-end}
-}
-\end{tkzexample}
-
-The environment \tkzNameEnv{tkzelements} allows to use the underscore |_| and the macro \tkzcname{tkzGetNodes} allows to obtain names of nodes containing \tkzname{prime}. (see the next example)
-
-\begin{minipage}{0.5\textwidth}
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- scale = 1.2
- z.o = point: new (0,0)
- z.a_1 = point: new (2,1)
- z.a_2 = point: new (1,2)
- z.ap = z.a_1 + z.a_2
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawSegments(o,a_1 o,a_2 o,a')
- \tkzDrawSegments[red](a_1,a' a_2,a')
- \tkzDrawPoints(a_1,a_2,a',o)
- \tkzLabelPoints(o,a_1,a_2,a')
-\end{tikzpicture}
-\end{tkzexample}%
-\end{minipage}%
-\begin{minipage}{0.5\textwidth}
-\begin{tkzelements}
-scale = 1.2
-z.o = point: new (0,0)
-z.a_1 = point: new (2,1)
-z.a_2 = point: new (1,2)
-z.ap = z.a_1 + z.a_2
-\end{tkzelements}
-\begin{tikzpicture}
-\tkzGetNodes
- \tkzDrawSegments(o,a_1 o,a_2 o,a')
- \tkzDrawSegments[red](a_1,a' a_2,a')
- \tkzDrawPoints(a_1,a_2,a',o)
- \tkzLabelPoints(o,a_1,a_2,a')
-\end{tikzpicture}
-\end{minipage}%
-
-% subsection fom_lua_to_tkz_euclide_or_tikz (end)
-\subsubsection{Other transfers} % (fold)
-\label{ssub:other_transfers}
-
-Sometimes it's useful to transfer angle or length measurements. For this purpose, I have created the function (see \ref{ssub:transfer_from_lua_to_tex})
-\Igfct{package}{set\_lua\_to\_tex (list)}
-
-% subsubsection other_transfers (end)
-% subsubsection points_transfer (end)
-
-% section how_to_use (end)
-
-
-
-
-\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
new file mode 100644
index 0000000000..53646eb6c3
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
@@ -0,0 +1,702 @@
+\newpage
+
+\section{In-depth study} % (fold)
+\label{sec:in_depth_study}
+
+\subsection{The tables} % (fold)
+\label{sub:the_tables}
+
+\subsubsection{General tables} % (fold)
+\label{ssub:general_tables}
+Tables are the only data structure "container" integrated in Lua.
+ They are associative arrays which associates a key (reference or index) with a value in the form of a field (set) of key/value pairs. Moreover, tables have no fixed size and can grow based on our need dynamically.
+
+Tables are created using table constructors, the simplest of which is the use of braces, e.g. \{ \}. This defines an empty table.
+
+\begin{mybox}
+ \begin{verbatim}
+ F = {"banana", "apple", "cherry"}\end{verbatim}
+\end{mybox}
+
+
+print(F[2]) --> pomme
+
+
+qui peut être également définit par
+
+\begin{mybox}
+ \begin{verbatim}
+ FR = {[1] = "banana", [3] = "cherry", [2] = "apple"}\end{verbatim}
+\end{mybox}
+
+
+print(FR[3]) --> cherry
+
+FR[4]="orange"
+
+\begin{mybox}
+ \begin{verbatim}
+ print(#FR)
+ -- I for Index
+ for I,V in ipairs(FR) do
+ print(I,V)
+ end \end{verbatim}
+\end{mybox}
+
+1 banana\\
+2 apple\\
+3 cherry\\
+4 orange\\
+
+\begin{mybox}
+\begin{verbatim}
+C = {["banana"] = "yellow" , ["apple"] = "green" , ["cherry"] = "red" }
+C.orange = "orange"\end{verbatim}
+\end{mybox}
+
+\begin{mybox}
+\begin{verbatim}
+ for K,V in pairs (C) do
+ print(K,V)
+ end\end{verbatim}
+\end{mybox}
+
+banana = yellow
+cherry = red
+orange = orange
+apple = green
+% subsection the_tables (end)
+
+Another useful feature is the ability to create a table to store an unknown number of function parameters, for example:
+
+\begin{mybox}
+\begin{verbatim}
+ function ReturnTable (...)
+ return table.pack (...)
+ end \end{verbatim}
+\end{mybox}
+
+\begin{mybox}
+ \begin{verbatim}
+ function ParamToTable (...)
+ mytab = ReturnTable(...)
+ for i=1,mytab.n do
+ print(mytab[i])
+ end
+ end
+ ParamToTable("cherry","apple","orange") \end{verbatim}
+\end{mybox}
+
+
+Using tables with table[key] syntax:
+
+|C["banana"] and F[1] |
+
+But with string constants as keys we have the sugar syntax:
+C.banana but this syntax does not accept numbers.
+
+It's possible to erase a key/value pair from a table, with :
+
+\begin{mybox}
+\begin{verbatim}
+C.banana = nil \end{verbatim}
+\end{mybox}
+% subsubsection general_tables (end)
+
+\subsubsection{Table z} % (fold)
+\label{ssub:table_z}
+This is the most important table in the package. It stores all points and enables them to be transferred to \TIKZ{}.
+
+It is defined with |z = {}|, then each time we write
+
+\begin{mybox}
+ | z.name = point : new (a , b)|
+\end{mybox}
+
+a point object is stored in the table. The key is |name|, the value is an object. We have seen that |z.name.re = a| and that |z.name.im = b|.
+
+However, the elements of this table have essential properties.
+
+For example, if you wish to display an element, then |tex.print(tostring(z.name)) = a+ib| the |tostring| operation displays the affix corresponding to the point.
+
+In addition, we'll see that it's possible to perform operations with the elements of the |z| table.
+% subsubsection table_z (end)
+
+\subsection{Transferts} % (fold)
+\label{sub:transferts}
+
+We've seen (sous-section \ref{ssub:points_transfer}) that the macro \Imacro{tkzGetNodes} transfers point coordinates to \TIKZ. Let's take a closer look at this macro:
+
+\vspace*{1em}
+
+\begin{mybox}
+\begin{verbatim}
+\def\tkzGetNodes{\directlua{%
+ for K,V in pairs(z) do
+ local K,n,sd,ft
+ n = string.len(KS)
+ if n >1 then
+ _,_,ft, sd = string.find( K , "(.+)(.)" )
+ if sd == "p" then K=ft.."'" end
+ end
+ tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\")
+end}
+}\end{verbatim}
+\end{mybox}
+
+It consists mainly of a loop. The variables used are K (for keys) and V (for Values). To take pairs (key/value) from the |z| table, use the |pairs| function. K becomes the name of a node whose coordinates are |V.re| and |V.im|. Meanwhile, we search for keys with more than one symbol ending in |p|, in order to associate them with the symbol "'" valid in \TIKZ{}.
+% subsection transferts (end)
+
+\subsection{Complex numbers library and point} % (fold)
+\label{sub:complex_numbers}
+
+Unless you want to create your own functions, you won't need to know and use complex numbers. However, in some cases it may be useful to implement some of their properties.
+
+
+|z.A = point : new (1,2 )| and \ |z.B = point : new (1,-1)| define two affixes which are $z_A = 1+2i$ and $z_B = 1-i$. Note the difference in notations |z.A| and $z_A$ for two distinct entities: a Lua object and an affix.
+
+\vspace{1em}
+If you want to use only complex numbers then you must choose the following syntax :|za =point (1,2)|.
+The difference between |z.A = point : new (1,2)| and |za = point (1,2)| is that the first function takes into account the scale. If |scale = 2| then $z_A = 2+4i$. In addition, the object referenced by A is stored in table |z| and not za.
+
+ The notation may come as a surprise, as I used the term "point". The aim here was not to create a complete library on complex numbers, but to be able to use their main properties in relation to points. I didn't want to have two different levels, and since a unique connection can be established between the points of the plane and the complexes, I decided not to mention the complex numbers! But they are there.
+
+
+\bgroup
+\catcode`_=12
+\small
+
+\begin{minipage}{\textwidth}
+\captionof{table}{Point or complex metamethods.}
+\begin{tabular}{lll}
+ \toprule
+ \textbf{Metamethods} & \textbf{Application} \\
+ \midrule
+__add(z1,z2) & |z.a + z.b| & affix \\
+__sub(z1,z2) & |z.a - z.b| & affix\\
+__unm(z) & |- z.a| & affix\\
+__mul(z1,z2) & |z.a * z.b| & affix\\
+__concat(z1,z2)& |z.a .. z.b| & dot product = real number \footnote{If $O$ is the origin of the complex plan, then we get the dot product of the vectors $\overrightarrow{Oa}$ and $\overrightarrow{Ob}$} \\
+__pow(z1,z2) & |z.a ^ z.b| & determinant = real number\\
+__div(z1,z2) & |z.a / z.b| & affix \\
+__tostring(z) & tex.print(tostring(z)) & displays the affix \\
+__tonumber(z) & tonumber(z) & affix or nil\\
+__eq(z1,z2) & eq (z.a,z.b) & boolean\\
+\bottomrule
+\end{tabular}
+\end{minipage}
+\egroup
+
+\bgroup
+\catcode`_=12
+\small
+\begin{minipage}{\textwidth}
+\captionof{table}{Point (complex) class methods.}
+\begin{tabular}{lll}
+ \toprule
+\textbf{Methods} & \textbf{Application}\\
+\midrule
+\Imeth{point}{conj(z)} & |z.a : conj()| & affix (conjugate) \\
+\Imeth{point}{mod(z)} & |z.a : mod()| & real number = modulus |z.a|\\
+\Imeth{point}{abs (z)} & |z.a : abs()| & real number = modulus \\
+\Imeth{point}{norm (z)} & |z.a : norm()| & norm (real number ) \\
+\Imeth{point}{arg (z)}. & |z.a : arg()| & real number = argument of z.a (in rad)\\
+\Imeth{point}{get(z)} & |z.a : get()| & re and im (two real numbers ) \\
+\Imeth{point}{sqrt(z)}. & |z.a : sqrt()| & affix \\
+\bottomrule
+\end{tabular}
+\end{minipage}
+\egroup
+
+\vspace{1em}
+The class is provided with two specific metamethods.
+
+\begin{itemize}
+ \item Since concatenation makes little sense here, the operation associated with |..| is the scalar or dot product. If |z1 = a+ib| and |z2 = c+id| then
+
+ |z1..z2 = (a+ib) .. (c+id) = (a+ib) (c-id) = ac+bd + i(bc-ad) |
+
+ There's also a mathematical function, |dot_product|, which takes three arguments. See example \ref{ssub:dot_or_scalar_product}
+
+
+ \item With the same idea, the operation associated with |^| is the determinant i.e.
+
+ |z1 ^ z2 = (a+ib) ^ (c+id) = ad - bc From (a-ib) (c+id) = ac+bd + i(ad - bc)| we take the imaginary part.
+
+\end{itemize}
+
+\subsubsection{Example of complex use} % (fold)
+\label{ssub:example_of_complex_use}
+Let |za = math.cos(a) + i math.sin(a)| .
+This is obtained from the library by writing
+
+\begin{mybox}
+ |za = point(math.cos(a),math.sin(a))|.
+\end{mybox}
+
+Then |z.B = z.A * za| describes a rotation of point A by an angle |a|.
+
+\begin{minipage}{.6\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.O = point : new (0,0)
+ z.A = point : new (1,2)
+ a = math.pi/6
+ za = point(math.cos(a),math.sin(a))
+ z.B = z.A * za
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPoints(O,A,B)
+ \tkzDrawArc[->,delta=0](O,A)(B)
+ \tkzDrawSegments[dashed](O,A O,B)
+ \tkzLabelAngle(A,O,B){$\pi/6$}
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+\begin{tkzelements}
+ scale=2
+ z.O = point : new (0,0)
+ z.A = point : new (1,2)
+ a = math.pi/6
+ za = point(math.cos(a),math.sin(a))
+ z.B = z.A * za
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPoints(O,A,B)
+\tkzDrawArc[->,delta=0,thick](O,A)(B)
+\tkzDrawSegments[dashed](O,A O,B)
+\tkzLabelAngle(A,O,B){$\pi/6$}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection example_of_complex_use (end)
+
+\subsubsection{Point operations(complex)} % (fold)
+\label{ssub:point_operations_complex}
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.o = point: new(0,0)
+ z.a = point: new(1,-1)
+ z.b = point: new(2,1)
+ z.bp = -z.b
+ z.c = z.a + z.b
+ z.d = z.a - z.b
+ z.e = z.a * z.b
+ z.f = z.a / z.b
+ z.ap = point.conj (z.a)
+ -- = z.a : conj ()
+ z.g = z.b* point(math.cos(math.pi/2),
+ math.sin(math.pi/2))
+\end{tkzelements}
+
+\hspace*{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzInit[xmin=-2,xmax=3,ymin=-2,ymax=3]
+ \tkzGrid
+ \tkzDrawSegments(o,a o,b o,c o,e o,b' o,f o,g)
+ \tkzDrawSegments[red](a,c b,c b',d a,d)
+ \tkzDrawPoints(a,...,g,o,a',b')
+ \tkzLabelPoints(o,a,b,c,d,e,f,g,a',b')
+\end{tikzpicture}
+\end{verbatim}
+ \end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+ z.o = point: new(0,0)
+ z.a = point: new(1,-1)
+ z.b = point: new(2,1)
+ z.bp = -z.b
+ z.c = z.a + z.b
+ z.d = z.a - z.b
+ z.e = z.a * z.b
+ z.f = z.a / z.b
+ z.ap = point.conj (z.a)
+ -- = z.a : conj ()
+ z.g = z.b* point(math.cos(math.pi/2),math.sin(math.pi/2))
+\end{tkzelements}
+
+\hspace*{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzInit[xmin=-2,xmax=3,ymin=-2,ymax=3]
+ \tkzGrid
+ \tkzDrawSegments(o,a o,b o,c o,e o,b' o,f o,g)
+ \tkzDrawSegments[red](a,c b,c b',d a,d)
+ \tkzDrawPoints(a,...,g,o,a',b')
+ \tkzLabelPoints(o,a,b,c,d,e,f,g,a',b')
+\end{tikzpicture}
+\end{minipage}
+% subsubsection point_operations_complex (end)
+% subsection complex_numbers (end)
+
+
+\subsection{Barycenter} % (fold)
+\label{sub:barycenter}
+
+\begin{minipage}{.8\textwidth}
+ Here's the definition of the barycenter, which is used some forty times in the package.
+|table.pack| builds a table from a list. \\
+|tp.n| gives the number of pairs. \\
+|tp[i][1]| is an affix and |tp[i][2]| the associated weight (real value). 5se the example.
+
+\begin{verbatim}
+ function barycenter_ (...)
+ local tp = table.pack(...)
+ local i
+ local sum = 0
+ local weight=0
+ for i=1,tp.n do
+ sum = sum + tp[i][1]*tp[i][2]
+ weight = weight + tp[i][2]
+ end
+ return sum/weight
+ end
+\end{verbatim}
+\end{minipage}
+
+\vspace{1em}
+\subsubsection{Using the barycentre} % (fold)
+\label{ssub:using_the_barycentre}
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point: new (1,0)
+ z.B = point: new (5,-1)
+ z.C = point: new (2,5)
+ z.G = barycenter ({z.A,3},{z.B,1},{z.C,1})
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,G)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}\begin{tkzelements}
+ z.A = point: new (1,0)
+ z.B = point: new (5,-1)
+ z.C = point: new (2,5)
+ z.G = barycenter ({z.A,3},{z.B,1},{z.C,1})
+\end{tkzelements}
+ \hspace{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,G)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection using_the_barycentre (end)
+
+\subsubsection{Incenter of a triangle} % (fold)
+\label{ssub:incenter_of_a_triangle}
+The calculation of the weights ka, kb and kc is precise, and the result obtained with the barycenter is excellent. Note the presence of the underscore \_ for certain functions. These functions are internal (developer). Each external (user) function is associated with its internal counterpart.
+
+Here's how to determine the center of the inscribed circle of a triangle:
+\begin{mybox}
+ \begin{verbatim}
+ function in_center_ ( a,b,c )
+ local ka = point.abs (b-c)
+ local kc = point.abs (b-a)
+ local kb = point.abs (c-a)
+ return barycenter_ ( {a,ka} , {b,kb} , {c,kc} )
+ end \end{verbatim}
+\end{mybox}
+
+% subsubsection incenter_of_a_triangle (end)
+% subsection barycenter (end)
+
+\subsection{Loop and table notation} % (fold)
+\label{sub:loop_and_table_notation}
+The problem encountered in this example stems from the notation of the point names. Since it's not possible to write in simplified form, we have to resort to table[key] notation.
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ local r = 3
+ z.O = point : new (0,0)
+ max = 100
+ for i = 1,max
+ do
+ z["A_"..i] = point : polar(r,2*i*math.pi/max)
+ end
+ a = math.deg(get_angle (z.O,z.A_1,z.A_2))
+\end{tkzelements}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+ local r = 3
+ z.O = point : new (0,0)
+ max = 100
+ for i = 1,max
+ do
+ z["A_"..i] = point : polar(r,2*i*math.pi/max)
+ end
+ a = math.deg(get_angle (z.O,z.A_1,z.A_2))
+\end{tkzelements}
+\hspace{\fill}
+\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{minipage}
+
+% subsection loop_and_table_notation (end)
+
+\subsection{In\_out method} % (fold)
+\label{sub:in_out_method}
+
+This function can be used for the following objects
+\begin{itemize}
+ \item line
+ \item circle
+ \item triangle
+ \item ellipse
+\end{itemize}
+ The disk object doesn't exist, so with |in\_out\_disk| it's possible to determine whether a point is in a disk.
+
+\subsubsection{In\_out for a line} % (fold)
+\label{ssub:in_out_for_a_line}
+
+\begin{mybox}
+ \begin{verbatim}
+ function line: in_out (pt)
+ local sc,epsilon
+ epsilon = 10^(-12)
+ sc = math.abs ((pt-self.pa)^(pt-self.pb))
+ if sc <= epsilon
+ then
+ return true
+ else
+ return false
+ end
+ end \end{verbatim}
+\end{mybox}
+
+The \tkzNamePack{ifthen} package is required for the code below.
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+z.A = point: new (0,0)
+z.B = point: new (1,2)
+z.X = point: new (2,4.000)
+z.Y = point: new (2,4.1)
+L.AB = line : new (z.A,z.B)
+if L.AB : in_out (z.X)
+ then
+ inline = true k = (z.X-z.A)/(z.B-z.A)
+ else
+ inline = false
+ end
+ inline_bis = L.AB : in_out (z.Y)
+\end{tkzelements}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPoints(A,B,X,Y)
+\tkzLabelPoints(A,B,X)
+\tkzLabelPoints[left](Y)
+\ifthenelse{\equal{\tkzUseLua{inline}}{true}}{
+ \tkzDrawSegment[red](A,B)
+ \tkzLabelSegment(A,B){AX/AB = $\tkzUseLua{k}$}}{%
+ \tkzDrawSegment[blue](A,B)}
+\ifthenelse{\equal{\tkzUseLua{inline_bis}}{false}}{%
+ \tkzDrawSegment[green](B,Y)}{}
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+z.A = point: new (0,0)
+z.B = point: new (1,2)
+z.X = point: new (2,4.000)
+z.Y = point: new (2,4.1)
+L.AB = line : new (z.A,z.B)
+if L.AB : in_out (z.X)
+ then
+ inline = true k = (z.X-z.A)/(z.B-z.A)
+ else
+ inline = false
+ end
+ inline_bis = L.AB : in_out (z.Y)
+\end{tkzelements}
+\hspace{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPoints(A,B,X,Y)
+\tkzLabelPoints(A,B,X)
+\tkzLabelPoints[left](Y)
+\ifthenelse{\equal{\tkzUseLua{inline}}{true}}{
+ \tkzDrawSegment[red](A,B)
+ \tkzLabelSegment(A,B){AX/AB = $\tkzUseLua{k}$}}{%
+ \tkzDrawSegment[blue](A,B)}
+\ifthenelse{\equal{\tkzUseLua{inline_bis}}{false}}{
+\tkzDrawSegment[green](B,Y)}{}
+\end{tikzpicture}
+\end{minipage}
+% subsubsection in_out_for_a_line (end)
+% subsection in_out_method (end)
+
+
+\subsection{Determinant and dot product} % (fold)
+\label{sub:determinant_et_produit_scalaire}
+
+\subsubsection{Determinant} % (fold)
+\label{ssub:determinant}
+
+We've just seen how to use |^| to obtain the determinant associated with two vectors.
+
+\Imeth{line}{in\_out} is simply a copy of \Imeth{math}{islinear} .
+
+Here's the definition and transformation of the power of a complex number.
+
+\begin{verbatim}
+ -- 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)
+ return z.im
+ end
+\end{verbatim}
+% subsubsection determinant (end)
+
+
+\subsubsection{Dot product} % (fold)
+\label{ssub:scalar_product}
+
+Here's the definition of the dot product between two affixes and the concatenation transformation.
+
+\begin{verbatim}
+-- 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)
+ return z.re
+end
+\end{verbatim}
+% subsubsection scalar_product (end)
+
+
+
+\subsubsection{Dot product: orthogonality test } % (fold)
+\label{ssub:scalar_product_orthogonality_test}
+
+Here's a function \Imeth{math}{isortho} to test orthogonality between two vectors.
+
+\begin{verbatim}
+function isortho (z1,z2,z3)
+ local epsilon
+ local dp
+ epsilon = 10^(-8)
+ dp = (z2-z1) .. (z3-z1)
+ if math.abs(dp) < epsilon
+ then
+ return true
+ else
+ return false
+ end
+end
+\end{verbatim}
+% subsubsection scalar_product_orthogonality_test (end)
+
+
+\subsubsection{Dot product: projection} % (fold)
+\label{ssub:scalar_product_projection}
+
+The projection of a point onto a straight line is a fundamental function, and its definition is as follows:
+
+\begin{verbatim}
+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
+end
+\end{verbatim}
+
+The function \Imeth{math}{aligned} is equivalent to \Imeth{math}{islinear} but does not use a determinant. It will be replaced in a future version.
+
+% subsubsection scalar_product_projection (end)
+% subsection determinant_et_produit_scalaire (end)
+
+\subsection{Point method} % (fold)
+\label{sub:point_method}
+
+The point method is a method for many objects:
+\begin{itemize}
+ \item line ,
+ \item circle,
+ \item ellipse,
+ \item triangle.
+\end{itemize}
+
+You obtain a point on the object by entering a real number between 0 and 1.
+
+\begin{minipage}{.5\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 2 )
+ z.C = point : new ( 1 , 3 )
+ L.AB = line : new (z.A,z.B)
+ C.AB = circle : new (z.A,z.B)
+ T.ABC = triangle : new (z.A,z.B,z.C)
+ z.I = L.AB : point (0.5)
+ z.J = C.AB : point (0.5)
+ z.K = T.ABC : point (0.5)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawline(A,B)
+ \tkzDrawCircle(A,B)
+ \tkzDrawPolygon(A,B,C)
+ \tkzDrawPoints(A,B,C,I,J,K)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+ scale =.75
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 2 )
+ z.C = point : new ( 1 , 3 )
+ L.AB = line : new (z.A,z.B)
+ C.AB = circle : new (z.A,z.B)
+ T.ABC = triangle : new (z.A,z.B,z.C)
+ z.I = L.AB : point (0.5)
+ z.J = C.AB : point (0.5)
+ z.K = T.ABC : point (0.5)
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLine(A,B)
+\tkzDrawCircle(A,B)
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,I,J,K)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection point_method (end)
+
+% section in_depth_study (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
index cab5aa7aeb..f632238e45 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
@@ -61,7 +61,7 @@ end
\end{tikzpicture}
\end{minipage}
-Other examples: \ref{ssub:altshiller}, \ref{ssub:lemoine}, \ref{sub:alternate}, \ref{sub:environment_elements}
+Other examples: \ref{ssub:altshiller}, \ref{ssub:lemoine}, \ref{sub:alternate}
% subsection line_line (end)
\newpage
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
index 202ff31ba7..6540ebffaf 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
@@ -1,6 +1,6 @@
% !TEX TS-program = lualatex
% encoding : utf8
-% Documentation of tkz-elements v1.00b
+% Documentation of tkz-elements v1.40c
% Copyright 2023 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{1.20b}
+\gdef\tkzversionofpack{1.40c}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{tkz-elements.pdf}
-\gdef\tkzversionofdoc{1.20b}
+\gdef\tkzversionofdoc{1.40c}
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
@@ -41,12 +41,14 @@
\usepackage{tkz-elements}
\usepackage{pgfornament}
\usetikzlibrary{backgrounds}
+\usetikzlibrary{mindmap}
+\usetikzlibrary{shapes.multipart}
\usepackage[colorlinks,pdfencoding=auto, psdextra]{hyperref}
\hypersetup{
linkcolor=Gray,
citecolor=Green,
filecolor=Mulberry,
- urlcolor=NavyBlue,
+ urlcolor=orange,
menucolor=Gray,
runcolor=Mulberry,
linkbordercolor=Gray,
@@ -89,12 +91,21 @@
\usepackage[math-style=literal,bold-style=literal]{unicode-math}
\usepackage{fourier-otf}
\let\rmfamily\ttfamily
-\usepackage{multicol,lscape}
+\usepackage{multicol,lscape,wrapfig}
\usepackage[english]{babel}
\usepackage[normalem]{ulem}
\usepackage{multirow,multido,booktabs,cellspace}
-\usepackage{shortvrb,bookmark}
+\usepackage{shortvrb,bookmark,caption}
\usepackage{makeidx}
+\usepackage[most]{tcolorbox}
+
+\newtcolorbox{mybox}{
+enhanced,
+boxrule=0pt,frame hidden,
+borderline west={4pt}{0pt}{darkgray!50!white},
+colback=lightgray!10!white,
+sharp corners
+}
%\usepackage{float}
\makeindex
@@ -123,10 +134,13 @@
\newcommand*{\Iattr}[2]{\texttt{#2}\index{#1_3@\texttt{#1: attribute}!\texttt{#2}}}
\newcommand*{\Imeth}[2]{\texttt{#2}\index{#1_3@\texttt{#1: method}!\texttt{#2}}}
\newcommand*{\Igfct}[2]{\texttt{#2}\index{#1_3@\texttt{#1: function}!\texttt{#2}}}
-\newcommand*{\Iclass}[2]{\texttt{#2}\index{#1_3@\texttt{#1: class}!\texttt{#2}}}
+\newcommand*{\Iclass}[1]{\texttt{#1}\index{Class !#1@\texttt{#1}}}
\newcommand*{\tkzNameObj}[1]{\tkzname{#1}\Iobj{#1}}
\newcommand*{\Iobj}[1]{\index{Object_1@\texttt{Object}!\texttt{#1}}}
-
+\newcommand*{\tkzRBomb}{\textcolor{red}{\bomb}}
+\newcommand*{\IEmacro}[1]{\index{#1_1@\texttt{\textbackslash#1}}\texttt{#1}}
+\newcommand*{\tkzimpbf}[1]{\texttt{\textbf{#1}}}
+\newcommand*{\tkzEHand}{\textcolor{red}{\lefthand}}
%<--------------------------------------------------------------------------->
% settings styles
\tkzSetUpColors[background=white,text=black]
@@ -141,6 +155,15 @@
\tikzset{new/.style={color=orange,line width=.2pt}}
\def\tkzar{\hspace{1em}-->\hspace{1em}}
+\makeatletter\let\percentchar\@percentchar\makeatother
+\def\luaveclen#1#2{%
+\directlua{tex.print(string.format(
+'\percentchar.5f',math.sqrt((#1)*(#1)+(#2)*(#2))))
+}}
+% printnumber
+
+\let\pmpn\pgfmathprintnumber
+
\AtBeginDocument{\MakeShortVerb{\|}} % link to shortvrb
\begin{document}
@@ -179,18 +202,25 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
\clearpage
\newpage
-
+\input{TKZdoc-elements-structure.tex}
+\input{TKZdoc-elements-why.tex}
\input{TKZdoc-elements-presentation.tex}
\input{TKZdoc-elements-convention.tex}
-\input{TKZdoc-elements-howtouse.tex}
+\input{TKZdoc-elements-transferts.tex}
\input{TKZdoc-elements-classes.tex}
\input{TKZdoc-elements-classes-point.tex}
\input{TKZdoc-elements-classes-line.tex}
\input{TKZdoc-elements-classes-circle.tex}
\input{TKZdoc-elements-classes-triangle.tex}
\input{TKZdoc-elements-classes-ellipse.tex}
+\input{TKZdoc-elements-classes-quadrilateral.tex}
+\input{TKZdoc-elements-classes-square.tex}
+\input{TKZdoc-elements-classes-rectangle.tex}
+\input{TKZdoc-elements-classes-parallelogram.tex}
+\input{TKZdoc-elements-classes-regular.tex}
\input{TKZdoc-elements-classes-misc.tex}
\input{TKZdoc-elements-intersection.tex}
+\input{TKZdoc-elements-indepthstudy.tex}
\input{TKZdoc-elements-examples.tex}
\clearpage\newpage
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
index d837d4a826..900bdef5e6 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
@@ -1,44 +1,84 @@
+\newpage
\section{Presentation}
-I created \pkg{tkz-euclide} to give math teachers and students a tool to draw Euclidean geometry figures. This package was created as an interface based on \pkg{TikZ}, itself based on \TEX{}. The only problem encountered with this method is, in complicated cases, the lack of precision of the calculations made by \TEX{}.
-
-To remedy this lack of precision, I first introduced the package \pkg{fp}, then the package \pkg{xfp}. Lately, with the arrival of lua\LATEX{}, I have been able to add a \tkzname{Lua} option whose goal was to perform some calculations with \tkzname{Lua}. It is much easier to program mathematics with \tkzname{Lua} than with \TEX{} so having prepared \pkg{tkz-euclide}, by separating the first parts of definitions and calculations from the drawing part, the idea of carrying out the first parts with only \tkzname{Lua} was necessary.
-
-I had received some examples of programming with \tkzname{Lua} from Nicolas Kisselhoff and I took many of his ideas.
-
-The essential principles of figure construction with \tkzname{tkz-euclide} are kept: definition, calculations, tracings, labels as well as the step-by-step programmation, corresponding to a construction with a ruler and a compass.
-
-Then, I read an article by Roberto Giacomelli on object programming based on the \tkzname{Lua} and \TIKZ\ tools. This was my second source of inspiration. Not only could the programming be done step-by-step, but the introduction of objects allowed the link between the code and the geometry. The code becomes more readable, the code is more explicit and better structured but it is less concise. Finally, as the problem of precision disappeared, I came to appreciate more and more what I was getting with object programming. So I've tried to develop this programming as much as possible.
-
-In order to organize and maintain all the functions and methods, I chose to use classes of objects whose main ones are \tkzname{point}, \tkzname{line}, \tkzname{triangle}, \tkzname{circle} and \tkzname{ellipse}.
-
\subsection{With Lua} % (fold)
\label{sub:with_lua}
The purpose of tkz-elements is simply to calculate dimensions and define points. This is done in Lua. You can think of tkz-elements as a kernel that will be used either by tkz-euclide or by TikZ, see MetaPost.
Definitions and calculations are done inside the environment \tkzNameEnv{tkzelements}, this environment is based on \tkzNameEnv{luacode}.
-To improve precision, if it's necessary to modify the scale of your figure, it's best to change the "scale" variable at the start of the code placed in environment \tkzNameEnv{tkzelements}.
-Then we need to be able to transfer the coordinates of the points to a package that can use them, in this case tkz-euclide or TikZ.
+
+\begin{minipage}[t]{.52\textwidth}\vspace{0pt}%
+ The key points are:
+ \begin{itemize}
+ \item the source file must be \tkzEHand\ {\color{red}\uline{ \color{black}utf8}} encoded;
+ \item compilation is done with \tkzEHand\ {\color{red}\uline{ \color{black}Lua\LATEX{}}};
+ \item you need to load \tkzimp{\TIKZ}{} ou \tkzimp{tkz-euclide} and \tkzimp{tkz-elements};
+ \item definitions and calculations are performed in an orthonormal sytem of reference, using Lua, and are carried out in an environment of \tkzimp{tkzelements}.
+ \end{itemize}
+
+ To the right, see the minimum template.
+
+The code is divided into two parts, which are two environments \tkzNameEnv{tkzelements} and \tkzNameEnv{tikzpicture}. In the first environment, you place your Lua code, and in the second, tkz-euclide commands.
+
+\vspace*{4.1 cm}%
+\end{minipage}\hspace*{\fill}
+\begin{minipage}[t]{.45\textwidth}\vspace{0pt}%
+\begin{mybox}
+\begin{verbatim}
+% !TEX TS-program = lualatex
+% Created by Alain Matthes
+\documentclass{standalone}
+\usepackage{tkz-euclide}
+% or simply TikZ
+\usepackage{tkz-elements}
+begin{document}
+
+\begin{tkzelements}
+ scale = 1
+% definition of some points
+z.A = point : new ( , )
+z.B = point : new ( , )
+
+ ...code...
+\end{tkzelements}
+
+\begin{tikzpicture}
+% point transfer to Nodes
+\tkzGetNodes
+
+\end{tikzpicture}
+\end{document}
+\end{verbatim}
+\end{mybox}
+\end{minipage}
% subsection with_lua (end)
-\subsection{The main process : from tkz-elements (lua) to tkz-euclide (TikZ) with Lua\LaTeX.} % (fold)
+\subsection{The main process} % (fold)
\label{sub:the_main_process}
+\tikzset{concept/.append style={fill={none}}}
+\tikzset{root concept/.style= {minimum size=3cm,text width=2.8cm}}%
+\tikzset{level 1 concept/.append style={minimum size=4cm, font=\large, text width=3cm}}%
+\begin{tikzpicture}
+ \path[mindmap,concept color=orange,text=black]
+ node[concept] {Transfers\\\textcolor{orange}{ \textbackslash{tkzGetNodes}}}
+ child[concept color=red,grow=right] {
+ node[concept] {Drawings\\\textcolor{red}{tkz-euclide}\\\textcolor{red}{\TIKZ}} }
+ child[concept color=purple,grow=left] {
+ node[concept] {Definitions\\Calculations\\\textcolor{purple}{tkz-elements}} };
+\end{tikzpicture}
When all the points necessary for the drawing are obtained, they must be transformed into \tkzname{nodes} so that \pkg{TikZ} or \pkg{tkz-euclide} can draw the figure. This is done through the macro \tkzcname{tkzGetNodes}. This macro browse all the elements of the table |z| using the key (in fact the name of the point) and retrieves the values associated with it, i.e. the coordinates of the point (node).
-
-A point $A$ is defined and stored in tkz-elements as follows:
-|z.A| is an element of a table |z| which contains the coordinates of $A$ in the form of a complex number (very useful for calculations). Then a macro, \tkzcname{tkzGetNodes}, transforms all elements of table |z| into nodes usable by tkz-euclide or TikZ. For another package, you'll need to adapt \tkzcname{tkzGetNodes}.
-
% subsection the_main_process (end)
\newpage
\subsection{Complete example: Pappus circle} % (fold)
\label{sub:the_figure_pappus_circle}
-The figure:
+\subsubsection{The figure}
\begin{tkzelements}
+ scale = 1.2
z.A = point: new (0 , 0)
z.B = point: new (10 , 0)
L.AB = line: new ( z.A, z.B)
@@ -61,8 +101,7 @@ The figure:
z.P_0 = intersection (C.PC,C.AB)
z.P_1 = intersection (C.PC,C.AC)
_,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
+ z.O_3 = triangle: new ( z.P_0, z.P_1, z.P_2).circumcenter
\end{tkzelements}
\hspace*{\fill}
\begin{tikzpicture}
@@ -90,30 +129,26 @@ The figure:
\begin{document}
\begin{tkzelements}
- z.A = point: new (0 , 0)
- z.B = point: new (10 , 0)
- L.AB = line: new ( z.A, z.B)
- z.C = L.AB: gold_ratio ()
- L.AC = line: new ( z.A, z.C)
- L.CB = line: new ( z.C, z.B)
- L.AB = line: new ( z.A, z.B)
- z.O_0 = L.AB.mid
- z.O_1 = L.AC.mid
- z.O_2 = L.CB.mid
- C.AB = circle: new ( z.O_0, z.B)
- C.AC = circle: new ( z.O_1, z.C)
- C.CB = circle: new ( z.O_2, z.B)
- z.P = C.CB.north
- z.Q = C.AC.north
- z.O = C.AB.south
- z.c = z.C : north (2)
- C.PC = circle: new ( z.P, z.C)
- C.QA = circle: new ( z.Q, z.A)
- z.P_0 = intersection (C.PC,C.AB)
- z.P_1 = intersection (C.PC,C.AC)
- _,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
+z.A = point: new (0 , 0)
+z.B = point: new (10 , 0) creation of two fixed points $A$ and $B$
+L.AB = line: new ( z.A, z.B)
+z.C = L.AB: gold_ratio () use of a method linked to "line"
+z.O_0 = line: new ( z.A, z.B).mid midpoint of segment with an attribute of "line"
+z.O_1 = line: new ( z.A, z.C).mid objects are not stored and cannot be reused.
+z.O_2 = line: new ( z.C, z.B).mid
+C.AB = circle: new ( z.O_0, z.B) new object "circle" stored and reused
+C.AC = circle: new ( z.O_1, z.C)
+C.CB = circle: new ( z.O_2, z.B)
+z.P = C.CB.north "north" atrributes of a circle
+z.Q = C.AC.north
+z.O = C.AB.south
+z.c = z.C : north (2) "north" method of a point (needs a parameter)
+C.PC = circle: new ( z.P, z.C)
+C.QA = circle: new ( z.Q, z.A)
+z.P_0 = intersection (C.PC,C.AB) search for intersections of two circles.
+z.P_1 = intersection (C.PC,C.AC) idem
+_,z.P_2 = intersection (C.QA,C.CB) idem
+z.O_3 = triangle: new ( z.P_0, z.P_1, z.P_2).circumcenter attribute of "triangle"
\end{tkzelements}
\begin{tikzpicture}
@@ -131,37 +166,82 @@ The figure:
\end{tkzexample}
% subsubsection the_code (end)
-\subsubsection{Some explanations} % (fold)
-\label{ssub:some_explanations}
-
-Half of the code concerns the direct creation of objects (|point: new |, |circle: new | etc.)
-
-Then points are obtained using object attributes like |L.AB.mid| which determines the middle of the segment $[AB]$ or |C.AB.south| which allows to obtain the south pole of the circle with center $A$ passing through $B$.
-
-About the naming of objects, see the section \ref{sec:writing_convention}
-
-\begin{itemize}
- \item Lines 8 and 9 create two fixed points $A$ and $B$.
-
- \item Line 10 these two points are used to create the line.
-
- \item Line 11 the gold method creates a point $C$ which divides the segment $[AB]$ according to the golden ratio.
-
- \item Lines 12, 13 and 14 creation of 3 new lines.
-
-\item Lines 15, 16 and 17 creation of 3 points: the midpoints of the previous segments. These points are predefined and it is enough to use the attributes of the lines. Another possibility is to use the triangle T.ABC with the method : |medial_tr|
-
-\item Lines 18, 19 et 20 creation of three circles.
-
-\item Line 21 creation of the south pole $P$ of the circle of center C passing through B. It is also a predefined point and we still use an attribute.
+\subsection{Another example with comments: South Pole} % (fold)
+\label{sub:south_pole}
-\item Lines 22 and 23 we create two new poles: north and south for two other circles.
+Here's another example with comments
-\item Lines 24 and 25 creation of two circles.
+\begin{verbatim}
+% !TEX TS-program = lualatex
+\documentclass{standalone}
+\usepackage{tkz-euclide,tkz-elements}
+\begin{document}
+\begin{tkzelements} we create environment tkzelements
+ z.A = point: new (2 , 4) three fixed points are used
+ z.B = point: new (0 , 0)
+ z.C = point: new (8 , 0)
+ T.ABC = triangle: new (z.A,z.B,z.C) we create a new triangle object
+ 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
+ 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
+ L.AO = line: new (z.A,z.O) we create an object "line"
+ L.BC = T.ABC.bc we get the line (BC)
+ z.I_A = intersection (L.AO,L.BC) we search the intersection of the last lines
+\end{tkzelements}
+\end{verbatim}
+\begin{tkzelements}
+ scale = 1.2
+ z.A = point: new (2 , 4)
+ z.B = point: new (0 , 0)
+ z.C = point: new (8 , 0)
+ T.ABC = triangle: new (z.A,z.B,z.C)
+ C.ins = T.ABC: in_circle ()
+ z.I = C.ins.center
+ z.T = C.ins.through
+-- z.I,z.T = get_points (C.ins)
+ C.cir = T.ABC : circum_circle ()
+ z.W = C.cir.center
+ z.O = C.cir.south
+ L.AO = line: new (z.A,z.O)
+ L.BC = T.ABC.bc
+ z.I_A = intersection (L.AO,L.BC)
+\end{tkzelements}
-\item Lines 26 and 27 search for intersections of two circles.
+\hspace*{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles(W,A I,T)
+\tkzDrawArc(O,C)(B)
+\tkzDrawPolygon(A,B,C)
+\tkzDrawSegments[new](A,O B,O C,O)
+\tkzDrawLine(B,I)
+\tkzDrawPoints(A,B,C,I,I_A,W,O)
+\tkzFillAngles[green!20,opacity=.3](A,O,B A,C,B)
+\tkzFillAngles[teal!20,opacity=.3](O,B,C B,C,O B,A,O O,A,C)
+\tkzLabelPoints(I,I_A,W,B,C,O)
+\tkzLabelPoints[above](A)
+\end{tikzpicture}
+\hspace*{\fill}
-\item Lines 28 and 29 we use a triangle to search for its circum center.
-\end{itemize}
-% subsubsection some_explanations (end)
+Here's the tikzpicture environment to obtain the drawing:
+\begin{verbatim}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles(W,A I,T)
+\tkzDrawArc(O,C)(B)
+\tkzDrawPolygon(A,B,C)
+\tkzDrawSegments[new](A,O B,O C,O)
+\tkzDrawLine(B,I)
+\tkzDrawPoints(A,B,C,I,I_A,W,O)
+\tkzFillAngles[green!20,opacity=.3](A,O,B A,C,B)
+\tkzFillAngles[teal!20,opacity=.3](O,B,C B,C,O B,A,O O,A,C)
+\tkzLabelPoints(I,I_A,W,B,C,O)
+\tkzLabelPoints[above](A)
+\end{tikzpicture}
+\end{verbatim}
+% subsection south_pole (end)
\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-structure.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-structure.tex
new file mode 100644
index 0000000000..fe0f7091c5
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-structure.tex
@@ -0,0 +1,61 @@
+\section{Structure} % (fold)
+\label{sec:structure}
+\tkzNamePack{tkz-elements.sty} loads the \tkzNamePack{luacode} package, to create the \tkzNameEnv{tkzelements} environment based on the \tkzNameEnv{luacode} environment.
+
+The \tkzNameEnv{tkzelements} environment initializes scale to 1 and then deletes all the values in the various tables.
+
+The package defines the two macros |\tkzGetNodes| and |\tkzUseLua|.
+
+The package loads the file |tkz_elements_main.lua|. This file initialise all the tables that will be used by the modules in which the classes are defined.
+
+\begin{tikzpicture}[scale=.75]
+\begin{scope}
+\path[mindmap, concept color=MidnightBlue!60, text=white,text width=38mm,
+ level 1 concept/.append style={level distance=120mm,
+ sibling angle=72},
+ set angles for level/.style={level 2/.append style={
+ sibling angle=360/\the\tikznumberofchildren}},
+ level/.append style={set angles for level=2},
+ level 3 concept/.append style={level distance=20mm,
+ sibling angle=20},
+ L1/.style={level distance=45mm},
+ L2/.style={level distance=65mm,minimum size=2cm}]
+
+node[concept,circular drop shadow] {|tkz-elements.sty|} [clockwise from=10]
+ child[concept color=MidnightBlue!40,minimum size=16mm] {
+ node[concept,circular drop shadow] {|luacode|}
+}
+child[concept color= MidnightBlue!80,minimum size=4cm,text width=38mm,
+clockwise from=27] {
+ node[concept,circular drop shadow] {|tkz\_elements\_main|}
+ [clockwise from=0]
+ child[L2] { node[concept,circular drop shadow] {|Regular Polygon|} }
+ child[L2] { node[concept,circular drop shadow] {|Quadri\-lateral|} }
+ child[L2] { node[concept,circular drop shadow] {|Para\-llelogram|} }
+ child[L2] { node[concept,circular drop shadow] {|Rectangle|} }
+ child[L2] { node[concept,circular drop shadow] {|Matrix|} }
+ child[L2] { node[concept,circular drop shadow] {|Vector|} }
+ child[L2] { node[concept,circular drop shadow] {|Point|} }
+ child[L2] { node[concept,circular drop shadow] {|Line|} }
+ child[L2] { node[concept,circular drop shadow] {|Circle|} }
+ child[L2] { node[concept,circular drop shadow] {|Triangle|} }
+ child[L2] { node[concept,circular drop shadow] {|Ellipse|} }
+ child[L2] { node[concept,circular drop shadow] {|Square|} }
+};
+\end{scope}
+\end{tikzpicture}
+
+The current classes are (some are still inactive):
+\begin{itemize}
+ \item active : \Iclass{point} (z) ; \Iclass{line} (L) ; \Iclass{circle} (C) ; \Iclass{triangle} (T) ; \Iclass{ellipse} (E) ; \Iclass{quadrilateral} (Q) ; \Iclass{square} (S) ; \Iclass{rectangle} (R) ; \Iclass{parallelogram} (P) ; \Iclass{regular\_polygon} (RP).
+
+ \item inactive : matrix (M) ; vector (V).
+
+\end{itemize}
+
+If |name| is name of a class, you can find its definition in the file |tkz_elements_name.lua|.
+
+
+% section structure (end)
+
+
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
new file mode 100644
index 0000000000..8106fbd2e8
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
@@ -0,0 +1,145 @@
+
+\newpage
+\section{Transfers} % (fold)
+\label{sec:transfers}
+\subsection{Fom Lua to tkz-euclide or TikZ} % (fold)
+\label{sub:fom_lua_to_tkz_euclide_or_tikz}
+
+In this section, we'll look at how to transfer points, Booleans and numerical values.
+
+\subsubsection{Points transfer} % (fold)
+\label{ssub:points_transfer}
+We use an environment \tkzname{tkzelements} outside an environment \tkzname{tikzpicture} which allows us to carry out all the necessary calculations, then we launch the macro \Imacro{tkzGetNodes} which transforms the affixes of the table \tkzname{z} into \tkzname{Nodes}. It only remains to draw.
+
+Currently the drawing program is either \TIKZ\ or \pkg{tkz-euclide}. You have the possibility to use another package to trace but for that you have to create a macro similar to \tkzcname{tkzGetNodes}. Of course, this package must be able to store the points as does \TIKZ\ or \pkg{tkz-euclide}.
+
+\vspace*{1em}
+
+\begin{mybox}
+\begin{verbatim}
+\def\tkzGetNodes{\directlua{%
+ for K,V in pairs(z) do
+ local n,sd,ft
+ n = string.len(K)
+ if n >1 then
+ _,_,ft, sd = string.find( K , "(.+)(.)" )
+ if sd == "p" then K=ft.."'" end
+ end
+ tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\")
+end}
+}\end{verbatim}
+\end{mybox}
+See the section In-depth Study \ref{sec:in_depth_study} for an explanation of the previous code.
+
+The environment \tkzNameEnv{tkzelements} allows to use the underscore |_| and the macro \tkzcname{tkzGetNodes} allows to obtain names of nodes containing \tkzname{prime}. (see the next example)
+
+\begin{minipage}{0.5\textwidth}
+\begin{tkzexample}[latex=0cm,small,code only]
+\begin{tkzelements}
+ scale = 1.2
+ z.o = point: new (0,0)
+ z.a_1 = point: new (2,1)
+ z.a_2 = point: new (1,2)
+ z.ap = z.a_1 + z.a_2
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawSegments(o,a_1 o,a_2 o,a')
+ \tkzDrawSegments[red](a_1,a' a_2,a')
+ \tkzDrawPoints(a_1,a_2,a',o)
+ \tkzLabelPoints(o,a_1,a_2,a')
+\end{tikzpicture}
+\end{tkzexample}%
+\end{minipage}%
+\begin{minipage}{0.5\textwidth}
+\begin{tkzelements}
+scale = 1.2
+z.o = point: new (0,0)
+z.a_1 = point: new (2,1)
+z.a_2 = point: new (1,2)
+z.ap = z.a_1 + z.a_2
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+ \tkzDrawSegments(o,a_1 o,a_2 o,a')
+ \tkzDrawSegments[red](a_1,a' a_2,a')
+ \tkzDrawPoints(a_1,a_2,a',o)
+ \tkzLabelPoints(o,a_1,a_2,a')
+\end{tikzpicture}
+\end{minipage}%
+
+\newpage
+% subsection fom_lua_to_tkz_euclide_or_tikz (end)
+\subsubsection{Other transfers} % (fold)
+\label{ssub:other_transfers}
+
+Sometimes it's useful to transfer angle, length measurements or boolean. For this purpose, I have created the macro (see \ref{ssub:transfer_from_lua_to_tex})
+\IEmacro{tkzUseLua(value)}
+
+\begin{verbatim}
+\begin{tkzelements}
+ z.b = point: new (1,1)
+ z.a = point: new (4,2)
+ z.c = point: new (2,2)
+ z.d = point: new (5,2)
+ 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)
+\end{tkzelements}
+
+The intersection of the two lines lies at
+ a point whose affix is:\tkzUseLua{x}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPoints(a,...,d)
+ \ifthenelse{\equal{\tkzUseLua{bool}}{true}}{
+ \tkzDrawSegments[red](a,b c,d)}{%
+ \tkzDrawSegments[blue](a,b c,d)}
+ \tkzLabelPoints(a,...,d)
+\end{tikzpicture}
+\end{verbatim}
+
+ \begin{tkzelements}
+ 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)
+ \end{tkzelements}
+
+ The intersection of the two lines lies at
+ a point whose affix is: \tkzUseLua{x}
+
+\vspace{1em}
+\hspace{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzInit[xmin =-1,ymin=-1,xmax=6,ymax=3]
+ \tkzGrid\tkzAxeX\tkzAxeY
+ \tkzDrawPoints(a,...,d)
+ \ifthenelse{\equal{\tkzUseLua{bool}}{true}}{
+ \tkzDrawSegments[red](a,b c,d)}{%
+ \tkzDrawSegments[blue](a,b c,d)}
+ \tkzLabelPoints(a,...,d)
+ \end{tikzpicture}
+ \hspace{\fill}
+
+
+
+% subsubsection other_transfers (end)
+% subsubsection points_transfer (end)
+
+% section transferts (end)
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
new file mode 100644
index 0000000000..e76340cbd0
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
@@ -0,0 +1,207 @@
+\newpage
+\section{Why tkz-elements?} % (fold)
+\label{sec:why_tkz_elements}
+
+\subsection{Calculation accuracy} % (fold)
+\label{sub:calculation_accuracy}
+
+\subsubsection{Calculation accuracy in \TIKZ} % (fold)
+\label{ssub:calculation_accuracy_in_tikz}
+
+With \TIKZ, \tkzimp{|veclen(x,y)|} calculates the expression $\sqrt{x^2+y^2}$.
+This calculation is obtained using a polynomial approximation, based on ideas from \tkzimp{Rouben Rostamian}.
+
+\pgfkeys{/pgf/number format/.cd,std,precision=5} \pgfmathparse{veclen(65,72)}
+\begin{mybox}{}
+\begin{verbatim}
+ pgfmathparse{veclen(65,72)} \pgfmathresult
+\end{verbatim}
+\end{mybox}
+
+ \tkzHand $\sqrt{65^2+72^2} \approx \pmpn{\pgfmathresult} $ \tkzRBomb.
+% subsubsection calculation_accuracy_in_tikz (end)
+
+\subsubsection{Calculation accuracy in Lua} % (fold)
+\label{ssub:calculation_accuracy_in_lua}
+
+A |luaveclen| macro can be defined as follows:
+
+\begin{mybox}{}
+\begin{verbatim}
+\def\luaveclen#1#2{\directlua{tex.print(string.format(
+'\percentchar.5f',math.sqrt((#1)*(#1)+(#2)*(#2))))}}
+\end{verbatim}
+\end{mybox}
+
+and
+
+\begin{mybox}
+\begin{verbatim}
+\luaveclen{65}{72}
+\end{verbatim}
+\end{mybox}
+
+gives
+\tkzHand $\sqrt{65^2+72^2} = \pmpn{\luaveclen{65}{72}} $ {\color{red}!!}
+
+The error isn't important if it's a hundredth of a \tkzimp{pt} for the placement of an object on a page, but it's unpleasant for the result of a calculation in a mathematical demonstration. What's more, these inaccuracies can combine to produce erroneous constructions.
+
+\vspace{.5em}
+To remedy this lack of precision, I first introduced the package \pkg{fp}, then the package \pkg{xfp}. Lately, with the arrival of lua\LATEX{}, I have been able to add a \tkzname{Lua} option whose goal was to perform some calculations with \tkzname{Lua}.
+
+This was the primary reason for creating the package, the second being the introduction of object-oriented programming and easier programming with Lua. Object-oriented programming (oop) convinced me to further develop all the possibilities this method offered.
+
+At that moment, I had received some examples of programming with \tkzname{Lua} from {\tkzimpbf{Nicolas Kisselhoff}}, but I didn't understand its code, so I had to patiently study Lua. Finally, I was able to build tkz-elements, I took many of his ideas I've adapted.
+
+
+% subsubsection calculation_accuracy_in_lua (end)
+\subsubsection{Using objects} % (fold)
+\label{ssub:using_objects}
+
+Then, I read an article\footnote{\href{https://www.guitex.org/home/images/meeting2012/slides/presentazione_giacomell_guitmeeting_2012.pdf}{Grafica ad oggetti con LuaTEX}} by \tkzimpbf{Roberto Giacomelli} on object programming based on the \tkzname{Lua} and \TIKZ\ tools. This was my second source of inspiration. Not only could the programming be done step-by-step, but the introduction of objects allowed the link between the code and the geometry. The code becomes more readable, more explicit and better structured.
+
+\subsubsection{Example: Apollonius circle} % (fold)
+\label{ssub:example_apollonius_circle}
+
+\begin{mybox}{Problem}
+The goal is to determine an inner tangent circle to the three exinscribed circles of a triangle.
+\end{mybox}
+
+See \href{https://mathworld.wolfram.com/ApolloniusCircle.html}{MathWorld} for more details.
+
+This example was my reference for testing the tkz-euclide package. With my first methods and the tools at my disposition, the results lacked precision. Now, with tkz-elements, I can use tools that are more powerful, more precise and easier to create.
+
+The essential principles of figure construction with \tkzname{tkz-euclide} are kept: definitions, calculations, tracings, labels as well as the step-by-step programmation, corresponding to a construction with a ruler and a compass.
+
+This is the version that uses the simplest construction method, made possible by Lua.
+
+\begin{mybox}
+\begin{verbatim}
+\begin{tkzelements}
+ scale = .4
+ z.A = point: new (0,0)
+ z.B = point: new (6,0)
+ z.C = point: new (0.8,4)
+ T.ABC = triangle : new ( z.A,z.B,z.C )
+ z.N = T.ABC.eulercenter
+ z.S = T.ABC.spiekercenter
+ T.feuerbach = T.ABC : feuerbach ()
+ z.Ea,z.Eb,z.Ec = get_points ( T.feuerbach )
+ T.excentral = T.ABC : excentral ()
+ z.Ja,z.Jb,z.Jc = get_points ( T.excentral )
+ C.JaEa = circle: new (z.Ja,z.Ea)
+ C.ortho = circle: radius (z.S,math.sqrt(C.JaEa: power(z.S)))
+ z.a = C.ortho.through
+ C.euler = T.ABC: euler_circle ()
+ 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}
+\end{verbatim}
+\end{mybox}
+
+The creation of an object encapsulates its attributes (its characteristics) and methods (i.e. the actions that are specific to it). It is then assigned a reference (a name), which is linked to the object using a table. The table is an associative array that links the reference called \tkzimp{key} to a \tkzimp{value}, in this case the object. These notions will be developed later.
+
+\tkzimp{T} is a table that associates the object \tkzimp{triangle} with the key \tkzimp{ABC}. \tkzimp{T.ABC} is also a table, and its elements are accessed using keys that are attributes of the triangle. These attributes have been defined in the package.
+
+\vspace{1em}
+\begin{mybox}
+\begin{verbatim}
+ z.N = T.ABC.eulercenter \end{verbatim}
+\end{mybox}
+
+|N| is the name of the point, |eulercenter| is an attribute of the triangle.
+\footnote{ The center of the Euler circle, or center of the nine-point circle, is a characteristic of every triangle.}
+
+\begin{mybox}
+\begin{verbatim}
+ T.excentral = T.ABC : excentral () \end{verbatim}
+\end{mybox}
+
+Here, \tkzimp{excentral} is a method linked to the \tkzimp{T.ABC }object. It defines the triangle formed by the centers of the exinscribed circles.
+
+Two lines are important. The first below shows that the excellent precision provided by Lua makes it possible to define a radius with a complex calculation. The radius of the radical circle is given by $\sqrt{\Pi(S,\mathcal{C}(Ja,Ea))}$ (square root of the power of point $S$ with respect to the exinscribed circle with center |Ja| passing through |Ea|).
+
+\begin{mybox}
+\begin{verbatim}
+ C.ortho = circle: radius (z.S,math.sqrt(C.JaEa: power(z.S)))\end{verbatim}
+\end{mybox}
+
+Finally, the inversion of the Euler circle with respect to the radical circle is the Apollonius circle\footnote{The nine-point circle, or Euler circle, is externally tangent to the three circles. The points of tangency form Feuerbach's triangle.}. The transformation has an object as parameter, which is recognized by its type (all objects are typed in the package), and the method determines which algorithm to use according to this type.
+
+\begin{mybox}
+\begin{verbatim}
+ C.apo = C.ortho : inversion (C.euler) \end{verbatim}
+\end{mybox}
+
+Now that all the points have been defined, it's time to start drawing the paths. To do this, you need to create the nodes. This is the role of the macro \Imacro{tkzGetNodes}. See \ref{ssub:points_transfer}
+
+The following section concerns only drawings, and is handled by tkz-euclide.
+
+\begin{verbatim}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzFillCircles[green!30](O,xa)
+ \tkzFillCircles[teal!30](Ja,Ea Jb,Eb Jc,Ec)
+ \tkzFillCircles[lightgray](S,a)
+ \tkzFillCircles[green!30](N,Ea)
+ \tkzDrawPoints(xa,xb,xc)
+ \tkzClipCircle(O,xa)
+ \tkzDrawLines[add=3 and 3](A,B A,C B,C)
+ \tkzDrawCircles(Ja,Ea Jb,Eb Jc,Ec S,a O,xa N,Ea)
+ \tkzDrawPoints(O,A,B,C,S,Ea,Eb,Ec,N)
+ \tkzDrawSegments[dashed](S,xa S,xb S,xc)
+ \tkzLabelPoints(O,N,A,B)
+ \tkzLabelPoints[right](S,C)
+\end{tikzpicture}
+\end{verbatim}
+
+\vspace{1em}
+\begin{tkzelements}
+ scale = .35
+ z.A = point: new (0,0)
+ z.B = point: new (6,0)
+ z.C = point: new (0.8,4)
+ T.ABC = triangle : new ( z.A,z.B,z.C )
+ z.N = T.ABC.eulercenter
+ z.S = T.ABC.spiekercenter
+ T.feuerbach = T.ABC : feuerbach ()
+ z.Ea,z.Eb,z.Ec = get_points ( T.feuerbach )
+ T.excentral = T.ABC : excentral ()
+ z.Ja,z.Jb,z.Jc = get_points ( T.excentral )
+ C.JaEa = circle: new (z.Ja,z.Ea)
+ C.ortho = circle: radius (z.S,math.sqrt(C.JaEa: power(z.S)))
+ z.a = C.ortho.through
+ C.euler = T.ABC: euler_circle ()
+ 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}
+\begin{minipage}{\textwidth}
+\hspace*{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzFillCircles[green!30](O,xa)
+ \tkzFillCircles[teal!30](Ja,Ea Jb,Eb Jc,Ec)
+ \tkzFillCircles[lightgray](S,a)
+ \tkzFillCircles[green!30](N,Ea)
+ \tkzDrawPoints(xa,xb,xc)
+ \tkzClipCircle(O,xa)
+ \tkzDrawLines[add=3 and 3](A,B A,C B,C)
+ \tkzDrawCircles(Ja,Ea Jb,Eb Jc,Ec S,a O,xa N,Ea)
+ \tkzDrawPoints(O,A,B,C,S,Ea,Eb,Ec,N)
+ \tkzDrawSegments[dashed](S,xa S,xb S,xc)
+ \tkzLabelPoints(O,N,A,B)
+ \tkzLabelPoints[right](S,C)
+\end{tikzpicture}
+\hspace*{\fill}
+\end{minipage}
+
+% subsubsection example_apollonius_circle (end)
+
+% subsubsection using_objects (end)
+
+% subsection calculation_accuracy (end)
+
+
+% section why_tkz_elements (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
index 0684fccc1f..cee54a9cfe 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
index 0816322b1b..788e9d0f39 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex
index 337c3f8cbe..61a1ea5583 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex
@@ -8,49 +8,42 @@
The Feuerbach triangle is the triangle formed by the three points of tangency of the nine-point circle with the excircles
\begin{tkzelements}
- scale = .5
- z.A = point: new (0,0)
- z.B = point: new (6,0)
- z.C = point: new (0.8,4)
- T.ABC = triangle : new (z.A,z.B,z.C)
- C.euler = T.ABC: euler_circle ()
- z.N,z.Ma = get_points (C.euler)
- z.I_a,z.I_b,z.I_c = get_points (T.ABC : excentral())
- z.Ea,z.Eb,z.Ec = get_points (T.ABC : feuerbach ())
- z.S,z.p = get_points (T.ABC : spieker_circle ())
- -- S spieker point is the radical center of the last three circles
- C.exa = T.ABC : ex_circle ()
- C.exb = T.ABC : ex_circle (1)
- C.exc = T.ABC : ex_circle (2)
- _,z.Xa = get_points (C.exa)
- _,z.Xb = get_points (C.exb)
- _,z.Xc = get_points (C.exc)
- L.fa = line : new (z.S,z.Ea)
- L.fb = line : new (z.S,z.Eb)
- L.fc = line : new (z.S,z.Ec)
- z.f_a = intersection (L.fa,C.exa)
- z.f_b = intersection (L.fb,C.exb)
- _,z.f_c = intersection (L.fc,C.exc)
- T = triangle : new ( z.f_a, z.f_b , z.f_c )
- z.o = T.circumcenter
- _,z.l = get_points (C.exa : orthogonal_from (z.S))
- -- S center of inversion !!
+ scale = .6
+ z.A = point: new (0,0)
+ z.B = point: new (6,0)
+ z.C = point: new (0.8,4)
+ T.ABC = triangle : new ( z.A,z.B,z.C )
+ z.N = T.ABC.eulercenter
+ z.S = T.ABC.spiekercenter
+ T.feuerbach = T.ABC : feuerbach ()
+ z.Ea,z.Eb,z.Ec = get_points ( T.feuerbach )
+ T.excentral = T.ABC : excentral ()
+ z.Ja,z.Jb,z.Jc = get_points ( T.excentral )
+ C.JaEa = circle: new (z.Ja,z.Ea)
+ C.ortho = circle: radius (z.S,math.sqrt(C.JaEa: power(z.S)))
+ z.a = C.ortho.through
+ C.euler = T.ABC: euler_circle ()
+ 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
\begin{tikzpicture}
-\tkzSetUpLine[ultra thin,color=teal]
-\tkzGetNodes
-\tkzDrawCircles[red](o,f_a N,Ma)
-\tkzDrawPoints[red](f_a,f_b,f_c,Ea,Eb,Ec,o,N)
-\tkzClipCircle(o,f_a)
-\tkzDrawLines[add=3 and 3](A,B A,C B,C)
-\tkzDrawCircles(I_a,Xa I_b,Xb I_c,Xc)
-\tkzDrawCircles[cyan](S,l)
-\tkzDrawPoints(A,B,C)
-\tkzDrawPoints[cyan](S)
-\tkzDrawSegments[dashed,red](S,f_a S,f_b S,f_c)
-\tkzDrawSegments[dashed,teal](o,f_a o,f_b o,f_c)
+ \tkzGetNodes
+ \tkzFillCircles[green!30](O,xa)
+ \tkzFillCircles[teal!30](Ja,Ea Jb,Eb Jc,Ec)
+ \tkzFillCircles[lightgray](S,a)
+ \tkzFillCircles[green!30](N,Ea)
+ \tkzDrawPoints(xa,xb,xc)
+ \tkzClipCircle(O,xa)
+ \tkzDrawLines[add=3 and 3](A,B A,C B,C)
+ \tkzDrawCircles(Ja,Ea Jb,Eb Jc,Ec S,a O,xa N,Ea)
+ \tkzDrawPoints(O,A,B,C,S,Ea,Eb,Ec,N)
+ \tkzDrawSegments[dashed](S,xa S,xb S,xc)
+ \tkzLabelPoints(O,N,A,B)
+ \tkzLabelPoints[right](S,C)
\end{tikzpicture}
\hfill
\end{document}
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
index 80a39af083..1a14660eaa 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
@@ -1,5 +1,5 @@
% encoding : utf8
-% tkz-elements v1.20b
+% tkz-elements.sty v1.40c
% Copyright 2023 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -11,38 +11,36 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\ProvidesPackage{tkz-elements}[2023/11/10 v1.20b Graphic Object Library]
+\ProvidesPackage{tkz-elements}[23/12/03 v1.40c Graphic Object Library]
\RequirePackage{luacode}
-\RequirePackage{filecontents}
\directlua{require "tkz_elements_main"}
\newenvironment{tkzelements}
{ \directlua{scale=1}
+ \directlua{indirect = true}
\directlua{for k,v in pairs(z) do z[k] = nil end}
- \directlua{for k,v in pairs(L) do L[k] = nil end}
\directlua{for k,v in pairs(C) do C[k] = nil end}
- \directlua{for k,v in pairs(T) do T[k] = nil end}
\directlua{for k,v in pairs(E) do E[k] = nil end}
- \luacode}
+ \directlua{for k,v in pairs(L) do L[k] = nil end}
+ \directlua{for k,v in pairs(P) do C[k] = nil end}
+ \directlua{for k,v in pairs(S) do E[k] = nil end}
+ \directlua{for k,v in pairs(R) do C[k] = nil end}
+ \directlua{for k,v in pairs(Q) do T[k] = nil end}
+ \directlua{for k,v in pairs(T) do T[k] = nil end}
+ \luacode}
{\endluacode}
+
\def\tkzGetNodes{\directlua{%
for K,V in pairs(z) do
- local KS,n,sd,ft
- KS = tostring(K)
- n = string.len(KS)
+ local n,sd,ft
+ n = string.len(K)
if n >1 then
- _,_,ft, sd = string.find( KS , "(.+)(.)" )
+ _,_,ft, sd = string.find( K , "(.+)(.)" )
if sd == "p" then K=ft.."'" end
end
tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\")
end}
}
-\def\tkzEraseTables{
- \directlua{for k,v in pairs(z) do z[k] = nil end}
- \directlua{for k,v in pairs(L) do L[k] = nil end}
- \directlua{for k,v in pairs(C) do C[k] = nil end}
- \directlua{for k,v in pairs(T) do T[k] = nil end}
- \directlua{for k,v in pairs(E) do E[k] = nil end}
-}
+
\def\tkzUseLua#1{\directlua{tex.print(tostring(#1))}}
\endinput
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
index 7af14e473c..bc3508a5aa 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
@@ -1,6 +1,6 @@
-- tkz_elements-circles.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -16,23 +16,28 @@
---------------------------------------------------------------------------
circle = {}
function circle: new (c, t) -- c --> center t --> through
- local type = 'circle'
- local radius = point.abs ( c - t )
- local south = c - point (0,radius)
- local east = c + point (radius,0)
- local north = c + point (0,radius)
- local west = c - point (radius,0)
- local new_circle = { center = c, through = t, radius = radius,
- south=south,east=east,north=north,west=west,type = type}
- setmetatable(new_circle, {__index = circle})
- return new_circle
+ local type = 'circle'
+ local radius = point.abs ( c - t )
+ local south = c - point (0,radius)
+ local east = c + point (radius,0)
+ local north = c + point (0,radius)
+ local west = c - point (radius,0)
+ local o = { center = c,
+ through = t,
+ radius = radius,
+ south = south,
+ east = east,
+ north = north,
+ west = west,
+ type = type}
+ setmetatable(o, self)
+ self.__index = self
+ return o
end
-- other definition
function circle: radius (center, radius) -- c --> center r --> radius
- local through
- through = center + point( radius, 0 )
- return circle : new (center, through )
+ return circle : new (center, center + point( radius, 0 ) )
end
-----------------------
-- boolean --
@@ -62,7 +67,6 @@ end
-----------------------
-- real --
-----------------------
-
function circle: power (pt)
local d
d = point.abs (self.center - pt)
@@ -90,8 +94,9 @@ function circle: midarc (z1,z2)
return rotation_ (self.center,phi,z1)
end
-function circle: point (phi)
- return point (self.center.re+self.radius*math.cos(phi),self.center.im+self.radius*math.sin(phi) )
+function circle: point (t)
+ local phi = 2*t* math.pi
+ return rotation_ (self.center,phi,self.through)
end
function circle: random_pt(lower, upper)
@@ -108,8 +113,6 @@ end
function circle: external_similitude (C)
return barycenter_ ({C.center,self.radius},{self.center,-C.radius})
end
-
-
-----------------------
-- lines --
-----------------------
@@ -168,17 +171,38 @@ function circle: orthogonal_through (pta,ptb)
end
end
- function circle: inversion (obj)
- 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)
+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]) )
+ end
+ return table.unpack ( t )
+ end
end
- end
-
+ function circle: set_inversion (...)
+ local tp = table.pack(...)
+ local i
+ local t = {}
+ for i=1,tp.n do
+ table.insert( t , inversion_ (self.center,self.through , tp[i]) )
+ end
+ return table.unpack ( t )
+ end
+
function circle: draw ()
local x,y
x, y = self.center: get ()
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
index 8a2564bd36..f63b0d183a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
@@ -1,4 +1,6 @@
-- tkz_elements_class.lua
+-- date 23/12/03
+-- version 1.40c
-- 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
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipses.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
index 4bc34c61b7..b4cbe76a7e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipses.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
@@ -1,6 +1,6 @@
-- tkz_elements-ellipses.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -19,34 +19,35 @@ ellipse = {}
function ellipse: new(pc, pa ,pb)
-- pc --> center pa --> through big axe pb --> little axe
- local type = 'ellipse'
- local Rx = point.abs ( pa - pc )
- local Ry = point.abs ( pb - pc )
- local slope = slope_ (pc,pa)
- local c = math.sqrt (Rx*Rx-Ry*Ry)
- local Fa = pc + c*(point(math.cos(slope),math.sin(slope)))
- local Fb = pc - c*(point(math.cos(slope),math.sin(slope)))
- local east = pa
- local north = pb
- local west = 2 * pc - pa
- local south = 2 * pc - pb
- local vertex = pa
- local covertex = pb
- local new_ellipse = { center = pc,
- vertex = vertex,
- covertex = covertex,
- Rx = Rx,
- Ry = Ry,
- slope = slope,
- Fa = Fa,
- Fb = Fb,
- type = type,
- north = north,
- south = south,
- east = east,
- west = west }
- setmetatable(new_ellipse, {__index = ellipse})
- return new_ellipse
+ local type = 'ellipse'
+ local Rx = point.abs ( pa - pc )
+ local Ry = point.abs ( pb - pc )
+ local slope = slope_ (pc,pa)
+ local c = math.sqrt (Rx*Rx-Ry*Ry)
+ local Fa = pc + c*(point(math.cos(slope),math.sin(slope)))
+ local Fb = pc - c*(point(math.cos(slope),math.sin(slope)))
+ local east = pa
+ local north = pb
+ local west = 2 * pc - pa
+ local south = 2 * pc - pb
+ local vertex = pa
+ local covertex = pb
+ local o = { center = pc,
+ vertex = vertex,
+ covertex = covertex,
+ Rx = Rx,
+ Ry = Ry,
+ slope = slope,
+ Fa = Fa,
+ Fb = Fb,
+ type = type,
+ north = north,
+ south = south,
+ east = east,
+ west = west }
+ setmetatable(o, self)
+ self.__index = self
+ return o
end
function ellipse: foci (f1,f2,v )
@@ -68,7 +69,8 @@ function ellipse: radii (c,a,b,sl )
return ellipse: new (c,v,cov)
end
-function ellipse: point (phi)
+function ellipse: point (t)
+ local phi = 2*t* math.pi
local ax,ay,bx,by,cx,cy
cx = self.center.re
cy = self.center.im
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
index fe9c91d2f7..76b8fb395b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_circles.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -23,19 +23,6 @@ function midarc_ (o,a,b) -- a -> b
return rotation_ (o,phi,b)
end
-function radical_center (C1,C2,C3)
- local t1,t2,t3,t4
- t1,t2 = radical_axis_ (C3.center,C3.through,C1.center,C1.through)
- t3,t4 = radical_axis_ (C3.center,C3.through,C2.center,C2.through)
-return intersection_ll_ (t1,t2,t3,t4)
-end
-
-function radical_circle (C1,C2,C3)
- local rc
- rc = radical_center (C1,C2,C3)
- return C1 : orthogonal_from (rc)
-end
-
function tangent_from_ (c,p,pt)
local o
o = midpoint_ ( c,pt )
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
index f52c4bc2b1..314174cb30 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
@@ -1,6 +1,6 @@
-- tkz_elements_intersections.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -33,7 +33,7 @@ end -- function
-- line ellipse
function intersection_le (L,E)
- local a,b,c,d,t1,t2,z1,z2,Bx,By,Ax,Ay,Rx,Ry,epsilon,sd
+ local a,b,c,d,t1,t2,z1,z2,A,B,Bx,By,Ax,Ay,Rx,Ry,epsilon,sd
A = (L.pa - E.center)*(point(math.cos(E.slope),-math.sin(E.slope)))
B = (L.pb - E.center)*(point(math.cos(E.slope),-math.sin(E.slope)))
epsilon = 10^(-6)
@@ -134,7 +134,7 @@ function intersection_lc_ (pa,pb,c,p)
end -- function
function intersection_cc_ (ca,pa,cb,pb )
- local d, cosphi, phi,ra,rb,epsilon
+ local d, cosphi, phi,ra,rb,c1,c2,epsilon
epsilon = 12
d = point.abs (ca - cb)
ra = point.abs (ca - pa)
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
index c78004be6a..4c3c260ff4 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_lines.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -106,7 +106,7 @@ function projection_ ( pa,pb,pt )
return pt
else
v = pb - pa
- z = ((pt - pa)..v)/(point.norm(v)) -- .. dot product
+ z = ((pt - pa)..v)/(point.norm(v)) -- .. dot product
return pa + z * v
end
end
@@ -117,6 +117,15 @@ function symmetry_axial_(pa,pb,pt)
return symmetry_(p,pt)
end
+function set_symmetry_axial_ (u,v,...)
+ local tp = table.pack(...)
+ local i
+ local t = {}
+ for i=1,tp.n do
+ table.insert( t , symmetry_axial_ (u,v , tp[i]) )
+ end
+ return table.unpack ( t )
+end
function square_ (a,b)
return rotation_ (b,-math.pi/2,a), rotation_ (a,math.pi/2,b)
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
index f38458e1f1..fd030de8c1 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_maths.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -64,11 +64,11 @@ function islinear (z1,z2,z3)
end
function isortho (z1,z2,z3)
- local epsilon
- local dp
- epsilon = 10^(-8)
- dp = (z2-z1) .. (z3-z1)
- if math.abs(dp) < epsilon
+ local epsilon
+ local dp
+ epsilon = 10^(-8)
+ dp = (z2-z1) .. (z3-z1)
+ if math.abs(dp) < epsilon
then
return true
else
@@ -76,11 +76,6 @@ function isortho (z1,z2,z3)
end
end
-function set_lua_to_tex (t)
- for k,v in pairs(t) do
- token.set_macro(v,_ENV[v],'global')
- end
-end
function parabola (a,b,c)
local xa,xb,xc,ya,yb,yc
@@ -124,4 +119,8 @@ local dblpi
a = a + dblpi
end
return a
-end \ No newline at end of file
+end
+
+function barycenter (...)
+ return barycenter_ (...)
+end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
index ea468a9c6d..34107d76fe 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_points.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -39,14 +39,44 @@ function rotation_ (c,a,pt)
return z*(pt-c)+c
end
+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] ))
+ end
+ return table.unpack ( t )
+end
+
function symmetry_(c,pt)
return 2 * c - pt
end
+function set_symmetry_ (c,...)
+ local tp = table.pack(...)
+ local i
+ local t = {}
+ for i=1,tp.n do
+ table.insert( t , symmetry_ (c , tp[i]) )
+ end
+ return table.unpack ( t )
+end
+
function homothety_(c,t,p)
return c + t * (p - c)
end
+function set_homothety_ (c,coeff,...)
+ local tp = table.pack(...)
+ local i
+ local t = {}
+ for i=1,tp.n do
+ table.insert( t , homothety_ (c, coeff , tp[i]) )
+ end
+ return table.unpack ( t )
+end
+
function translation_(a , p)
return a+p
end
@@ -61,7 +91,7 @@ function set_translation_ (u,...)
return table.unpack ( t )
end
-function random_point(lower, upper)
+function random_point_(lower, upper)
math.randomseed( tonumber(tostring(os.time()):reverse():sub(1,6)) )
x = math.random (lower, upper)
y = math.random (lower, upper)
@@ -78,4 +108,5 @@ function midpoints_ (...)
end
table.insert( t , (arg[n]+arg[1])/2 )
return table.unpack ( t )
-end \ No newline at end of file
+end
+
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
new file mode 100644
index 0000000000..378d855a21
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
@@ -0,0 +1,27 @@
+-- tkz_elements_functions_regular.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+
+---------------------------------------------------------------------------
+ --
+---------------------------------------------------------------------------
+function regular_(c,th,s)
+ local r,t,dep
+ dep = angle_normalize(point.arg (th-c))
+ t = {}
+ r = point.mod (th-c)
+ for i =1,s do
+ table.insert( t , (c + point : polar (r,2*(i-1)*math.pi/s + dep) ))
+ end
+ return t
+end \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
index 166d3b7647..426bc1a88e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_triangles.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -39,7 +39,6 @@ function ex_center_ ( a,b,c )
return barycenter_ ( {a,-ka} , {b,kb} , {c,kc} )
end
--- N,G,H,O
function centroid_ (a,b,c)
return barycenter_ ( {a,1} , {b,1} , {c,1} )
end
@@ -97,6 +96,7 @@ end
--------------------
-- lines --
--------------------
+-- N,G,H,O
function euler_line_ (a,b,c)
check_equilateral_ (a,b,c)
local A = math.tan( get_angle_ ( a,b,c ))
@@ -275,8 +275,7 @@ function check_equilateral_ (a,b,c)
C = a - b
if (point.abs(A)-point.abs(B) < epsilon) and (point.abs(B)-point.abs(C) < epsilon)
then
- tex.print("equilateral !!")
- error("something went wrong!")
+ return true else return false
end
end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
new file mode 100644
index 0000000000..a8d8da22d3
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
@@ -0,0 +1,319 @@
+-- tkz_elements_lines.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+
+-- -------------------------------------------------------------------------
+-- Lines
+-- -------------------------------------------------------------------------
+line = {}
+function line: new(za, zb)
+ local type = 'line'
+ local mid = (za+zb)/2
+ local north_pa = rotation_ (za,math.pi/2,zb)
+ local south_pa = rotation_ (za,-math.pi/2,zb)
+ local north_pb = rotation_ (zb,-math.pi/2,za)
+ local south_pb = rotation_ (zb,math.pi/2,za)
+ local west = rotation_ (za,math.pi/2,north_pa)
+ local east = rotation_ (zb,math.pi/2,south_pb)
+ local slope = point.arg(zb-za)
+ local length = point.mod(zb-za)
+ local o = {pa = za,
+ pb = zb,
+ north_pa = north_pa,
+ south_pa = south_pa,
+ west = west,
+ east = east,
+ north_pb = north_pb,
+ south_pb = south_pb,
+ slope = slope,
+ mid = mid,
+ type = type,
+ length = length}
+ setmetatable(o, self)
+ self.__index = self
+ return o
+end
+
+-------------------
+-- Result -> real
+-------------------
+function line: distance (pt)
+ return point.mod(projection(self,pt)-pt)
+end
+
+function line: slope ()
+ return slope_(self.pa,self.pb)
+end
+-------------------
+-- Result -> boolean
+-------------------
+function line: in_out (pt)
+ local sc,epsilon
+ epsilon = 10^(-12)
+ sc = math.abs ((pt-self.pa)^(pt-self.pb))
+ if sc <= epsilon
+ then
+ return true
+ else
+ return false
+ end
+end
+
+-------------------
+-- Result -> point
+-------------------
+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
+ return barycenter_({self.pa,1-t},{self.pb,(t)})
+end
+
+function line: midpoint ()
+ return (self.pa+self.pb)/2
+end
+
+function line: harmonic_int (pt)
+ return div_harmonic_int_(self.pa,self.pb,pt)
+end
+
+function line: harmonic_ext (pt)
+ return div_harmonic_ext_(self.pa,self.pb,pt)
+end
+
+function line: harmonic_both (k)
+ return div_harmonic_both_(self.pa,self.pb,k)
+end
+
+function line: gold_ratio()
+ return self.pa + (self.pb-self.pa)*tkzinvphi
+end
+
+function line: normalize ()
+ return self.pa+(self.pb-self.pa)/point.mod(self.pb-self.pa)
+end
+
+function line: normalize_inv ()
+ return normalize_ (self.pb,self.pa)
+end
+-------------- transformations -------------
+function line: translation_pt ( pt )
+ return translation_ ( self.pb-self.pa,pt )
+end
+
+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 )
+ return circle : new (x,y)
+end
+
+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 )
+ return triangle : new (x,y,z)
+end
+
+function line: translation_L ( obj )
+ local pa,pb,x,y
+ pa = obj.pa
+ pb = obj.pb
+ x,y = set_translation_ ( self.pb-self.pa,pa,pb )
+ return line : new (x,y)
+end
+
+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
+ t = {}
+ for i=1,tp.n do
+ table.insert(t , translation_ ( self.pb-self.pa , tp[i]))
+ end
+ return table.unpack ( t )
+ end
+end
+
+function line: set_translation ( ...)
+ return set_translation_ ( self.pb-self.pa,... )
+end
+
+function line: projection (...)
+ local obj,nb,t
+ local tp = table.pack(...)
+ obj = tp[1]
+ nb = tp.n
+ if nb == 1 then
+ return projection_ ( self.pa, self.pb, obj )
+ else
+ t = {}
+ for i=1,tp.n do
+ table.insert( t , projection_ (self.pa, self.pb, tp[i]) )
+ end
+ return table.unpack ( t )
+ end
+end
+
+function line: set_projection (...)
+ local tp = table.pack(...)
+ local i
+ local t = {}
+ for i=1,tp.n do
+ table.insert( t , projection_ (self.pa,self.pb , tp[i]) )
+ end
+ return table.unpack ( t )
+end
+
+function line: symmetry_axial_L ( obj )
+ local pa,pb,x,y
+ pa = obj.pa
+ pb = obj.pb
+ x,y = self:set_reflection ( pa,pb )
+ return line : new (x,y)
+end
+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 )
+ return triangle : new (x,y,z)
+end
+
+function line: symmetry_axial_C ( obj )
+ local pa,pb,x,y
+ pa = obj.center
+ pb = obj.through
+ x,y = self:set_reflection ( pa,pb )
+ return circle : new (x,y)
+end
+
+function line: reflection (...)
+ 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_axial_ ( self.pa,self.pb,obj )
+ elseif obj.type == "line" then
+ return self: symmetry_axial_L (obj)
+ elseif obj.type == "triangle" then
+ return self: symmetry_axial_T (obj)
+ else
+ return self: symmetry_axial_C (obj)
+ end
+ else
+ t = {}
+ for i=1,tp.n do
+ table.insert( t , symmetry_axial_ ( self.pa,self.pb , tp[i]) )
+ end
+ return table.unpack ( t )
+ end
+end
+
+function line: set_reflection (...)
+ return set_symmetry_axial_ ( self.pb,self.pa,... )
+end
+
+-------------------
+-- Result -> line
+-------------------
+function line: ll_from ( pt )
+ return line : new (pt,pt+self.pb-self.pa)
+end
+
+function line: ortho_from ( pt )
+ return line : new (pt,pt+(self.pb-self.pa)*point(0,1))
+end
+
+function line: mediator ()
+ local m
+ m = midpoint_ (self.pa,self.pb)
+ return line : new (m,rotation_ (m,math.pi/2,self.pb))
+end
+-------------------
+-- Result -> circle
+-------------------
+function line: circle ()
+ return circle : new (self.pa,self.pb)
+end
+
+function line: circle_swap ()
+ return circle : new (self.pb,self.pa)
+end
+
+----------------------
+-- Result -> triangle
+----------------------
+function line: equilateral (swap)
+ if swap == nil then
+ swap = false
+ 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)
+ local pta,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 ))
+
+end
+
+function line: gold ()
+ local pt
+ pt = rotation_ (self.pa,math.pi/2,self.pb)
+ return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+end
+
+function line: euclide ()
+ return triangle : new (self.pa,self.pb, rotation_ (self.pa,math.pi/5,self.pb))
+ end
+
+function line: golden ()
+ local pt
+ pt = rotation_ (self.pa,2*math.pi/5,self.pb)
+ return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi)
+end
+------------------------------
+-- Result -> couple of points
+------------------------------
+function line: square ()
+ return square : side (self.pa,self.pb)
+end
+
+return line \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua
deleted file mode 100644
index 11d8f49d41..0000000000
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua
+++ /dev/null
@@ -1,202 +0,0 @@
--- tkz_elements_lines.lua
--- date 2023/11/10
--- version 1.20b
--- Copyright 2023 Alain Matthes
--- This work may be distributed and/or modified under the
--- conditions of the LaTeX Project Public License, either version 1.3
--- of this license or (at your option) any later version.
--- The latest version of this license is in
--- http://www.latex-project.org/lppl.txt
--- and version 1.3 or later is part of all distributions of LaTeX
--- version 2005/12/01 or later.
--- This work has the LPPL maintenance status “maintained”.
--- The Current Maintainer of this work is Alain Matthes.
-
--- -------------------------------------------------------------------------
--- Lines
--- -------------------------------------------------------------------------
-line = {}
-function line: new(za, zb)
- local type = 'line'
- local mid = (za+zb)/2
- local north_pa = rotation_ (za,math.pi/2,zb)
- local south_pa = rotation_ (za,-math.pi/2,zb)
- local north_pb = rotation_ (zb,-math.pi/2,za)
- local south_pb = rotation_ (zb,math.pi/2,za)
- local west = rotation_ (za,math.pi/2,north_pa)
- local east = rotation_ (zb,math.pi/2,south_pb)
- local slope = point.arg(zb-za)
- local length = point.mod(zb-za)
- local new_line = {pa = za, pb = zb,
- north_pa = north_pa,south_pa = south_pa,west = west,east = east,
- north_pb = north_pb,south_pb = south_pb,
- slope = slope,mid = mid,type = type,length = length}
- setmetatable(new_line, {__index = line})
- return new_line
-end
-
--------------------
--- Result -> real
--------------------
-function line: distance (pt)
- return point.mod(projection(self,pt)-pt)
-end
-
-function line: slope ()
- return slope_(self.pa,self.pb)
-end
--------------------
--- Result -> boolean
--------------------
-function line: in_out (pt)
- local sc,epsilon
- epsilon = 10^(-12)
- sc = math.abs ((pt-self.pa)^(pt-self.pb))
- if sc <= epsilon
- then
- return true
- else
- return false
- end
-end
-
--------------------
--- Result -> point
--------------------
-function line: translation ( pt )
- return translation_ ( self.pb-self.pa,pt )
-end
-
-function line: set_translation ( ...)
- return set_translation_ ( self.pb-self.pa,... )
-end
-
-function line: projection ( pt )
- return projection_ ( self.pa,self.pb,pt )
-end
-
-function line: set_projection (...)
- local tp = table.pack(...)
- local i
- local t = {}
- for i=1,tp.n do
- table.insert( t , projection_ (self.pa,self.pb , tp[i]) )
- end
- return table.unpack ( t )
-end
-
-function line: symmetry_axial ( pt )
- return symmetry_axial_ ( self.pa,self.pb,pt )
-end
-
-function line: set_symmetry_axial (...)
- local tp = table.pack(...)
- local i
- local t = {}
- for i=1,tp.n do
- table.insert( t , symmetry_axial_ (self.pa,self.pb , tp[i]) )
- end
- return table.unpack ( t )
-end
-
-
-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
- return barycenter_({self.pa,1-t},{self.pb,(t)})
-end
-
-function line: midpoint ()
- return (self.pa+self.pb)/2
-end
-
-function line: harmonic_int (pt)
- return div_harmonic_int_(self.pa,self.pb,pt)
-end
-
-function line: harmonic_ext (pt)
- return div_harmonic_ext_(self.pa,self.pb,pt)
-end
-
-function line: harmonic_both (k)
- return div_harmonic_both_(self.pa,self.pb,k)
-end
-
-function line: gold_ratio()
- return self.pa + (self.pb-self.pa)*tkzinvphi
-end
-
-function line: normalize ()
- return self.pa+(self.pb-self.pa)/point.mod(self.pb-self.pa)
-end
-
-function line: normalize_inv ()
- return normalize_ (self.pb,self.pa)
-end
--------------------
--- Result -> line
--------------------
-function line: ll_from ( pt )
- return line : new (pt,pt+self.pb-self.pa)
-end
-
-function line: ortho_from ( pt )
- return line : new (pt,pt+(self.pb-self.pa)*point(0,1))
-end
-
-function line: mediator ()
- local m
- m = midpoint_ (self.pa,self.pb)
- return line : new (m,rotation_ (m,math.pi/2,self.pb))
-end
--------------------
--- Result -> circle
--------------------
-function line: circle ()
- return circle : new (self.pa,self.pb)
-end
-
-function line: circle_swap ()
- return circle : new (self.pb,self.pa)
-end
-
-----------------------
--- Result -> triangle
-----------------------
-function line: equilateral ()
- return triangle : new (self.pa,self.pb,rotation_ (self.pa,math.pi/3,self.pb))
-end
-
-function line: isosceles (phi)
- local pta,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 ))
-
-end
-
-function line: gold ()
- local pt
- pt = rotation_ (self.pa,math.pi/2,self.pb)
- return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
-end
-
-function line: euclide ()
- return triangle : new (self.pa,self.pb, rotation_ (self.pa,math.pi/5,self.pb))
- end
-
-function line: golden ()
- local pt
- pt = rotation_ (self.pa,2*math.pi/5,self.pb)
- return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi)
-end
-------------------------------
--- Result -> couple of points
-------------------------------
-function line: square ()
- return rotation_ (self.pb,-math.pi/2,self.pa), rotation_ (self.pa,math.pi/2,self.pb)
-end
-
-return line \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
index 10b96d1430..4efa5b6169 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
@@ -1,6 +1,6 @@
-- tkz_elements-main.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -12,23 +12,31 @@
-- This work has the LPPL maintenance status “maintained”.
-- The Current Maintainer of this work is Alain Matthes.
- z = {}
- L = {}
- C = {}
- T = {}
- V = {}
- E = {}
- Q = {}
- scale = 1
+ z = {}
+ C = {}
+ E = {}
+ L = {}
+ M = {}
+ P = {}
+ Q = {}
+ R = {}
+ RP = {}
+ S = {}
+ T = {}
+ V = {}
+ -- loads module
require "tkz_elements_point.lua"
-
-require "tkz_elements_points.lua"
-require "tkz_elements_lines.lua"
-require "tkz_elements_circles.lua"
-require "tkz_elements_triangles.lua"
-require "tkz_elements_vectors.lua"
-require "tkz_elements_ellipses.lua"
+require "tkz_elements_line.lua"
+require "tkz_elements_circle.lua"
+require "tkz_elements_triangle.lua"
+require "tkz_elements_vector.lua"
+require "tkz_elements_ellipse.lua"
+require "tkz_elements_regular.lua"
+require "tkz_elements_parallelogram.lua"
+require "tkz_elements_quadrilateral.lua"
+require "tkz_elements_rectangle.lua"
+require "tkz_elements_square.lua"
require "tkz_elements_functions_maths.lua"
require "tkz_elements_functions_intersections.lua"
@@ -36,14 +44,5 @@ require "tkz_elements_functions_points.lua"
require "tkz_elements_functions_lines.lua"
require "tkz_elements_functions_circles.lua"
require "tkz_elements_functions_triangles.lua"
-
-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
-end
-end \ No newline at end of file
+require "tkz_elements_functions_regular.lua"
+require "tkz_elements_misc.lua" \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
new file mode 100644
index 0000000000..5667aba67f
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
@@ -0,0 +1,48 @@
+-- tkz_elements_functions_maths.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+-- ----------------------------------------------------------------
+--
+-- ----------------------------------------------------------------
+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 set_lua_to_tex (t)
+ for k,v in pairs(t) do
+ token.set_macro(v,_ENV[v],'global')
+ end
+end
+
+function radical_center (C1,C2,C3)
+ local t1,t2,t3,t4
+ t1,t2 = radical_axis_ (C3.center,C3.through,C1.center,C1.through)
+ t3,t4 = radical_axis_ (C3.center,C3.through,C2.center,C2.through)
+return intersection_ll_ (t1,t2,t3,t4)
+end
+
+function radical_circle (C1,C2,C3)
+ local rc
+ rc = radical_center (C1,C2,C3)
+ return C1 : orthogonal_from (rc)
+end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
new file mode 100644
index 0000000000..330fd53f01
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
@@ -0,0 +1,56 @@
+-- tkz_elements_parallelogram.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+---------------------------------------------------------------------------
+-- Parallelogram
+---------------------------------------------------------------------------
+
+parallelogram = {}
+function parallelogram: new (za, zb, zc,zd)
+ local d,epsilon
+ epsilon = 10^(-8)
+ local zi = midpoint_ (za,zc)
+ local zj = midpoint_ (zb,zd)
+ if point.abs (zj-zi) < epsilon then else error ("it's not a parallelogram")
+ end
+ local type = 'parallelogram'
+ local i = midpoint_ (za,zc)
+ 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 o = { pa = za,
+ pb = zb,
+ pc = zc,
+ pd = zd,
+ ab = ab,
+ ac = ac,
+ bc = bc,
+ da = da,
+ cd = cd,
+ bd = bd,
+ i = i,
+ type = type }
+ setmetatable(o, self)
+ self.__index = self
+ return o
+end
+
+function parallelogram : fourth (za,zb,zc)
+ local zd = zc + (za-zb)
+ return parallelogram : new (za, zb, zc,zd)
+end
+
+return parallelogram \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
index 5d459e3028..32e549a749 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
@@ -1,6 +1,6 @@
-- tkz_elements_point.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -17,15 +17,15 @@ require 'tkz_elements_class'
point = class(function(p,re,im)
if type(re) == 'number' then
- p.re = re
- p.im = im
- else
- p.re = re.re
- p.im = re.im
+ p.re = re
+ p.im = im
+ else
+ p.re = re.re
+ p.im = re.im
end
- p.type = 'point'
+ p.type = 'point'
p.argument = math.atan(p.im, p.re)
- p.modulus = math.sqrt(p.re*p.re + p.im*p.im)
+ p.modulus = math.sqrt(p.re * p.re + p.im * p.im)
end)
local sqrt = math.sqrt
@@ -34,8 +34,8 @@ local sin = math.sin
local exp = math.exp
local atan = math.atan
local min = math.min
-local max = math.max
-local abs = math.abs
+local max = math.max
+local abs = math.abs
local function topoint (z1)
if (type(z1) == "number") then return point(z1,0) else return z1 end
@@ -78,7 +78,7 @@ function point.__concat(z1,z2)
return z.re
end
--- determinant is '^' (a+ib) (a-ib) (c+id) = ac+bd + i(ad - bc)
+-- determinant is '^' (a-ib) (c+id) = ac+bd + i(ad - bc)
function point.__pow(z1,z2)
local z
z = point.conj(z1) * z2
@@ -174,8 +174,141 @@ function point.get(z)
return z.re, z.im
end
-function point.sqrt(z)
- local y = sqrt((point.mod(z)-z.re)/2)
- local x = z.im/(2*y)
+function point: sqrt()
+ local y = sqrt((point.mod(self)-self.re)/2)
+ local x = self.im/(2*y)
return point(x,y)
+end
+
+-- methods ---
+
+function point: new ( a,b )
+ return scale * point (a,b )
+end
+
+function point: polar ( radius, phi )
+ return scale * polar_ ( radius, phi )
+end
+
+function point: polar_deg ( radius, phi )
+ return scale * polar_ ( radius, phi * math.pi/180 )
+end
+
+function point: north(d)
+ local d = d or 1
+ return self+ polar_ ( d * scale, math.pi/2 )
+end
+
+function point: south(d)
+ local d = d or 1
+ return self + polar_ ( d * scale, 3 * math.pi/2 )
+ end
+
+function point: east(d)
+ local d = d or 1
+ return self+ polar_( d * scale, 0 )
+end
+
+function point: west(d)
+ local d = d or 1
+ return self + polar_ ( d * scale, math.pi )
+ end
+-- ----------------------------------------------------------------
+-- transformations
+-- ----------------------------------------------------------------
+-- function point: symmetry(pt)
+-- 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
+end
+
+function point: set_symmetry (...)
+ return set_symmetry_ ( self,... )
+end
+
+function point: rotation_pt(angle , pt)
+ return rotation_(self,angle,pt)
+end
+
+function point:set_rotation (angle,...)
+ 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
+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
+end
+
+function point: normalize()
+ local d = point.abs(self)
+ return point(self.re/d,self.im/d)
end \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua
deleted file mode 100644
index 74ad16a165..0000000000
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua
+++ /dev/null
@@ -1,98 +0,0 @@
--- tkz_elements_points.lua
--- date 2023/11/10
--- version 1.20b
--- Copyright 2023 Alain Matthes
--- This work may be distributed and/or modified under the
--- conditions of the LaTeX Project Public License, either version 1.3
--- of this license or (at your option) any later version.
--- The latest version of this license is in
--- http://www.latex-project.org/lppl.txt
--- and version 1.3 or later is part of all distributions of LaTeX
--- version 2005/12/01 or later.
--- This work has the LPPL maintenance status “maintained”.
--- The Current Maintainer of this work is Alain Matthes.
-
--- ----------------------------------------------------------------
--- points create
--- ----------------------------------------------------------------
-
-function point: new ( a,b )
- return scale * point (a,b )
-end
-
-function point: polar ( radius, phi )
- return scale * polar_ ( radius, phi )
-end
-
-function point: polar_deg ( radius, phi )
- return scale * polar_ ( radius, phi * math.pi/180 )
-end
-
-function point: north(d)
- local d = d or 1
- return self+ polar_ ( d, math.pi/2 )
-end
-
-function point: south(d)
- local d = d or 1
- return self + polar_ ( d, -math.pi/2 )
- end
-
-function point: east(d)
- local d = d or 1
- return self+ point( d, 0 )
-end
-
-function point: west(d)
- local d = d or 1
- return self + point ( -d, 0 )
- end
--- ----------------------------------------------------------------
--- transformations
--- ----------------------------------------------------------------
-function point: symmetry(pt)
- return symmetry_ (self ,pt)
-end
-
-function point: set_symmetry (...)
- local tp = table.pack(...)
- local i
- local t = {}
- for i=1,tp.n do
- table.insert( t , symmetry_ (self , tp[i]) )
- end
- return table.unpack ( t )
-end
-
-function point: rotation(angle , pt)
- return rotation_(self,angle,pt)
-end
-
-function point:set_rotation (angle,...)
- local tp = table.pack(...)
- local i
- local t = {}
- for i=1,tp.n do
- table.insert( t , rotation_ (self,angle , tp[i]) )
- end
- return table.unpack ( t )
-end
-
-function point: homothety(t,pt)
- return homothety_(self,t,pt)
-end
-
-function point: set_homothety (coeff,...)
- local tp = table.pack(...)
- local i
- local t = {}
- for i=1,tp.n do
- table.insert( t , homothety_ (self, coeff , tp[i]) )
- end
- return table.unpack ( t )
-end
-
-function point: normalize()
- local d = point.abs(self)
- return point(self.re/d,self.im/d)
-end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
new file mode 100644
index 0000000000..0731732310
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
@@ -0,0 +1,62 @@
+-- tkz_elements_quadrilateral.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+
+quadrilateral = {}
+function quadrilateral: new (za, zb, zc, zd)
+ local type = 'quadrilateral'
+ local a = point.abs ( zb - za )
+ local b = point.abs ( zc - zb )
+ local c = point.abs ( zd - zc )
+ local d = point.abs ( za - zd )
+ 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 i = intersection_ll_ (za,zc,zb,zd)
+ local g = barycenter_ ( {za,1} , {zb,1} , {zc,1} ,{ zd ,1 } )
+ local o = { pa = za,
+ pb = zb,
+ pc = zc,
+ pd = zd,
+ a = a,
+ b = b,
+ c = c,
+ d = d,
+ ab = ab,
+ bc = bc,
+ cd = cd,
+ da = da,
+ ac = ac,
+ bd = bd,
+ i = i,
+ g = g,
+ type = type }
+ setmetatable(o, self)
+ self.__index = self
+ return o
+end
+-----------------------
+function quadrilateral : cyclic ()
+ local d,epsilon
+ epsilon = 10^(-8)
+ local alpha = point.arg ((self.pd-self.pa) / (self.pb-self.pa))
+ local beta = point.arg ((self.pb-self.pc) / (self.pd-self.pc))
+ if math.abs (alpha+beta-math.pi) < epsilon then return true
+ else return false
+ end
+end
+
+return quadrilateral \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
new file mode 100644
index 0000000000..142ddbd8b2
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
@@ -0,0 +1,102 @@
+-- tkz_elements-rectangle.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+---------------------------------------------------------------------------
+-- rectangle
+---------------------------------------------------------------------------
+
+rectangle = {}
+function rectangle: new (za, zb,zc,zd)
+ local d,epsilon
+ epsilon = 10^(-8)
+ local zi = midpoint_ (za,zc)
+ local zj = midpoint_ (zb,zd)
+ if point.abs (zj-zi) < epsilon then else error ("it's not a rectangle")
+ end
+ if math.abs(point.abs (zc-za)-point.abs (zd-zb)) < 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 }
+ setmetatable(o, self)
+ self.__index = self
+ return o
+end
+
+function rectangle : angle (zi,za,an)
+ local zc = symmetry_ (zi,za)
+ local zb = rotation_(zi,-an,zc)
+ local zd = symmetry_ (zi,zb)
+ return rectangle : new (za,zb,zc,zd)
+end
+
+function rectangle : gold (za,zb)
+ a = point.arg (zb-za)
+ local d = point.abs(zb-za)/tkzphi
+ local zc = zb : north (d/scale)
+ zc = rotation_ (zb,a,zc)
+ local zd = za : north (d/scale)
+ zd = rotation_ (za,a,zd)
+ return rectangle : new (za,zb,zc,zd)
+end
+
+function rectangle : diagonal (za,zc)
+ local zb = point (zc.re,za.im)
+ local zd = point (za.re,zc.im)
+ return rectangle : new (za,zb,zc,zd)
+end
+
+function rectangle : side (za,zb,d)
+ a = point.arg (zb-za)
+ local zc = zb : north (d/scale)
+ zc = rotation_ (zb,a,zc)
+ local zd = za : north (d/scale)
+ zd = rotation_ (za,a,zd)
+ return rectangle : new (za,zb,zc,zd)
+end
+
+-------------------
+function rectangle : get_lengths ()
+ local a = self.pa
+ local b = self.pb
+ local c = self.pc
+ local d = self.pd
+ return point.mod(b-a),point.mod(c-b),point.mod(d-c),point.mod(a-d)
+end
+
+return rectangle
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
new file mode 100644
index 0000000000..4415b1c66f
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
@@ -0,0 +1,72 @@
+-- tkz_elements_regular.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+
+regular_polygon = {}
+function regular_polygon: new (za, zb ,nb)
+ local type = 'regular_polygon'
+ local table = regular_ (za , zb , nb)
+ local center = za
+ local through = zb
+ local angle = 2 * math.pi/nb
+ local exradius = 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 next = table[2]
+ local first = table[1]
+ local proj = projection_ (first,next,za)
+ local o = { type = type,
+ center = center,
+ through = through,
+ exradius = exradius,
+ inradius = inradius,
+ table = table,
+ circle = circle,
+ nb = nb,
+ angle = angle,
+ side = side,
+ proj = proj }
+ setmetatable(o, self)
+ self.__index = self
+ return o
+end
+-----------------------
+-- points --
+-----------------------
+-------------------
+-- Result -> line
+-------------------
+-----------------------
+-- circles --
+-----------------------
+function regular_polygon : incircle ()
+ local next,first
+ next = self.table[2]
+ first = self.table[1]
+ return circle : new ( self.center , projection_ (first,next,self.center) )
+end
+-------------------
+-- Result -> triangle
+-------------------
+
+-------------------
+-- Result -> miscellaneous
+-------------------
+function regular_polygon : name (nm)
+ for K,V in ipairs(self.table) do
+ z[nm..K] = V
+ end
+end
+
+return regular_polygon \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
new file mode 100644
index 0000000000..4dd007cc77
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
@@ -0,0 +1,81 @@
+-- tkz_elements-square.lua
+-- date 23/12/03
+-- version 1.40c
+-- Copyright 2023 Alain Matthes
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+-- This work has the LPPL maintenance status “maintained”.
+-- The Current Maintainer of this work is Alain Matthes.
+---------------------------------------------------------------------------
+-- Squares
+---------------------------------------------------------------------------
+
+square = {}
+function square: new (za, zb,zc,zd)
+ local d,epsilon
+ epsilon = 10^(-8)
+ local zi = midpoint_ (za,zc)
+ local zj = midpoint_ (zb,zd)
+ if point.abs (zj-zi) < epsilon then else error ("it's not a square (center)")
+ end
+ if math.abs(point.abs (zc-za) - point.abs (zd-zb)) < epsilon then else error ("it's not a square (diagonal)")
+ end
+ if math.abs(point.abs (zb-za) - point.abs (zd-za)) < 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 }
+ setmetatable(o, self)
+ self.__index = self
+ return o
+end
+
+function square : rotation (zi,za)
+ local zb = rotation_ (zi,math.pi/2,za)
+ local zc = rotation_ (zi,math.pi/2,zb)
+ local zd = rotation_ (zi,math.pi/2,zc)
+ return square : new (za,zb,zc,zd)
+end
+
+function square : side (za,zb)
+ local zc = rotation_ (zb,-math.pi/2,za)
+ local zd = rotation_ (za,math.pi/2,zb)
+ return square : new (za,zb,zc,zd)
+end
+
+return square \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
index 6ea35c5b6e..6ef6be0a9a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
@@ -1,6 +1,6 @@
-- tkz_elements_triangles.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -14,28 +14,44 @@
triangle = {}
function triangle: new (za, zb ,zc)
- local type = 'triangle'
- local circumcenter = circum_center_ (za , zb , zc)
- local centroid = barycenter_ ( {za,1} , {zb,1} , {zc,1} )
- local incenter = in_center_ (za , zb , zc)
- local orthocenter = ortho_center_ (za , zb , zc)
- local eulercenter = euler_center_ (za , zb , zc)
- local spiekercenter = spieker_center_ (za , zb , zc)
- local c = point.abs(zb-za)
- local a = point.abs(zc-zb)
- local b = point.abs(za-zc)
- local alpha = point.arg ((zc-za) / (zb-za))
- local beta = point.arg ((za-zb) / (zc-zb))
- local gamma = point.arg ((zb-zc) / (za-zc))
- local ab =line : new (za,zb)
- local ac =line : new (za,zc)
- local bc =line : new (zb,zc)
- local new_triangle = {pa = za, pb = zb, pc = zc, type = type,
- circumcenter=circumcenter,centroid=centroid,incenter=incenter,
- eulercenter=eulercenter, orthocenter=orthocenter,spiekercenter=spiekercenter,
- a=a,b=b,c=c,ab=ab,ac=ac,bc=bc,alpha=alpha,beta=beta,gamma=gamma}
- setmetatable(new_triangle, {__index = triangle})
- return new_triangle
+ local type = 'triangle'
+ local circumcenter = circum_center_ (za , zb , zc)
+ local centroid = barycenter_ ( {za,1} , {zb,1} , {zc,1} )
+ local incenter = in_center_ (za , zb , zc)
+ local orthocenter = ortho_center_ (za , zb , zc)
+ local eulercenter = euler_center_ (za , zb , zc)
+ local spiekercenter = spieker_center_ (za , zb , zc)
+ local c = point.abs(zb-za)
+ local a = point.abs(zc-zb)
+ local b = point.abs(za-zc)
+ local alpha = point.arg ((zc-za) / (zb-za))
+ local beta = point.arg ((za-zb) / (zc-zb))
+ local gamma = point.arg ((zb-zc) / (za-zc))
+ local ab = line : new (za,zb)
+ local ca = line : new (zc,za)
+ local bc = line : new (zb,zc)
+ local o = { pa = za,
+ pb = zb,
+ pc = zc,
+ type = type,
+ circumcenter = circumcenter,
+ centroid = centroid,
+ incenter = incenter,
+ eulercenter = eulercenter,
+ orthocenter = orthocenter,
+ spiekercenter = spiekercenter,
+ a = a,
+ b = b,
+ c = c,
+ ab = ab,
+ ca = ca,
+ bc = bc,
+ alpha = alpha,
+ beta = beta,
+ gamma = gamma}
+ setmetatable(o, self)
+ self.__index = self
+ return o
end
-----------------------
-- points --
@@ -99,10 +115,23 @@ function triangle: nine_points ()
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
+ if t<= t1 then
+ return self.ab : point (t/t1)
+ elseif t <= t2 then
+ return self.bc : point ((t*p-self.a)/self.b)
+ else
+ return self.ca : point ((t*p-self.c-self.b)/self.a)
+ end
+end
-------------------
-- Result -> line
-------------------
--- N,H,G,O -- check_equilateral (a,b,c)
+-- N,H,G,O -- check_equilateral_ (a,b,c)
function triangle: euler_line ()
return line : new (self.orthocenter,self.circumcenter)
end
@@ -210,7 +239,7 @@ function triangle: in_circle ()
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
@@ -364,4 +393,9 @@ function triangle: in_out (pt)
return in_out_ (self.pa,self.pb,self.pc,pt)
end
+function triangle: check_equilateral ()
+ return check_equilateral_ (self.pa,self.pb,self.pc)
+end
+
+
return triangle \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vectors.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
index 26ec57e695..96d6eee1fc 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vectors.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
@@ -1,6 +1,6 @@
-- tkz_elements_vectors.lua
--- date 2023/11/10
--- version 1.20b
+-- date 23/12/03
+-- version 1.40c
-- Copyright 2023 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,20 @@
-- ----------------------------------------------------------------------------
vector = {}
function vector: new(z1, z2)
- local type = 'vector'
- local norm = point.abs(z2-z1)
- local new_vector = {st = z1, ed = z2,norm = norm,type=type}
- setmetatable(new_vector, {__index = vector})
- return new_vector
+ local type = 'vector'
+ local norm = point.abs(z2-z1)
+ local o = {st = z1,
+ ed = z2,
+ norm = norm,
+ type = type }
+ setmetatable(o, self)
+ self.__index = self
+ return o
end
function vector: normalize ()
- local z = self.ed-self.st
- local d = point.abs(z)
+ local z = self.ed-self.st
+ local d = point.abs(z)
local nz = point(z.re/d,z.im/d)
return nz + self.st
end