5. Maths Vector Dot Product

Here we are going to be looking at the infamous dot product AKA scalar product.

Dot products are used in computer programming to work out normals for 3d objects. A normal is a vector, perpendicular to the plane it is on.

I couldn’t really find a meaning to what the dot product actually is. So I am going to class it as a means of finding an angle or a length of a vector.

Now there are 3 main ways for writing a dot product equation.

a.b = a1b1 + a2b2 = |a| |b| cos @

Where a.b = [a1, b1] . [a2, b2]

a.b = a1 * b1 + a2 * b2

Which comes out the same as our second formula. While our third formula takes the length of a times by the length of b times by the cosine of theta where theta is the angle between vectors a and b.

Now if the angle between a and b is equal to 90 then a is perpendicular to b.

And that is all there really is to the infamous dot product. It is a rather simple concept really.

So lets have a little play with that. Say we have the points:

AB = [4, -2]

BC = [-1, -2]

And we want to find out if AB is perpendicular to BC. We now have to do the dot product. We cannot use the third method as we don’t know any angles, although we could work them out, but I will explain that in a different topic. As the third equation is simply ‘plug n play’, whack in the numbers and press the calculate button on your calculator.

So to find the dot product we get:

AB . BC

AB . BC = (4 * -1) + (-2 * -2)

AB . BC = -4 + 4

AB . BC = 0

Therefore AB is perpendicular to BC.

If you have any questions, please email me at swiftless@gmail.com

  • March 25, 2010