##### 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 = {u

^{1},u

^{2},u

^{3}}•{v

^{1},v

^{2},v

^{3}} = u

^{1}·v

^{1}+ u

^{2}·v

^{2}+ u

^{3}·v

^{3}

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

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