Usage
Syntax: vectoradd(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 vectoradd does, is that it creates a third vector that has the magnitude of vector v and vector u. It simply takes the terminal point coordinates from both vectors and adds them together, to create a new vector:
w = <u1+v1, u2+v2, u3+v3>
Example
function onCreated() { temp.v = {1, 1, 0}; temp.u = {4, 2, 1}; temp.w = vectoradd(u, v); }
... Will set temp.w to {5, 3, 1}
Categories
CategoryFunctionClientside
CategoryFunctionServerside
There are no comments on this page. [Add comment]