##### Usage

Syntax:

`vectoradd(array v, int s);`

Returns a third vector that is s times larger then v.

##### Explanation

Vectors are often written as <x,y,z>, however in Graal they are written as arrays and often use these syntaxes: {x, y, z} or {x, y}.

`vectorscale(vector, scalar)`

What

`vectorscale`does, is that it takes the scalar and multiplies it with the vector to create a new vector:

w = <u

^{1}·s, u

^{2}·s, u

^{3}·s>

##### Example

function onCreated() { temp.v = {1, 1, 0}; temp.s = 2; temp.w = vectorscale(u, s); }

... Will set

`temp.w`to {2, 2, 0}

##### Categories

CategoryFunctionClientside

CategoryFunctionServerside

There are no comments on this page. [Add comment]