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 = <u1·s, u2·s, u3·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]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki