function vector.add(a, b)
assert_vector(a)
- assert_vector(b)
if type(b) == "table" then
+ assert_vector(b)
return {x = a.x + b.x,
y = a.y + b.y,
z = a.z + b.z}
function vector.subtract(a, b)
assert_vector(a)
- assert_vector(b)
if type(b) == "table" then
+ assert_vector(b)
return {x = a.x - b.x,
y = a.y - b.y,
z = a.z - b.z}
function vector.multiply(a, b)
assert_vector(a)
- assert_vector(b)
if type(b) == "table" then
+ assert_vector(b)
return {x = a.x * b.x,
y = a.y * b.y,
z = a.z * b.z}
function vector.divide(a, b)
assert_vector(a)
- assert_vector(b)
if type(b) == "table" then
+ assert_vector(b)
return {x = a.x / b.x,
y = a.y / b.y,
z = a.z / b.z}