summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
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/tkz-elements/latex/tkz_elements_functions_points.lua
parentde2c50ca7889fda13da11c1ccf6bdbd199ba8c2b (diff)
CTAN sync 202312040301
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua39
1 files changed, 35 insertions, 4 deletions
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
+