Add vector.distance

This commit is contained in:
Lars Mueller 2021-02-06 18:07:50 +01:00
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