vector

v0.0.6
createVector(x, y);

Create a vector instance

Arguments

xThe first component of the vector
yThe second component of the vector

Returns

VectorThe created vector

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

local c = a:add(b);

print(c);
See createVector in lu5_vector.h
Vector.print();

Since a Vector implements a print method, it can be used in the print function

local a = createVector(3, 5);

-- With print
print(a);

-- With class method
Vector.print(a);

-- with instance
a:print();
See Vector.print in lu5_vector.h
Vector.mult(a, b);

No description

Arguments

aThe first vector
bThe second vector

Returns

VectorThe added vector

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

print(a:mult(b));
print(Vector.mult(a, b));
See Vector.mult in lu5_vector.h
Vector.add(a, b);

No description

Arguments

aThe first vector
bThe second vector

Returns

VectorThe multiplied vector

local a = createVector(1, 4);
local b = createVector(8, 2);

print(a:add(b));
print(Vector.add(a, b));
See Vector.add in lu5_vector.h