diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua')
-rw-r--r-- | Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua b/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua index a4527c779b9..65c197d3152 100644 --- a/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua +++ b/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_regular.lua @@ -1,6 +1,6 @@ -- tkz_elements_regular.lua --- date 2024/07/16 --- version 2.30c +-- date 2025/01/06 +-- version 3.10 -- Copyright 2024 Alain Matthes -- This work may be distributed and/or modified under the -- conditions of the LaTeX Project Public License, either version 1.3 @@ -11,32 +11,36 @@ -- version 2005/12/01 or later. -- This work has the LPPL maintenance status “maintained”. -- The Current Maintainer of this work is Alain Matthes. - +-- za = center zb a vertex regular_polygon = {} function regular_polygon: new (za, zb ,nb) local type = 'regular_polygon' - local table = regular_ (za , zb , nb) + 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 circumradius = point.abs (zb-za) local circle = circle : new (za,zb) - local inradius = exradius * math.cos(math.pi/nb) - local side = exradius * math.sin(math.pi/nb) + local inradius = circumradius * math.cos(math.pi/nb) + local side = circumradius * math.sin(math.pi/nb) local next = table[2] local first = table[1] local proj = projection_ (first,next,za) + local perimeter = nb * side + local area = (perimeter * inradius)/2 local o = { type = type, center = center, through = through, - exradius = exradius, + circumradius= circumradius, inradius = inradius, table = table, circle = circle, nb = nb, angle = angle, side = side, - proj = proj } + proj = proj, + perimeter = perimeter, + area = area} setmetatable(o, self) self.__index = self return o @@ -52,7 +56,7 @@ end ----------------------- function regular_polygon : incircle () local next,first - next = self.table[2] + next = self.table[2] first = self.table[1] return circle : new ( self.center , projection_ (first,next,self.center) ) end |