vector
v0.0.6createVector(x, y);
Create a vector instance
Arguments
x
The first component of the vectory
The second component of the vectorReturns
Vector
The created vector local a = createVector(3, 5);
local b = createVector(1, 3);
local c = a:add(b);
print(c);
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();
Vector.mult(a, b);
No description
Arguments
a
The first vectorb
The second vectorReturns
Vector
The added vector local a = createVector(3, 5);
local b = createVector(1, 3);
print(a:mult(b));
print(Vector.mult(a, b));
Vector.add(a, b);
No description
Arguments
a
The first vectorb
The second vectorReturns
Vector
The multiplied vector local a = createVector(1, 4);
local b = createVector(8, 2);
print(a:add(b));
print(Vector.add(a, b));