mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 23:33:53 +01:00
Fix vector.invert
This commit is contained in:
parent
228bfda006
commit
9bbbcae162
@ -105,9 +105,11 @@ function combinator(f)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function invert(v)
|
function invert(v)
|
||||||
|
local res = {}
|
||||||
for key, value in pairs(v) do
|
for key, value in pairs(v) do
|
||||||
v[key] = -value
|
res[key] = -value
|
||||||
end
|
end
|
||||||
|
return new(res)
|
||||||
end
|
end
|
||||||
|
|
||||||
add, add_scalar = combinator(function(v, w) return v + w end)
|
add, add_scalar = combinator(function(v, w) return v + w end)
|
||||||
|
Loading…
Reference in New Issue
Block a user