- Add function getAvgPoint()

- Add function getRandPointInCircle()
- Add getRandomPointInPoly()
This commit is contained in:
2025-01-02 19:37:02 +08:00
parent 7429edb779
commit 7bafa23bb5
+10 -1
View File
@@ -48,6 +48,15 @@ do
trigger.action.outText(text,displayTime,clearview)
end
function Utils.getTableSize(table)
local tableSize = 0
for _,_ in pairs(table) do
tableSize = tableSize + 1
end
return tableSize
end
--- Creates a deep copy of a object.
-- Usually this object is a table.
-- See also: from http://lua-users.org/wiki/CopyTable
@@ -247,7 +256,7 @@ do
radius = Utils.get2DDist(avg, zone[i])
end
if Utils.get2DDist(avg, zone[i]) < minR then
minR = Utils.utils.get2DDist(avg, zone[i])
minR = Utils.get2DDist(avg, zone[i])
end
end
--log:warn('minR: $1', minR)