0 like 0 dislike
0 like 0 dislike
what on gods green earth is dot product?

15 Answers

0 like 0 dislike
0 like 0 dislike
Presumably the scalar product between two vectors - it's the projection of how much one vector is in the direction of another one, multiplied by the length of the other one.  

If you drew right angled triangles between them, that's where the cosine comes from
0 like 0 dislike
0 like 0 dislike
How:

    (2,3) • (5,7)   =  2·5    + 3·7  =  31
    (9,4) • (-2,6)  =  9·(-2) + 4·6  =  6

    (9,4,3) • (-2,6,5)  =  9·(-2) + 4·6 + 3·5     =  21
    (2,3,4) • (5,7,-8)  =     2·5 + 3·7 + 4·(-8)  =  -1

     (9,4)²  =   (9,4)•(9,4)   =     9·9    + 4·4  =  97
    (-2,6)²  =  (-2,6)•(-2,6)  =  (-2)·(-2) + 6·6  =  40

Why:

If you move into a certain direction, you can express this as a **vector**

    North 4m/s, East 6m/s                (6,4)
    North 1m/s, West 3m/s, Up 5m/s      (-3,1,5)

Sometimes, it is helpful to determine the **angle** between **two vectors**. This can be done with the **cosine law** in combination with vectors, which leads you to the dot product

                                 (9,4) • (-2,6)               6
    ∡<(2,3), (5,7)>  =  arccos  ---------------  =  arccos -------  ≈  84.5°
                                √(9,4)²·√(-2,6)²           √97·√40

It is easier to determine if two vectors are **orthogonal/perpendicular** to each other, since arccos(0) = 0° you only need to check the dot product

     (2,3)•(5,7) = 31    not orthogonal
    (2,3)•(-9,6) = 0     orthogonal

The calculations above also work for three-dimensional including the z-axis
0 like 0 dislike
0 like 0 dislike
Maybe you should describe exactly what you're using it for. What context do you encounter it? Then people can give a more detailed response.

Dot product take in 2 vectors and produce a number. 3 important properties about dot vector:

- You can compute it easily from the coordinates of vectors: just take sum of product of corresponding coordinate.

- You can figure out the length of a vector from it: dot product of a vector with itself is square of the length.

- You can figure out cosine of the angle between 2 vectors from it: dot product between 2 vectors, divided by the product of both of their length, is the cosine of the angle.
0 like 0 dislike
0 like 0 dislike
A vector is like the X, Y, Z position of a point relative to an origin.

It should be intuitive via living in our 3D world that an X, Y, Z point in say your room has some angle from the most north-west corner of your room and it's edges. In fact, if you were to use your head as a point, and take a string and protractor you could easily measure the angle from the magic corner over the string to say the edge of your north wall.

In the above example there are two vectors, the one from the magic corner to your head, and the one along the edge of the floor and the north wall.

With both vectors being unit length, the dot product just calculates the same angle the protractor did, but has a weird scale. It also works in more or less dimensions. When lengths differ it also 'weighs' the lengths which is useful for figuring out how the result of two unequal forces in different directions combines.
0 like 0 dislike
0 like 0 dislike
Suppose you want to know on which side of a line something is on.  Suppose the equation of the line (in x,y space) is ax + by = c.  This can be written as a dot product:  (a,b) • (x,y) = c.

Now suppose you compute (a,b) • (x,y) for some locations.  Those where the answer is below c are on one side of the line while those where the answer is above c are on the other side.
0 like 0 dislike
0 like 0 dislike
Yeah.  **a** · **b** = cos(ø)·(||**a**||·||**b**||).  This means: take the dot product of two vectors, and that's equal to the cosine of the angle between them times their lengths.  This lets you easily figure out the angle between two vectors.  If the vectors have length 1 already (they're unit vectors), then the dot product *is* the cosine of the angle.  A useful property is that **a** · **a** = ||**a**||^(2), which makes sense since ø = 0 in that case.  So if you want the length of a vector, just dot it with itself and take the square root.  Another useful property is that if two vectors are perpendicular, **a** · **b** = 0, since cos(90°) = 0.

To actually compute the dot product, if your vector is written as components in Cartesian coordinates, say, <a, b, c> and <d, e, f>, then <a, b, c> · <d, e, f> = ad + be + cf.  Real easy.

The cross product is more annoying to calculate -- you can look that up yourself if you want -- but what you get is a new vector, not a number.  If **a** X **b** = **c**, then **c** is perpendicular to both **a** and **b** (if you hold your right hand in the direction of **a** and curl your fingers towards **b**, your thumb will point in the direction of **c** -- but it has to be the right hand; the left hand will point towards –**c**!), and ||**c**|| = sin(ø)·(||**a**||·||**b**||) -- that's the same as the dot product, except here it's sine rather than cosine.  An important consequence of this is that **a** X **a** = **0**, since ø = 0 and sin(0) = 0.  Also, cross product is anti-symmetric: **a** X **b** = –(**b** X **a**).

