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