summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua58
1 files changed, 3 insertions, 55 deletions
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 834317aae4..ed4dd949a1 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/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
@@ -55,56 +55,4 @@ function radical_circle (C1,C2,C3)
return C1 : orthogonal_from (rc)
end
end
--- version 1.60 new
-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
--- version 1.60 new
-function midcircle_(C1,C2)
- local state,r,s,t1,t2,T1,T2,p,a,b,c,d,Cx,Cy,i,j
- state = circles_position(C1,C2)
- i = barycenter_ ({C2.center,C1.radius},{C1.center,-C2.radius})
- j = barycenter_ ({C2.center,C1.radius},{C1.center,C2.radius})
- t1,t2 = tangent_from_ (C1.center,C1.through,i)
- T1,T2 = tangent_from_ (C2.center,C2.through,i)
-
- if (state == 'outside') or (state == 'outside tangent')then
- p = math.sqrt(point.mod(i-t1)*point.mod(i-T1))
- return circle : radius (i,p)
- elseif state == 'intersect' then
- r,s = intersection (C1,C2)
- return circle : radius (i,point.mod(r-i)) , circle : radius (j,point.mod(r-j))
- elseif (state == 'inside') or (state == 'inside tangent') then
- a,b = intersection_lc_ (C1.center,C2.center,C1.center,C1.through)
- c,d = intersection_lc_ (C1.center,C2.center,C2.center,C2.through)
-
- if C1.radius < C2.radius then
- z.u, z.v, z.r, z.s = a, b, c, d
- else
- z.u, z.v, z.r, z.s = c, d, a, b
- end
-
- if (in_segment_ (z.s,z.v,z.u) == true)
- then
- Cx = circle : diameter (z.r,z.v)
- Cy = circle : diameter (z.u,z.s)
- else
- Cx = circle : diameter (z.s,z.v)
- Cy = circle : diameter (z.u,z.r)
- end
- if (Cx.radius) < (Cy.radius) then
- return Cy : orthogonal_from (j)
- else
- return Cx : orthogonal_from (j)
- end
- end
-end \ No newline at end of file
+