dot (Vector)

Returns dot-product of two vectors with the same dimension.

Arguments

vector0
and
vector1
are the Vectors to calculate dot-product for. If their dimensions are different, an error will occur.

Return values

Real

number
is the dot-product of the vectors.

Complexity

O(dimension)

Example

"sl/algebra" useFile v1: (1.0 3.0 2.0) makeVector; v2: (1.0 1.0 5.0) makeVector; v1 v2 dot print
Output:
14.000000