Wilang Documentation1.0.0+4

dot#

Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn

Available in: math cells, REPL.

Syntax#

dot(A, B)
A * B

Arguments and behavior#

For matrices, dimensions must match the operation. Singular matrices or incompatible shapes can fail. Cell indexing starts at 1. The example returns scalar (number).

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
dot([2, 4, 1], [2, 2, 3])

Expected result: 15.

See also#

multiply · cross

All functions · Math guides