mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2024-12-28 20:00:41 +01:00
Removed useless functions get_point_location and geometry.area
This commit is contained in:
parent
14163681cc
commit
43211fc31b
11
geometry.lua
11
geometry.lua
@ -28,18 +28,7 @@ local function transform_quadri(X, Y, x, y)
|
||||
return xc, yc
|
||||
end
|
||||
|
||||
local function area(X, Y) -- Signed area of polygon, in function of direction of rotation. Clockwise = positive.
|
||||
local n = #X
|
||||
local sum = X[1]*Y[n] - X[n]*Y[1]
|
||||
for i=2, n do
|
||||
sum = sum + X[i]*Y[i-1] - X[i-1]*Y[i]
|
||||
end
|
||||
|
||||
return sum/2
|
||||
end
|
||||
|
||||
return {
|
||||
distance_to_segment = distance_to_segment,
|
||||
transform_quadri = transform_quadri,
|
||||
area = area,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user