# What exactly is the Dot Product?

This topic is 5130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, My book states that the dot product is an operation used through 3D graphics and its also called the inner product. My book also says that you could use the dot product to calculate the angle between two vectors like so :
Vector3 vA, vB ;

// Basically you get the dotProduct between both vectors divided by the
// product of both magnitudes <b>and then</b> get the inverse cosine of that value.
float fAngle = acosf( vA*vB / vA.Length()*vB.Length() ) ;

// Note : Vector3::operator* returns the dotProduct
// and Vector3::Length() returns the magnitude.


Ok.........but what exactly is the dot product? What does it return? From the above equation all the dot product serves as is a small tool to find the angle between two vectors.

##### Share on other sites
Thats like saying 'what is multiplication' or 'what is addition'. The dot product is defined between two vectors as:

A dot B = |A| * |B| * cos( theta )

Where theta is the angle between A and B.

If A and B are represented by triples then:

A dot B = Ax * Bx + Ay * By + Az * Bz

(or Ax * Bx + Ay * By in two dimensions, similar for extension to other dimensions)

Also beware the term 'inner product'. There are many inner products, defined in different ways on different spaces. The dot product as above is the main inner product used in graphics though.

Try MathWorld for a more detailed treatment.

##### Share on other sites
Alright. My apoligies for asking a real stupid question. Its just my book gave a very poor explanation of it and I was lost in the dark.

Thank you...

##### Share on other sites
Hehe, give me a chance to finish editing :) It wasn't a stupid question, but a bit of google research would have answered it better than any post here.

##### Share on other sites
a dot product is an operation between two elements of a vector space Rn (vector space of dimension n). it is called inner product as it operates on two elements of the same vector space and returns a scalar value k (element of R, real values). if it would not be an inner product it would operate an element of Rn on some element not in Rn (like for example scaling a vector with a value from R). the dot product is used to defined ortogonality. so if you've got a base of Rn (n vectors, non-linear-combinable) then you can define them beeing ortogonal if they all do pair-wise have a dot-product of 0.

i'm no native english speaker thus it's a bit tricky to find the correct terms. i hope i made no mistake here. ^_^

EDIT: duh... over-edited with 3 postings... some are quick at writing ^_^

##### Share on other sites
I don't think you quite understand either, perhaps if you read the link I gave you'd get a better idea. The dot product is *one way* of multiplying vectors together to give a scalar, and you can't differentiate that meaning from all of the other ones we gave (they're all essentially equivalent, given the constraints that have been mentioned).

Simplistic answers to questions like this help absolutely noone, it is vitally important to understand the what and why in order to correctly use any concept.

Using the * operator is in general not a very good idea for the dot product because the semantics are different between vectors and scalars:

SCALAR = SCALAR * SCALAR
SCALAR = VECTOR dot VECTOR
VECTOR = SCALAR * VECTOR

The * is used between members of the field you're working in, and for operations between the field and vector space. The dot product is a fundamentally different operation and should use a different operator (or explicit function).

##### Share on other sites
Quote:
 a dot product is an operation between two elements of a vector space Rn (vector space of dimension n).

Nitpick: you can define inner products on other vector spaces than R^n, and there are other n-dimensional spaces than R^n.

Quote:
 at the most fundamental level, that's what it "really is."

What on earth could be more fundamental than the actual definition (which was given in the first reply)?

##### Share on other sites
Quote:
 Original post by MuzzafarathWhat on earth could be more fundamental than the actual definition (which was given in the first reply)?

RPTD's formal definition. The specific definition you refer to is just one consequence of that lemma. The OP's questiion was pretty ambigious, though [smile]

##### Share on other sites
Quote:
 Original post by shadow12345No, it's the only way of multiplying a vector with another vector. Multiplying a vector by a scalar is different, and I'm pretty sure that's not called a dotproduct.

##### Share on other sites
Quote:
 RPTD's formal definition. The specific definition you refer to is just one consequence of that lemma. The OP's questiion was pretty ambigious, though

RPTD didn't give the full definition anyway, any function that takes two vectors and spits out a real number is not an inner product. There's more to it than that.

And I assure you that the definition of the "usual" dot product in R^3 is not the consequence of any lemma (then it wouldn't be a definition).

Quote:
 No, it's the only way of multiplying a vector with another vector. Multiplying a vector by a scalar is different, and I'm pretty sure that's not called a dotproduct.

I see. So I guess "weighted dot products" (that's probably not what they're called in English) don't exist then...

*edit*

Quote:
 So, umm, doesn't this only back up what I was saying?

No. It says that the "usual" dot product is /A/ way to multiply two vectors. Not /the only/ way.

1. 1
2. 2
Rutin
21
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013603
×