Advertisement

How does dot product return Angle???

Started by July 31, 2002 12:36 PM
16 comments, last by crakinshot 22 years, 6 months ago
quote:
Original post by crakinshot
ahh man... this is a tad confussing at first.... the Cross product of 2 vectors returns the normal vector... which I believe is perpendicular to the plane... but becuase I''m also a 3d modeler I see normals as being a vector from the center of the plane moving outward.. the way the plane is facing...

so now I have two different conflicting versions of what a plane normal is...



No, those are the same version. In both cases, the normal is a vector perpendicular to the plane.



Don''t listen to me. I''ve had too much coffee.
I''m stupid yes... hehe... just looked up the word perdendiculer... which I though was the same as parallel. but in fact right angled vector from the plane.

the reason I was confused was because in opengl game programming there is a picture which has a normal vector that seems to be parallel to the face...

bah... hehe...
-=CrAKiN:ShOt=-I could put something witty here but I'm not that stupid...
Advertisement
Please don''t forget that the dot product of two vectors is the cosine of the angle between them SCALED by their lengths. If you''re not working with unit vectors, you will need to divide out the lengths of one or both of the two vectors, before computing arccosine.

yeah thanks I''ll keep in mind I need to use normalised vectors then...
-=CrAKiN:ShOt=-I could put something witty here but I'm not that stupid...
Okay, hopefully I can add to the discussion and clear up any lasting confusion you have crakinshot. My apologies for anything below that is trivial to you... I just want to fill in all the pieces of the puzzle.

The dot product (also called the inner product) of two vectors can be used to compute the scalar projection of one vector onto the other. If these two vectors are unit vectors, then the result is equivalent to the cosine of the angle between the unit vectors, as mentioned by several previous posters.

Draw two vectors, with a common origin, on a piece of paper. Now rotate the paper so that one of the vectors is horizontal and pointing to the right. Call it A . The scalar projection of the other vector, B , onto A is given by
         A.B    compAB = ---         |A| 


This can also be seen to be the component of the vector A that lies in the direction of B .

It can be shown (by employing the law of cosines and vector calculus) that
              A      B    cos(theta) = --- . ---             |A|   |B| 


where theta is the angle between A and B .

There are some other elegant results involving the dot (inner) product operator, but I'll leave them for another day!

Cheers,

Timkin

[edited by - Timkin on August 2, 2002 10:13:06 PM]
Just to add to Timkins post, the dot product is also called the "Scalar" product.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Advertisement
Hehe... thanks for picking up my ommission python... it was a long day yesterday and I was a bit out of it when I wrote my post... in fact, I would suspect that the dot product is more often referred to as the scalar product than the inner product!

Cheers,

Timkin
The cross product returns the normal which is orthogonal to the plane, perpendicular is for 2D (very similar concept though).

This topic is closed to new replies.

Advertisement