Usage

Syntax: vectordot(array u, array v);
Returns the dot product of vector u and vector 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}.

vectordot is written as u•v and should not be mixed with u·v. What vectordot does, is that it returns a number. This number is the sum of products of each component of the vector.

u•v = {u1,u2,u3}•{v1,v2,v3} = u1·v1 + u2·v2 + u3·v3

Example

function onCreated() {
  temp.v = {3, 5, 7};
  temp.u = {9, 4, 2};

  temp.dot = vectordot(u, v);
}

... Will set temp.dot to 61

Categories

CategoryFunctionClientside
CategoryFunctionServerside
Comments [Hide comments/form]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki