##### Usage

Syntax:

`vectorsub(array u, array v);`

Returns a third vector.

##### 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}.

What

`vectorsub`does, is that it creates a third vector by taking the terminal coordinates from both vectors and substract them with eachother, to create a new vector:

w = <u

^{1}-v

^{1}, u

^{2}-v

^{2}, u

^{3}-v

^{3}>

##### Example

function onCreated() { temp.u = {5, 2, 1}; temp.v = {2, 1, 1}; temp.w = vectorsub(u, v); }

... Will set

`temp.w`to {3, 1, 0}

##### Categories

CategoryFunctionClientside

CategoryFunctionServerside

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