Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 805 Bytes

dot.md

File metadata and controls

20 lines (13 loc) · 805 Bytes

Dot Product

The dot product operates on matrices of the same size. It is calculated as the sum of the products of the matrix components.

For example:

$$ \begin{bmatrix}1 \\2 \end{bmatrix}\dot{}\begin{bmatrix}3 \\4 \end{bmatrix} \equiv (1 * 3) + (2 * 4) = 14 $$

$$ \begin{bmatrix}1 \\2 \\3 \end{bmatrix}\dot{}\begin{bmatrix}4 \\5 \\6 \end{bmatrix} \equiv (1 * 4) + (2 * 5) + (3 * 6) = 32 $$

The WASM dot product instruction operates on 4 pairs of 2x1 matrices.

Dot Product

For a more detailed explanation of why the dot product is useful and how it can be derived, watch Grant Sanderson's excellent video, which is part of a larger series on the Essence of Linear Algebra