summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua')
-rw-r--r--Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua43
1 files changed, 19 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua b/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua
index 59454e78f02..9937c0589dd 100644
--- a/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua
+++ b/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_functions_points.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_points.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -23,30 +23,29 @@ function polar_ (radius, phi)
end
function barycenter_ (...)
-local cp = table.pack(...)
-local i
-local sum = 0
-local weight=0
-for i=1,cp.n do
- sum = sum + cp[i][1]*cp[i][2]
- weight = weight + cp[i][2]
-end
-return sum/weight
+ local cp = table.pack(...)
+ local sum = 0
+ local weight = 0
+ for i = 1, cp.n do
+ sum = sum + cp[i][1] * cp[i][2]
+ weight = weight + cp[i][2]
+ end
+ return sum / weight
end
-function rotation_ (c,a,pt)
- local z = point( math.cos(a) , math.sin(a) )
- return z*(pt-c)+c
+function rotation_ (c, a, pt)
+ local z = point(math.cos(a), math.sin(a))
+ return z * (pt - c) + c
end
-function set_rotation_ (c,angle,...)
+-- Define the set_rotation_ function
+function set_rotation_ (c, angle, ...)
local tp = table.pack(...)
- local i
local t = {}
for i=1,tp.n do
- table.insert( t , rotation_(c , angle , tp[i] ))
+ table.insert(t, rotation_(c, angle, tp[i]))
end
- return table.unpack ( t )
+ return table.unpack(t)
end
function symmetry_(c,pt)
@@ -55,8 +54,7 @@ end
function set_symmetry_ (c,...)
local tp = table.pack(...)
- local i
- local t = {}
+ local t = {}
for i=1,tp.n do
table.insert( t , symmetry_ (c , tp[i]) )
end
@@ -69,8 +67,7 @@ end
function set_homothety_ (c,coeff,...)
local tp = table.pack(...)
- local i
- local t = {}
+ local t = {}
for i=1,tp.n do
table.insert( t , homothety_ (c, coeff , tp[i]) )
end
@@ -83,7 +80,6 @@ end
function set_translation_ (u,...)
local tp = table.pack(...)
- local i
local t = {}
for i=1,tp.n do
table.insert( t , (u + tp[i]) )
@@ -101,7 +97,6 @@ end
function midpoints_ (...)
local arg = table.pack(...)
local n = arg.n
- local i
local t = {}
for i=1, n-1 do
table.insert( t , (arg[i]+arg[i+1])/2 )