Compute the dot product of two 3-component vectors by multiplying corresponding components and accumulating a running sum. Each term contributes one product; the running sum grows after every step. The final sum is the scalar dot product.

Example

Multiply matching components and update the running dot-product total.

highlighted = computed this step

Step 1 — Set up

Start with both vectors before multiplying matching components.

u=[213],v=[421]u=\begin{bmatrix}2\\-1\\3\end{bmatrix},\quad v=\begin{bmatrix}4\\2\\-1\end{bmatrix}

Step 2 — First product

Multiply the first components and start the total: 2 * 4 = 8.

24=8,uv=82\cdot 4=8,\quad u\cdot v=\hl{8}

Step 3 — Second product

Add the second product: 8 + -2 = 6.

(1)2=2,uv=6(-1)\cdot 2=-2,\quad u\cdot v=\hl{6}

Step 4 — Third product

Add the third product: 6 + -3 = 3.

3(1)=3,uv=33\cdot (-1)=-3,\quad u\cdot v=\hl{3}

Step 5 — Result

Read the completed dot product.

uv=3u\cdot v=3
dot product The dot product u · v = u[1]v[1] + u[2]v[2] + ... + u[n]v[n] is a scalar that measures the alignment of two vectors. It is zero when the vectors are perpendicular.