diff options
author | Karl Berry <karl@freefriends.org> | 2023-12-24 21:27:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-12-24 21:27:27 +0000 |
commit | c16546b173c598fe2e60f698d6da538fa9ba3255 (patch) | |
tree | eb378fd28f0b16bd02bf8c89d2bb894fdf2eb652 /Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua | |
parent | d2ab9e4a72f22d93170a6a98feb66414d8447461 (diff) |
tkz-elements (24dec23)
git-svn-id: svn://tug.org/texlive/trunk@69213 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua')
-rw-r--r-- | Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua b/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua index 6329495465d..e81609f6ee4 100644 --- a/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua +++ b/Master/texmf-dist/tex/latex/tkz-elements/tkz_elements_circle.lua @@ -1,6 +1,6 @@ -- tkz_elements-circles.lua --- date 23/12/14 --- version 1.60c +-- date 23/12/24 +-- version 1.72c -- 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,6 +17,9 @@ circle = {} function circle: new (c, t) -- c --> center t --> through local type = 'circle' + local ra = line :new (c,t) + local anti = antipode_ (c,t) + local di = line : new (anti, t) local radius = point.abs ( c - t ) local south = c - point (0,radius) local east = c + point (radius,0) @@ -24,6 +27,8 @@ function circle: new (c, t) -- c --> center t --> through local west = c - point (radius,0) local o = { center = c, through = t, + ra = ra, + di = di, radius = radius, south = south, east = east, @@ -69,6 +74,19 @@ function circle: in_out_disk (pt) return false end end + +function circles_position (C1,C2) + local d,max,min + d = point.mod(C1.center-C2.center) + max = C1.radius + C2.radius + min = math.abs ( C1.radius - C2.radius) + if d > max then return "outside" + elseif d == max then return "outside tangent" -- epsilon + elseif d == min then return "inside tangent" -- epsilon + elseif d < min then return "inside" + else return "intersect" + end +end ----------------------- -- real -- ----------------------- @@ -217,16 +235,6 @@ function circle: inversion (...) return table.unpack ( t ) 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 @@ -235,6 +243,9 @@ function circle: draw () local frmt = '\\draw (%0.3f,%0.3f) circle [radius=%0.3f];' tex.sprint(string.format(frmt, x,y,r)) end - - + +function circle: midcircle(C) + return midcircle_ (self,C) +end + return circle
\ No newline at end of file |