- 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
@@ -47,6 +47,15 @@ do
trigger.action.outText(text,displayTime,clearview) trigger.action.outText(text,displayTime,clearview)
end 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. --- Creates a deep copy of a object.
-- Usually this object is a table. -- Usually this object is a table.
@@ -247,7 +256,7 @@ do
radius = Utils.get2DDist(avg, zone[i]) radius = Utils.get2DDist(avg, zone[i])
end end
if Utils.get2DDist(avg, zone[i]) < minR then if Utils.get2DDist(avg, zone[i]) < minR then
minR = Utils.utils.get2DDist(avg, zone[i]) minR = Utils.get2DDist(avg, zone[i])
end end
end end
--log:warn('minR: $1', minR) --log:warn('minR: $1', minR)