Featured Posts

8. Bump Mapping in GLSL8. Bump Mapping in GLSL Introduction Bump mapping is essential in todays computer games, and computer graphics in general. Would you like to know the best thing about it? It is extremely simple to implement. Bump mapping works...

Read more

Swiftless GLSL Shader DeveloperSwiftless GLSL Shader Developer Swiftless GLSL Shader Developer   Version 0.1a Currently Swiftless GLSL Shader Developer is in it's first public release, and is currently in alpha status, meaning it is not complete and may contain...

Read more

Wordpress Optimization Wordpress Website Optimizations Introduction Wordpress itself is a fairly wonderful tool. Since switching to it, I find it is a lot quicker to make changes to my website and it is also quicker to get...

Read more

36. OpenGL Framebuffers36. OpenGL Framebuffers Introduction Frame buffers are one of those mythical things that we have all heard of, but many beginner OpenGL developers avoid because there is not much information about them, and they can be confusing...

Read more

1. Terrain Class1. Terrain Class Terrain is one of those things that so far, hasn't been perfectly recreated in computer graphics. But it is almost there! Looking over a beautiful landscape can be one of the most amazing feelings in the...

Read more

  • Prev
  • Next

5. Maths Vector Dot Product

Posted on : 25-03-2010 | By : Swiftless | In : Maths

Tags: , , , ,

0

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

VN:F [1.9.3_1094]
Please rate so I know where to improve the site. 1 means needs a lot of improvement, 10 means perfect. If you leave a low rating, please state why. I don't want people just coming to bash the site.
Rating: 8.0/10 (2 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)
5. Maths Vector Dot Product, 8.0 out of 10 based on 2 ratings

Related posts:

  1. 4. Maths Vector Length
  2. 3. Maths Lines
  3. 1. Maths Distance Formula
  4. 6. Maths Trigonometry
  5. 2. Maths Pythagoras Theorem

Write a comment

Improve the web with Nofollow Reciprocity.