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.

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.

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=[2−13],v=[42−1]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.

2⋅4=8,u⋅v=82\cdot 4=8,\quad u\cdot v=\hl{8}

Step 3 — Second product

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

(−1)⋅2=−2,u⋅v=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,u⋅v=33\cdot (-1)=-3,\quad u\cdot v=\hl{3}

Step 5 — Result

Read the completed dot product.

u⋅v=3u\cdot v=3