summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua62
1 files changed, 32 insertions, 30 deletions
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
index 4a0c892f60..d68084d5f8 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
@@ -1,7 +1,7 @@
-- tkz_elements_triangles.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- 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
-- of this license or (at your option) any later version.
@@ -56,6 +56,15 @@ end
-----------------------
-- points --
-----------------------
+-- version 1.80
+function triangle: trilinear (a,b,c)
+ return barycenter_ ( {self.pa,a*self.a },{self.pb,b*self.b},{self.pc,c*self.c} )
+end
+
+function triangle: barycentric (a,b,c)
+ return barycenter_ ( {self.pa,a },{self.pb,b},{self.pc,c} )
+end
+
function triangle: bevan_point ()
return circum_center_ ( self : excentral_tr())
end
@@ -128,6 +137,11 @@ function triangle : point (t)
return self.ca : point ((t*p-self.c-self.b)/self.a)
end
end
+
+function triangle : soddy_center ()
+ local s,i,j,k
+ return soddy_center_ (self.pa,self.pb,self.pc)
+end
-------------------
-- Result -> line
-------------------
@@ -152,17 +166,20 @@ function triangle: symmedian_line (n)
end
function triangle: altitude (n)
- local a,b,c,o
+ local a,b,c,o,p
a = self.pa
b = self.pb
c = self.pc
o = ortho_center_ (a,b,c)
if n==1 then
- return line : new (b,intersection_ll_ (b,o,a,c))
+ p = projection_ (a,c,b)
+ return line : new (b,p)
elseif n==2 then
- return line : new (c,intersection_ll_ (c,o,a,b))
+ p = projection_ (a,b,c)
+ return line : new (c,p)
else
- return line : new (a,intersection_ll_ (a,o,b,c))
+ p = projection_ (b,c,a)
+ return line : new (a,p)
end
end
@@ -223,7 +240,7 @@ local a,b,c,i,u,v,w
end
end
-----------------------
--- circles --
+--- Result -> circles --
-----------------------
function triangle: euler_circle ()
return circle : new (euler_center_ ( self.pa , self.pb , self.pc),midpoint_( self.pb , self.pc))
@@ -281,6 +298,12 @@ local ma,mb,mc,sp
return circle : new (sp,projection_ (ma,mb,sp))
end
+
+function triangle : soddy_circle ()
+ local s,i
+ s,i = soddy_center_ (self.pa,self.pb,self.pc)
+ return circle : new ( s , i )
+end
-------------------
-- Result -> triangle
-------------------
@@ -367,19 +390,6 @@ function triangle: parallelogram ()
local x = self.pc + self.pa - self.pb
return x
end
-
-function triangle: check_equilateral ()
- local A,B,C,epsilon
- epsilon = 10 ^(-8)
- A = self.pb - self.pc
- B = self.pa - self.pc
- C = self.pa - self.pb
- if (point.abs(A)-point.abs(B) < epsilon) and (point.abs(B)-point.abs(C) < epsilon)
- then
- tex.print("equilateral !!")
- error("something went wrong!")
- end
-end
function triangle: area ()
return area_(self.pa,self.pb,self.pc)
@@ -396,15 +406,7 @@ end
function triangle: check_equilateral ()
return check_equilateral_ (self.pa,self.pb,self.pc)
end
-function triangle : soddy_center ()
- local s,i,j,k
- return soddy_center_ (self.pa,self.pb,self.pc)
-end
-function triangle : soddy_circle ()
- local s,i
- s,i = soddy_center_ (self.pa,self.pb,self.pc)
- return circle : new ( s , i )
-end
+
return triangle \ No newline at end of file