# Problem with dot product of vectors

#### cshum00

It began in class with this problem.

Find the dot product of 2 vectors:
v1 a vector with components <4, 8>
v2 a vector of length 1 angle pi/4

So, i have 2 ways of doing it.
1) v1.v2 = v1x.v2x + v1y.v2y
2) v1.v2 = |v1||v2|cos(theta)
And they should come out the same but.

1) v1.v2 = 4cos(pi/4) + 8sin(pi/4) = 6√(2)
1) v1.v2 = √(42 + 82)cos(pi/4) = 2√(10)

and 6√(2) ≠ 2√(10), so i wondered if i did something wrong. Then it tried different numbers and found out these two ways of computing the dot product of two vectors are never the same for an angle pi/4 except for vectors with components <a, 0> or <0, a> where a is any real number.

I wonder if i computed anything wrong causing different results or is is that they are not the same?

#### tiny-tim

Homework Helper
Find the dot product of 2 vectors:
v1 a vector with components <4, 8>
v2 a vector of length 1 angle pi/4

So, i have 2 ways of doing it.
1) v1.v2 = v1x.v2x + v1y.v2y
2) v1.v2 = |v1||v2|cos(theta)
Hi cshum00!

(have a pi: π and a theta: θ and a root: √ )

θ is the angle between the two vectors.

If v2 is at π/4 to the x-axis, it is at (1/√2,1/√2), but the angle between it and (4,8) is not π/4.

#### cshum00

Re: Problem with dor product of vectors

I see so it means that, v1x.v2x + v1y.v2y = |v1||v2|cosθ is true only if v1 or v2 is on the x-axis and therefore the angle making between them is θ.

Thanks, it clarifies at lot.

#### tiny-tim

Homework Helper
Stop!

No, θ in that formula has nothing to do with the x-axis.

θ is the angle between whatever two vectors you're dot-producting.

#### cshum00

|v1||v2|cosθ this formula doesn't but
v1x.v2x + v1y.v2y this formula does

so, if the angle of v2 is θ and
v1x.v2x + v1y.v2y = |v1||v2|cosθ
then v1 have to be in the x-axis

although now you cleared me that in the original problem, the angle in v2 was not θ but with the x-axis

thanks again

#### HallsofIvy

Homework Helper
|v1||v2|cosθ this formula doesn't but
v1x.v2x + v1y.v2y this formula does

so, if the angle of v2 is θ and
v1x.v2x + v1y.v2y = |v1||v2|cosθ
then v1 have to be in the x-axis
NO, v1 and v2 can be any two vectors, $\theta$ the angle between them. It is only if v1 lies on the (positive) x-axis that the angle between then is the angle v2 makes with the positive x-axis.

although now you cleared me that in the original problem, the angle in v2 was not θ but with the x-axis

thanks again

#### cshum00

Yes, you are right. I am making so much confusion with the angle given for v2 which is the one between v2 and the x-axis and not θ

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving