2D Dot Product Calculator

Vector \(\vec{a}\)
Vector \(\vec{b}\)

Dot Product Calculator

What is the Dot Product?

The dot product is like a special handshake between two vectors! Imagine you have two arrows, and you want to know how much they're pointing in the same direction. The dot product helps us figure that out. It's a way to multiply vectors that gives us a single number instead of another vector.

How to Calculate the Dot Product

To find the dot product of two vectors, we follow these friendly steps:

  • Multiply the x-parts of both vectors
  • Multiply the y-parts of both vectors
  • Add these two numbers together

Formula and Definition

For two vectors \(\vec{a} = (a_x, a_y)\) and \(\vec{b} = (b_x, b_y)\), their dot product is:

\[ \vec{a} \cdot \vec{b} = a_x b_x + a_y b_y \]

This magic number tells us how similar the vectors are in direction and how long they are!

Calculation Steps

  1. Write down the x and y parts of both vectors
  2. Multiply the x parts: \(a_x \times b_x\)
  3. Multiply the y parts: \(a_y \times b_y\)
  4. Add these two results together

Example and Visual Representation

Let's find the dot product of \(\vec{a} = (3, 4)\) and \(\vec{b} = (2, 1)\)

  1. We have \(\vec{a} = (3, 4)\) and \(\vec{b} = (2, 1)\)
  2. Multiply x parts: \(3 \times 2 = 6\)
  3. Multiply y parts: \(4 \times 1 = 4\)
  4. Add results: \(6 + 4 = 10\)

So, \(\vec{a} \cdot \vec{b} = 10\)

a b projection

This picture shows vectors \(\vec{a}\) (red) and \(\vec{b}\) (blue). The green dashed line is \(\vec{b}\) projected onto \(\vec{a}\). The dot product is related to this projection!