summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
index e9854efbe3..fe7b7a150b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
@@ -1,6 +1,6 @@
-- tkz_elements-square.lua
--- date 2024/01/16
--- version 1.82c
+-- date 2024/02/04
+-- version 2.00c
-- 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
@@ -17,15 +17,14 @@
square = {}
function square: new (za, zb,zc,zd)
- local d,epsilon
- epsilon = 10^(-8)
+ local d
local zi = midpoint_ (za,zc)
local zj = midpoint_ (zb,zd)
- if point.abs (zj-zi) < epsilon then else error ("it's not a square (center)")
+ if point.abs (zj-zi) < tkz_epsilon then else error ("it's not a square (center)")
end
- if math.abs(point.abs (zc-za) - point.abs (zd-zb)) < epsilon then else error ("it's not a square (diagonal)")
+ if math.abs(point.abs (zc-za) - point.abs (zd-zb)) < tkz_epsilon then else error ("it's not a square (diagonal)")
end
- if math.abs(point.abs (zb-za) - point.abs (zd-za)) < epsilon then else error ("it's not a square (side)")
+ if math.abs(point.abs (zb-za) - point.abs (zd-za)) < tkz_epsilon then else error ("it's not a square (side)")
end
local type = 'square'