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 = <u1-v1, u2-v2, u3-v3>

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]

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