Vector.sub

v0.1.7
Vector.sub(a, b);

No description

Arguments

aThe first vector
bThe second vector

Returns

VectorThe subtracted vector

local a = createVector(3, 5);
local b = createVector(2, 3);

-- Non-mutable
print(Vector.sub(a, b)); -- { 1.0, 2.0 }
print(a - b);            -- { 1.0, 2.0 }
print(a);                -- { 3.0, 5.0 }

-- Mutable
print(a:sub(b)); -- { 1.0, 2.0 }
print(a);        -- { 1.0, 2.0 }
See Vector.sub in lu5_vector.h