Skip to content

Commit fd8f63b

Browse files
committed
Fixed edges midpoint calculation (fixes #2)
1 parent 54698f6 commit fd8f63b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

delaunay.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ end
112112
--
113113
function Edge:getMidPoint()
114114
local x = self.p1.x + (self.p2.x - self.p1.x) / 2
115-
local y = self.p1.x + (self.p2.y - self.p1.y) / 2
115+
local y = self.p1.y + (self.p2.y - self.p1.y) / 2
116116
return x, y
117117
end
118118

@@ -264,7 +264,7 @@ end
264264
-- @usage
265265
-- local p1, p2, p3 = Point(), Point(2,0), Point(1,1)
266266
-- local t = Triangle(p1, p2, p3)
267-
-- print(t:getCircumCircle()) --> 1 0 1
267+
-- print(t:getCircumCircle()) --> 1 0 1
268268
--
269269
function Triangle:getCircumCircle()
270270
local x, y = self:getCircumCenter()
@@ -278,7 +278,7 @@ end
278278
-- @usage
279279
-- local p1, p2, p3 = Point(), Point(2,0), Point(1,1)
280280
-- local t = Triangle(p1, p2, p3)
281-
-- print(t:getCircumCenter()) --> 1 0
281+
-- print(t:getCircumCenter()) --> 1 0
282282
--
283283
function Triangle:getCircumCenter()
284284
local p1, p2, p3 = self.p1, self.p2, self.p3

0 commit comments

Comments
 (0)