summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-12-09 03:03:37 +0000
committerNorbert Preining <norbert@preining.info>2023-12-09 03:03:37 +0000
commit1bac51c9be71358b55925783e16f3d8bc03d630b (patch)
tree3e7fe5a309cf68674318a5396ebb83fa5f7a051e /macros/latex/contrib/tkz
parent24d8cd26aa53d1cac2260d29c6cf1c387a61a32a (diff)
CTAN sync 202312090303
Diffstat (limited to 'macros/latex/contrib/tkz')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/README.md28
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex116
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex40
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex2
-rwxr-xr-x[-rw-r--r--]macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex71
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.pdfbin0 -> 537824 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdfbin532726 -> 537824 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua9
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua11
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua32
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua67
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua7
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua67
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua19
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua13
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua21
32 files changed, 368 insertions, 209 deletions
diff --git a/macros/latex/contrib/tkz/tkz-elements/README.md b/macros/latex/contrib/tkz/tkz-elements/README.md
index 75744500d4..93bf219100 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.40c 2023/12/03
+Release 1.50c 2023/12/08
## Description
-`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`.
+`tkz-elements v.1.50c` 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.
@@ -58,6 +58,30 @@ package conflicts.
Some examples will be stored on my site : [http://altermundus.fr](http://altermundus.fr).
## History
+ - version 1.50c Correction of the documentation
+
+ Added "swap" option to create triangles from the "line" object.
+
+ "iscyclic" is a new method to know if a quadrilateral is inscribable in a circle.
+
+ Added function "diameter" to create a circle.
+
+ Added function "swap" to swap two points.
+
+ Correction method "gold" of object rectangle.
+
+ Correction method "in_circle_" of object triangle.
+
+ Correction method "incentral_tr_" of object triangle.
+
+ Added method "soddy_center" of object triangle.
+
+ Added option "swap" for method "square" of object line.
+
+ Added method "report" for object line. Transfer a defined length from a point
+
+ Added option "swap" to the function "square : side"
+
- Version 1.40c Restructuring objects
New version for all transformations. Now, they accept all objects as parameters.
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 099c75a278..1bd4b831e4 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
@@ -154,63 +154,65 @@ Here's the list of methods for the \tkzNameObj{line} object. The results are eit
\label{ssub:table_of_the_methods_from_class_line}
\vspace{1em}
-\bgroup
-\catcode`_=12
-\small
-\captionof{table}{Methods of the class line.}
-\begin{tabular}{lll}
-\toprule
-\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$&\\
-\midrule
- \textbf{Points} &&\\
-\midrule
-\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} &&\\
-\midrule
-\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} &&\\
-\midrule
-\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{Transformations} &&\\
-\midrule
-\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} &&\\
-\midrule
-\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}
-
-\egroup
+\begin{minipage}{\textwidth}
+ \bgroup
+ \catcode`_=12
+ \small
+ \captionof{table}{Methods of the class line.}
+ \begin{tabular}{lll}
+ \toprule
+ \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$&\\
+ \midrule
+ \textbf{Points} &&\\
+ \midrule
+ \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} &&\\
+ \midrule
+ \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}&&\\
+ \midrule
+ \Imeth{line}{equilateral (swap)} & |T.ABC = L.AB : equilateral ()| $(\overrightarrow{AB},\overrightarrow{AC})>0$ & or < with swap \footnote{Triangles are defined in the direct sense of rotation, unless the "swap" option is present.} \\
+ \Imeth{line}{isosceles (phi,swap)} & |T.ABC = L.AB : isosceles (math.pi/6)|& \\
+ \Imeth{line}{gold (swap)} & |T.ABC = L.AB : gold ()| & right in $B$ and $AC = \varphi \times AB $ \\
+ \Imeth{line}{euclide (swap)} & |T.ABC = L.AB : euclide ()| & $AB=AC$ and $(\overrightarrow{AB},\overrightarrow{AC}) = math.pi/5$ \\
+ \Imeth{line}{golden (swap)} & |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{Transformations} &&\\
+ \midrule
+ \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} &&\\
+ \midrule
+ \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=true if $C\in (AB)$ &\\
+ \Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope \\
+ \bottomrule
+ \end{tabular}
+
+ \egroup
+\end{minipage}
% subsubsection table_of_the_methods_from_class_line (end)
Here are a few examples.
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
index 1e1a23b1d4..2171337792 100644
--- 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
@@ -93,7 +93,7 @@ z.G = Q.ABCD.g
\toprule
\textbf{Methods} & \textbf{Comments} \\
\midrule \\
-\Imeth{quadrilateral}{cyclic ()} & inscribed ? (see next example)\\
+\Imeth{quadrilateral}{iscyclic ()} & inscribed ? (see next example)\\
\bottomrule %
\end{tabular}
\egroup
@@ -110,7 +110,7 @@ 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 ()
+bool = Q.new : iscyclic ()
if bool == true then
C.cir = triangle : new (z.A,z.B,z.C): circum_circle ()
z.O = C.cir.center
@@ -138,7 +138,7 @@ 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 ()
+bool = Q.new : iscyclic ()
if bool == true then
C.cir = triangle : new (z.A,z.B,z.C): circum_circle ()
z.O = C.cir.center
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
index 29e9fb89d4..62cb44b1c9 100644
--- 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
@@ -122,12 +122,11 @@ z.I = R.new.center
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.I = point : new ( 4 , 3 )
+P.ABCD = rectangle : angle ( z.I , 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}
@@ -144,12 +143,11 @@ z.I = P.ABCD.center
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.I = point : new ( 4 , 3 )
+P.ABCD = rectangle : angle ( z.I , 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
@@ -211,21 +209,22 @@ z.I = R.side.center
\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
+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(E,F,G,H)
-\tkzDrawPoints(E,F,G,H)
-\tkzLabelPoints((E,F)
-\tkzLabelPoints[above](G,H)
+\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{verbatim}
\end{minipage}
@@ -266,11 +265,12 @@ z.I = R.gold.center
\begin{tikzpicture}
\tkzGetNodes
-\tkzDrawPolygon(A,B,C,D)
-\tkzDrawPoints(A,B,C,D)
-\tkzLabelPoints(A,B)
-\tkzLabelPoints[above](C,D)
+\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{verbatim}
\end{minipage}
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 f25d02d569..90e07b1ef7 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
@@ -16,7 +16,7 @@
and outside the environment \tkzNameEnv{tkzelements} you can use the macro
\begin{mybox}
- |\fthenelse{\equal{\tkzUseLua{bool}}{true}}{ ... }{ ... }|
+ |\ifthenelse{\equal{\tkzUseLua{bool}}{true}}{ ... }{ ... }|
\end{mybox}
after loading the \tkzNamePack{ifthen} package.
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 f9658252c2..7a00735fd4 100644..100755
--- 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
@@ -804,38 +804,40 @@ z.L = intersection (L.AR,L.BG)
\subsection{Director circle} % (fold)
\label{sub:director_circle}
-
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
-scale = .5
-z.O = point: new (0 , 0)
-z.F1 = point: new (4 , 0)
-z.F2 = point: new (-4 , 0)
-z.H = point: new (4*math.sqrt(2) , 0)
-E = ellipse: foci (z.F2,z.F1,z.H)
-a,b = E.Rx, E.Ry
-z.A = E.covertex
-T = triangle: new (z.H,z.O,z.A)
-z.P = T: parallelogram ()
-C = circle: new (z.O,z.P)
-z.L = C: point (2)
-L.J,L.K = E: tangent_from (z.L)
-z.J = L.J.pb
-z.K = L.K.pb
-\end{tkzelements}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawPoints(F1,F2,O)
-\tkzDrawCircles[teal](O,P)
-\tkzDrawPolygon(H,O,A,P)
-\tkzDrawEllipse[red](O,\tkzUseLua{a},\tkzUseLua{b},0)
-\tkzDrawSegments[orange](O,P O,L L,J L,K)
-\tkzDrawPoints(F1,F2,O,H,A,P,L,J,K)
-\tkzLabelPoints(F1,F2,O,H,A,P,L,J,K)
-\tkzMarkRightAngles(A,P,H J,L,K)
-\end{tikzpicture}
-\end{tkzexample}
-
+% modif C: point (0.25) instead of 2
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+ \begin{verbatim}
+ \begin{tkzelements}
+ scale = .5
+ z.O = point: new (0 , 0)
+ z.F1 = point: new (4 , 0)
+ z.F2 = point: new (-4 , 0)
+ z.H = point: new (4*math.sqrt(2) , 0)
+ E = ellipse: foci (z.F2,z.F1,z.H)
+ a,b = E.Rx, E.Ry
+ z.A = E.covertex
+ T = triangle: new (z.H,z.O,z.A)
+ z.P = T: parallelogram ()
+ C = circle: new (z.O,z.P)
+ z.L = C: point (0.25)
+ L.J,L.K = E: tangent_from (z.L)
+ z.J = L.J.pb
+ z.K = L.K.pb
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPoints(F1,F2,O)
+ \tkzDrawCircles[teal](O,P)
+ \tkzDrawPolygon(H,O,A,P)
+ \tkzDrawEllipse[red](O,\tkzUseLua{a},\tkzUseLua{b},0)
+ \tkzDrawSegments[orange](O,P O,L L,J L,K)
+ \tkzDrawPoints(F1,F2,O,H,A,P,L,J,K)
+ \tkzLabelPoints(F1,F2,O,H,A,P,L,J,K)
+ \tkzMarkRightAngles(A,P,H J,L,K)
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
\begin{tkzelements}
scale = .5
z.O = point: new (0 , 0)
@@ -848,13 +850,12 @@ z.A = E.covertex
T = triangle: new (z.H,z.O,z.A)
z.P = T: parallelogram ()
C = circle: new (z.O,z.P)
-z.L = C: point (2)
+z.L = C: point (0.25)
L.J,L.K = E: tangent_from (z.L)
z.J = L.J.pb
z.K = L.K.pb
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -867,7 +868,7 @@ z.K = L.K.pb
\tkzLabelPoints(F1,F2,O,H,A,P,L,J,K)
\tkzMarkRightAngles(A,P,H J,L,K)
\end{tikzpicture}
-\hspace*{\fill}
+\end{minipage}
% subsection director_circle (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.pdf b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.pdf
new file mode 100644
index 0000000000..d05eb7fbb9
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.pdf
Binary files differ
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 6540ebffaf..101a65ed15 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
@@ -21,10 +21,10 @@
headings = small
]{tkz-doc}
\gdef\tkznameofpack{tkz-elements}
-\gdef\tkzversionofpack{1.40c}
+\gdef\tkzversionofpack{1.50c}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{tkz-elements.pdf}
-\gdef\tkzversionofdoc{1.40c}
+\gdef\tkzversionofdoc{1.50c}
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
@@ -88,8 +88,10 @@
\newfontfamily\ttcondensed{lmmonoltcond10-regular.otf}
%% (La)TeX font-related declarations:
\linespread{1.05} % Pagella needs more space between lines
-\usepackage[math-style=literal,bold-style=literal]{unicode-math}
+%\usepackage[math-style=literal,bold-style=literal]{unicode-math}
+\usepackage{unicode-math}
\usepackage{fourier-otf}
+\setmathfont{Concrete-Math.otf}
\let\rmfamily\ttfamily
\usepackage{multicol,lscape,wrapfig}
\usepackage[english]{babel}
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
index e76340cbd0..afc64f416d 100644
--- 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
@@ -158,7 +158,7 @@ The following section concerns only drawings, and is handled by tkz-euclide.
\vspace{1em}
\begin{tkzelements}
- scale = .35
+ scale = .4
z.A = point: new (0,0)
z.B = point: new (6,0)
z.C = point: new (0.8,4)
@@ -198,10 +198,6 @@ The following section concerns only drawings, and is handled by tkz-euclide.
\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 cee54a9cfe..d05eb7fbb9 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/latex/tkz-elements.sty b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
index 1a14660eaa..e8d633c9f6 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.sty v1.40c
+% tkz-elements.sty v1.50c
% 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,7 +11,7 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\ProvidesPackage{tkz-elements}[23/12/03 v1.40c Graphic Object Library]
+\ProvidesPackage{tkz-elements}[23/12/08 v1.50c Graphic Object Library]
\RequirePackage{luacode}
\directlua{require "tkz_elements_main"}
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
index bc3508a5aa..91ff4f659e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
@@ -1,6 +1,6 @@
-- tkz_elements-circles.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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,6 +39,11 @@ end
function circle: radius (center, radius) -- c --> center r --> radius
return circle : new (center, center + point( radius, 0 ) )
end
+
+function circle: diameter (za, zb)
+ local c = midpoint_(za,zb)
+ return circle : new (c, zb )
+end
-----------------------
-- boolean --
-----------------------
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 f63b0d183a..fb15fd3b03 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,6 +1,6 @@
-- tkz_elements_class.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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_ellipse.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
index b4cbe76a7e..dcac24758b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
@@ -1,6 +1,6 @@
-- tkz_elements-ellipses.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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 76b8fb395b..a45987d1c8 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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 314174cb30..5c2a754352 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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 4c3c260ff4..98f16d499b 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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 fd030de8c1..c0b3effa0b 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -124,3 +124,10 @@ end
function barycenter (...)
return barycenter_ (...)
end
+
+function swap(a,b)
+ local t=a
+ a=b
+ b=t
+ return a,b
+end \ No newline at end of file
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 34107d76fe..b396194148 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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
index 378d855a21..3beff723ad 100644
--- 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
@@ -1,6 +1,6 @@
-- tkz_elements_functions_regular.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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 426bc1a88e..90781d961b 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -143,9 +143,9 @@ function in_circle_ ( a,b,c )
kb = point.abs (c-a)
o = barycenter_ ( {a,ka} , {b,kb} , {c,kc} )
return o ,
- projection_ (a,b,o) ,
projection_ (b,c,o) ,
- projection_ (c,a,o)
+ projection_ (a,c,o) ,
+ projection_ (a,b,o)
end
function ex_circle_ ( a,b,c )
@@ -196,7 +196,7 @@ end
function incentral_tr_ (a,b,c)
local i,r,s,t
- i = in_center (a , b , c)
+ i = in_center_ (a , b , c)
r = intersection_ll_ ( a,i , b,c)
s = intersection_ll_ ( b,i , a,c)
t = intersection_ll_ ( c,i , a,b)
@@ -311,4 +311,24 @@ function in_out_ (a,b,c,pt)
else
return false
end
-end \ No newline at end of file
+end
+
+function soddy_center_ (a,b,c)
+ local i,ha,hb,hc,e,f,g,x,y,z,xp,yp,zp
+ i,e,f,g = in_circle_ (a,b,c)
+ ha,hb,hc = orthic_tr_ (a,b,c)
+ x,xp = intersection_lc_ (a,ha,a,g)
+ if (point.mod(ha-x)<point.mod(ha-xp)) then else x,xp=swap(x,xp) end
+ y,yp = intersection_lc_ (b,hb,b,e)
+ if (point.mod(hb-y)<point.mod(hb-yp)) then else y,yp=swap(y,yp) end
+ z,zp = intersection_lc_ (c,hc,c,f)
+ if (point.mod(hc-z)<point.mod(hc-zp)) then else z,zp=swap(z,zp) end
+ xi,t = intersection_lc_ (xp,e,a,g)
+ if in_out_ (a,b,c,xi) then else xi,t = swap(xi,t) end
+ yi,t = intersection_lc_ (yp,f,b,e)
+ if in_out_ (a,b,c,yi) then else yi,t = swap(yi,t) end
+ zi,t = intersection_lc_ (zp,g,c,f)
+ if in_out_ (a,b,c,zi) then else zi,t = swap(zi,t) end
+ s = circum_center_ (xi,yi,zi)
+ return s,xi,yi,zi
+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
index a8d8da22d3..f4169506fc 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
@@ -1,6 +1,6 @@
-- tkz_elements_lines.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -286,34 +286,83 @@ end
end
-function line: isosceles (phi)
- local pta,ptb
+function line: isosceles (phi,swap)
+ local pta,ptb
+ if swap == nil then
+ swap = false
+ end
+ if swap then
+ pta = rotation_ (self.pa,-phi,self.pb)
+ ptb = rotation_ (self.pb,phi,self.pa)
+ return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
+ else
pta = rotation_ (self.pa,phi,self.pb)
ptb = rotation_ (self.pb,-phi,self.pa)
return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
+end
end
-function line: gold ()
+function line: gold (swap)
local pt
+ if swap == nil then
+ swap = false
+ end
+if swap then
+ pt = rotation_ (self.pa,-math.pi/2,self.pb)
+ return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+else
pt = rotation_ (self.pa,math.pi/2,self.pb)
return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
end
+end
-function line: euclide ()
+function line: euclide (swap)
+ if swap == nil then
+ swap = false
+ end
+if swap then
+ return triangle : new (self.pa,self.pb, rotation_ (self.pa,-math.pi/5,self.pb))
+else
return triangle : new (self.pa,self.pb, rotation_ (self.pa,math.pi/5,self.pb))
end
+ end
-function line: golden ()
+function line: golden (swap)
local pt
+ local pta,ptb
+ if swap == nil then
+ swap = false
+ end
+if swap then
+ pt = rotation_ (self.pa,-2*math.pi/5,self.pb)
+ return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi)
+else
pt = rotation_ (self.pa,2*math.pi/5,self.pb)
return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi)
+ end
end
------------------------------
-- Result -> couple of points
------------------------------
-function line: square ()
- return square : side (self.pa,self.pb)
+function line: square (swap)
+ if swap == nil
+ then
+ return square : side (self.pa,self.pb)
+ else
+ return square : side (self.pa,self.pb,indirect)
+ end
+end
+
+function line : report (d,pt)
+ local t
+ t = d/self.length
+ if pt == nil
+ then
+ return barycenter_({self.pa,1-t},{self.pb,(t)})
+else
+ return barycenter_({self.pa,1-t},{self.pb,(t)}) +pt-self.pa
+end
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 4efa5b6169..86239953b6 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -37,6 +37,8 @@ require "tkz_elements_parallelogram.lua"
require "tkz_elements_quadrilateral.lua"
require "tkz_elements_rectangle.lua"
require "tkz_elements_square.lua"
+require "tkz_elements_misc.lua"
+require "tkz_elements_vector.lua"
require "tkz_elements_functions_maths.lua"
require "tkz_elements_functions_intersections.lua"
@@ -45,4 +47,3 @@ require "tkz_elements_functions_lines.lua"
require "tkz_elements_functions_circles.lua"
require "tkz_elements_functions_triangles.lua"
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
index 5667aba67f..f5f74a9a41 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_maths.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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
index 330fd53f01..4839dce030 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
@@ -1,6 +1,6 @@
-- tkz_elements_parallelogram.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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 32e549a749..c2a12932f7 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 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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
index 0731732310..011970ef53 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
@@ -1,6 +1,6 @@
-- tkz_elements_quadrilateral.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -49,7 +49,7 @@ function quadrilateral: new (za, zb, zc, zd)
return o
end
-----------------------
-function quadrilateral : cyclic ()
+function quadrilateral : iscyclic ()
local d,epsilon
epsilon = 10^(-8)
local alpha = point.arg ((self.pd-self.pa) / (self.pb-self.pa))
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
index 142ddbd8b2..7c53646978 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
@@ -1,6 +1,6 @@
-- tkz_elements-rectangle.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -59,36 +59,65 @@ function rectangle: new (za, zb,zc,zd)
end
function rectangle : angle (zi,za,an)
+ local zb,zc,zd
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)
+function rectangle : gold (za,zb,swap)
+ local zc,zd
+ local a = point.arg (zb-za)
+ local d = point.abs(zb-za)/tkzphi
+ if swap == nil then swap = false end
+ if swap then
+ zc = zb : south (d/scale)
+ zc = rotation_ (zb,a,zc)
+ zd = za : south (d/scale)
+ zd = rotation_ (za,a,zd)
+ return rectangle : new (za,zb,zc,zd)
+ else
+ zc = zb : north (d/scale)
+ zc = rotation_ (zb,a,zc)
+ zd = za : north (d/scale)
+ zd = rotation_ (za,a,zd)
+ return rectangle : new (za,zb,zc,zd)
+ end
end
-function rectangle : diagonal (za,zc)
- local zb = point (zc.re,za.im)
- local zd = point (za.re,zc.im)
+function rectangle : diagonal (za,zc,swap)
+ local zb,zd
+ if swap == nil then swap = false end
+ if swap then
+ zd = point (zc.re,za.im)
+ zb = point (za.re,zc.im)
+ return rectangle : new (za,zb,zc,zd)
+ else
+ zb = point (zc.re,za.im)
+ zd = point (za.re,zc.im)
return rectangle : new (za,zb,zc,zd)
end
+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)
+function rectangle : side (za,zb,d,swap)
+ local a,zc,zd
+ a = point.arg (zb-za)
+ if swap == nil then swap = false end
+ if swap then
+ zc = zb : south (d/scale)
+ zc = rotation_ (zb,a,zc)
+ zd = za : south (d/scale)
+ zd = rotation_ (za,a,zd)
+ return rectangle : new (za,zb,zc,zd)
+ else
+ zc = zb : north (d/scale)
+ zc = rotation_ (zb,a,zc)
+ zd = za : north (d/scale)
+ zd = rotation_ (za,a,zd)
return rectangle : new (za,zb,zc,zd)
end
+end
-------------------
function rectangle : get_lengths ()
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
index 4415b1c66f..bcf899f549 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
@@ -1,6 +1,6 @@
-- tkz_elements_regular.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
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
index 4dd007cc77..3e3724cd33 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
@@ -1,6 +1,6 @@
-- tkz_elements-square.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -72,10 +72,17 @@ function square : rotation (zi,za)
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)
+function square : side (za,zb,swap)
+ if swap == nil
+ then
+ local zc = rotation_ (zb,-math.pi/2,za)
+ local zd = rotation_ (za,math.pi/2,zb)
+ return square : new (za,zb,zc,zd)
+ else
+ local zc = rotation_ (zb,math.pi/2,za)
+ local zd = rotation_ (za,-math.pi/2,zb)
+ return square : new (za,zb,zc,zd)
+ end
end
return square \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
index 6ef6be0a9a..356b4cc76a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
@@ -1,6 +1,6 @@
-- tkz_elements_triangles.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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
@@ -396,6 +396,15 @@ end
function triangle: check_equilateral ()
return check_equilateral_ (self.pa,self.pb,self.pc)
end
+function triangle : soddy_center ()
+ local s,i,j,k
+ return soddy_center_ (self.pa,self.pb,self.pc)
+end
+function triangle : soddy_circle ()
+ local s,i
+ s,i = soddy_center_ (self.pa,self.pb,self.pc)
+ return circle : new ( s , i )
+end
return triangle \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
index 96d6eee1fc..3ac9aa877c 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
@@ -1,6 +1,6 @@
-- tkz_elements_vectors.lua
--- date 23/12/03
--- version 1.40c
+-- date 23/12/08
+-- version 1.50c
-- 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,12 +15,14 @@
-- ----------------------------------------------------------------------------
vector = {}
function vector: new(z1, z2)
- local type = 'vector'
- local norm = point.abs(z2-z1)
+ local type = 'vector'
+ local norm = point.abs (z2-z1)
+ local arg = point.arg (z2-z1)
local o = {st = z1,
- ed = z2,
- norm = norm,
- type = type }
+ ed = z2,
+ norm = norm,
+ arg = arg,
+ type = type }
setmetatable(o, self)
self.__index = self
return o
@@ -36,4 +38,9 @@ end
function vector: add (v)
return vector :new (self.st+v.st, self.ed,v.ed)
end
+
+ function vector: ortho ()
+ return vector : new (self.st, rotation_(self.st,math.pi/2,self.ed))
+ end
+
return vector