If you're dealing with unit vectors that are perpendicular to each other, then **u** X **v** = **w** is another unit vector perpendicular to both of them.  This is useful when talking about, say, a path.  You're traveling along a path with a tangent unit vector **t**.  Your head is perpendicular to your body in the direction **n** (for normal, which also means perpendicular).  Which way is your right arm pointing?  **t** X **n**.  That vector has a name, but I forget what that name is.

Hope this helps!
0 like 0 dislike
0 like 0 dislike
A dot product is a way of multiplying vectors which results in a scalar output. Say we have two vectors a = (a_1, a_2, …, a_n) and b = (b_1, b_2, …, b_n). If we wanted to compute a dot b, we multiply corresponding elements and then add those products together. So a dot b = a_1 b_1 + a_2 b_2 + … + a_n b_n.
0 like 0 dislike
0 like 0 dislike
There are physical quantities which depend on the **angle between the two vectors**   
- (i) Quantities which **maximize** when **input angle is minimum** and **minimize** when **input angle is 90 degrees**  
- (ii) Quantities which **minimize** when **input angle is minimum** and **maximize** when **input angle is 90 degrees**  
    
  Dot product describes case (i) whereas Cross product describes case (ii)
0 like 0 dislike
0 like 0 dislike
A dot product does two things at once for you.
Suppose you have a vector space, like R^2 maybe. The dot product is an additional piece of mathematical data which is super easy to compute and gives a notion of length to vectors and also angle between vectors.
The length of a vector v is sqrt(v.v) and agrees with what you probably thought the length should be if you write out the coordinates.
The angle gets mixed up with the length a bit, but it can be untangled. That is, the dot product of two vectors is giving you the cosine of the angle between them EXCEPT that it also scales with the length of the vector. Therefore, to measure angles you must either start with vectors of unit length or you should scale by the length of the vectors after computing the dot product.
0 like 0 dislike
0 like 0 dislike
Imagine you have a skateboard and you push perfectly straight down on it with your hand really hard.  Will the skateboard go anywhere?  No.  Why?  Because you're pushing the skateboard into the ground, not along the ground.

Now pretend you push the skateboard with the same force, but this time you push the back of the skateboard.  Now the skateboard shoots away!

Now pretend you push the skateboard with the same force, but you push at an angle --- not straight down, but not directly behind.  The skateboard moves, but not as quickly as before.  Why?  Because some of the force is going down into the Earth, which doesn't help the skateboard move, and part of it is pushing the skateboard along the ground.

The part of the force that helps move the skateboard is parallel to the direction of motion, and the part of the force that doesn't help the skateboard is orthogonal to it.

Now picture the force as a vector, and the direction that the skateboard can move in as another vector.

The dot product between these two vectors will give you the force that helps to push the skateboard along the ground:  it's the product of the length of the vector of the skateboard (in this case we only care about direction, so just 1) with the length of the *part of the force vector that is parallel to the skateboard.*  (It's also the vector length of the force times the part of the of the vector length of the skateboard direction that is parallel to the direction of force --- it turns out they're the same thing.)

That is, if you take the dot product of a vector that has length 1 and that points in the direction the skateboard can move in with a vector representing the force you apply to the skateboard, you get out the part of the force on the skateboard that actually pushes it forward.  Push straight down, the force is zero.  Push along the path, and the acceleration force is identical to the force you are pushing with.  Push at an angle, and it's somewhere between the two.

If two vectors are perpendicular to each other, the dot product will always be zero.  If they are parallel, it's just the length of the two vectors multiplied together.

Now look at the formula for the dot product:

a dot b = ax\*bx + ay\*by + az\*bz

Notice that it's nothing more than the part of vector a headed in the x direction times the part of vector b also headed in the x direction, plus the part of vector a headed in the y direction times the part of vector b also headed in the y direction, etc.

You'll also see it written as:

|a|\*|b|\*cos (theta).

The cos(theta) just tells you what fraction of the product is headed in the same direction.  If the angle between the vectors is 0, then they must be parallel and cos (0) is 1, so it's just the two multiplied together.  If the two vectors are perpendicular (you're pushing into the ground), then the angle must be 90 degrees, and cos(90) is zero --- no part of the two vectors is parallel.

The dot product is nothing more than the "lengths of the parts of the vectors that head in the same direction multiplied together."

Dot products (and their cousin, the cross product, which gives you a vector that is perpendicular to both input vectors) are used *all the time* in computer graphics.  How this relates to your video game problem is a totally different question, and I would say the answer you got was flippant in that it doesn't explain at all how the dot product would help you solve your problem; only that a potential solution might involve its use.

I would suggest that the person that gave you this response either a) doesn't know what they are talking about or b) is being a jerk and doesn't want to really explain how to do it.

No related questions found

33.4k questions

135k answers

0 comments

33.7k users

OhhAskMe is a math solving hub where high school and university students ask and answer loads of math questions, discuss the latest in math, and share their knowledge. It’s 100% free!