# Finding Cosine of an Angle in 3D space

1. Jan 28, 2012

1. The problem statement, all variables and given/known data

a) Find the cosine of the angles that the line r = [-3,2,5] + t [2,2,√2 ] makes with the coordinate axes.

b) If a,b and c are the angles that the line makes with the x,y and z axis respectively, find the value of cos^2a + cos^2b + cos^2c.

c) What is the magnitude of the vector [cosa,cosb,cosc]

d) What can you say about the direction of the vector [cosa,cosb,cosc] and the direction of the vector line?

2. Relevant equations

I believe we have to use CosTheta = r . t / |r||t| but it doesn't seem right because this is a vector equation involving direction.

Last edited by a moderator: Jan 29, 2012
2. Jan 28, 2012

### Staff: Mentor

Actually, you'll want to use the dot product of a vector that is parallel to the line with unit vectors on your coordinate axes. So if you construct vector $\vec{r}$ to lie parallel to your line, then
$$cosa = \frac{\vec{r} \cdot \hat{i}}{|\vec{r}||\hat{i}|}$$
and so on for the unit vectors $\hat{i},\hat{j},\hat{k}$ to yield cosa, cosb, cosc.
Yes, there will be three angle cosines to find, one for each axes of the coordinate system.

Your first step should be to find a vector r that is parallel to your line.

3. Jan 28, 2012

How do I find a the line parallel to R?

4. Jan 28, 2012

### Staff: Mentor

You have a line given in parametric form: [-3,2,5] + t [2,2,√2 ]. The [-3,2,5] bit is just an offset. You could shift the line to pass through the origin by subtracting this offset, and the result would obviously be a line that is parallel to the original. Thus the line r' = t [2,2,√2 ] is parallel to the original line. Plug in any value of t that you like (1 is a good choice!) to find a vector that lies in the line.

5. Jan 28, 2012

### SammyS

Staff Emeritus
Hello hunt3rshadow. Welcome to PF !

Usually you should post no more than two questions when opening a thread. These all look fairly closely related, so I suppose it's OK.

I'll try to get you headed in the right direction, but it's up to you to actually solve the problem(s).

For (a):
The vector, r = [-3,2,5] + t [2,2,√2 ], is a position vector having its tail at the origin, and its head it the point (x, y, z) = ( -3 + 2t, 2 + 2t, 5 + (√2)t ), i.e.
x = -3 + 2t,
y = 2 + 2t,
z = 5 + (√2)t .​
As t goes from -∞ to +∞, the head of vector r(t) traces a straight line. The vector [-3,2,5], has nothing to do with the direction of this line. It only specifies the location of a point, (-3,2,5), on the line that corresponds to t = 0. The direction is given by the vector that t multiplies, namely, [2,2,(√2) ]. Note that this is also equal to dr/dt.
$\displaystyle\frac{d\textbf{r}}{dt}=\ \left<2,2,\sqrt{2}\ \right>$​

You have to find the cosine of the angle this vector makes with respect to (w.r.t) the x-axis, ... then the cosine of the angle this vector makes w.r.t. the y-axis,... then the cosine of the angle this vector makes w.r.t. the z-axis.

The x-axis is in the direction of [1, 0, 0].
This is where you use that equation you have:

$\displaystyle\cos(\theta)=\frac{ \left\langle 2,\,2,\,\sqrt{2} \right\rangle\cdot \left\langle 1,\,0,\,0 \right\rangle}{\left| \left\langle 2,\,2,\,\sqrt{2} \right\rangle \right|\ \left| \left\langle 1,\,0,\,0 \right\rangle \right|}$

Do similarly for the other two axes.

6. Jan 28, 2012

Oh my gosh guys I really owe you! You two made it seem so easy

Last edited: Jan 29, 2012
7. Jan 28, 2012

### SammyS

Staff Emeritus
A vector parallel to the line is the vector < 2, 2, (√2) > . That's basically the dr/dt vector I discussed.

8. Jan 28, 2012

Ahh I see, thanks.

Last edited: Jan 29, 2012
9. Jan 28, 2012

### Staff: Mentor

Just do as the formula states and add the sum of the squares of the cosines of the angles; you don't need to find the angles themselves, just use the cosines. The result should be particularly satisfying .

10. Jan 28, 2012