vector.cross3: Assert dimension = 3

This commit is contained in:
Lars Mueller 2021-03-24 10:42:28 +01:00
parent 7507209f29
commit 02f24dd59f

@ -160,6 +160,7 @@ function clamp(v, min, max)
end
function cross3(v, w)
assert(#v == 3 and #w == 3)
return new{
v[2] * w[3] - v[3] * w[2],
v[3] * w[1] - v[1] * w[3],