mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 23:33:53 +01:00
Add vector.distance
This commit is contained in:
parent
3807c32df5
commit
386f49a6ac
@ -124,8 +124,8 @@ end
|
||||
|
||||
function norm(v)
|
||||
local sum = 0
|
||||
for _, c in pairs(v) do
|
||||
sum = sum + c*c
|
||||
for _, value in pairs(v) do
|
||||
sum = sum + value ^ 2
|
||||
end
|
||||
return sum
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user