# Thread: direction from angles

1. ## direction from angles

The should be a simple one.

I've got a: an unit vector pointing -1 down Y
and b: three xyz rotation angles.

I want to rotate my initialized vector by the three angles, resulting in a new direction.

2. Originally Posted by travis
The should be a simple one.

I've got a: an unit vector pointing -1 down Y
and b: three xyz rotation angles.

I want to rotate my initialized vector by the three angles, resulting in a new direction.
Since the vector is $-\bold j$. the direction angles for this vector are $\alpha_0=90^{\circ}$, $\beta_0=180^{\circ}$, and $\gamma_0=90^{\circ}$.

What are the three rotation angles ( $\alpha=?$, $\beta=?$, $\gamma=?$)???

--Chris

3. Well, they are arbitrary... What I'm looking for is the formula for finding a new direction based on any given angles.

For the sake of argument let's say the angles are 45, 10, 90.

4. Originally Posted by travis
Well, they are arbitrary... What I'm looking for is the formula for finding a new direction based on any given angles.

For the sake of argument let's say the angles are 45, 10, 90.
I would assume that those angles are with respect to the positive coordinate axes?

We would then need to use these equations:

$\cos\alpha=\frac{r_x}{||\bold r||}~~~~~~~~~~\cos\beta=\frac{r_y}{||\bold r||}~~~~~~~~~~\cos\gamma=\frac{r_z}{||\bold r||}$

where $r_x, \ r_y, \text{ and }r_z$ are the components of the vector $\bold r$. These equations are used to find direction cosines. They come in useful here.

In our case, $\bold r=-\bold j$

We want $\bold r$ to be rotated and have the new direction angles $\alpha=45^{\circ},~\beta=10^{\circ},~\text{and}~\g amma=90^{\circ}$. So let's see how we would calculate the equation of the new vector.

Let's find the x component first.

Since $\cos\alpha=\frac{r_x}{||\bold r||}$, and $\alpha=45^{\circ}~\text{and}~||\bold r||=1$, we see that

$r_x=\cos(45^{\circ})=\frac{\sqrt{2}}{2}\approx\col or{red}\boxed{.707}$

Let's now find the y component,

Since $\cos\beta=\frac{r_y}{||\bold r||}$, and $\beta=10^{\circ}~\text{and}~||\bold r||=1$, we see that

$r_y=\cos(10^{\circ})\approx\color{red}\boxed{.985}$

Let's now find the z component,

Since $\cos\gamma=\frac{r_z}{||\bold r||}$, and $\gamma=90^{\circ}~\text{and}~||\bold r||=1$, we see that

$r_z=\cos(90^{\circ})=\color{red}\boxed{0}$

So we now see that the "rotated" vector has the equation $\color{red}\boxed{\bold r_n=.707\bold i+.985\bold j}$

Does this make sense?

--Chris

5. Thanks very much for this reply. I am going to have to chew on it a bit.

6. Tested this and it works. Thanks again Chris, really helpful.

Originally Posted by Chris L T521
I would assume that those angles are with respect to the positive coordinate axes?

We would then need to use these equations:

$\cos\alpha=\frac{r_x}{||\bold r||}~~~~~~~~~~\cos\beta=\frac{r_y}{||\bold r||}~~~~~~~~~~\cos\gamma=\frac{r_z}{||\bold r||}$

where $r_x, \ r_y, \text{ and }r_z$ are the components of the vector $\bold r$. These equations are used to find direction cosines. They come in useful here.

In our case, $\bold r=-\bold j$

We want $\bold r$ to be rotated and have the new direction angles $\alpha=45^{\circ},~\beta=10^{\circ},~\text{and}~\g amma=90^{\circ}$. So let's see how we would calculate the equation of the new vector.

Let's find the x component first.

Since $\cos\alpha=\frac{r_x}{||\bold r||}$, and $\alpha=45^{\circ}~\text{and}~||\bold r||=1$, we see that

$r_x=\cos(45^{\circ})=\frac{\sqrt{2}}{2}\approx\col or{red}\boxed{.707}$

Let's now find the y component,

Since $\cos\beta=\frac{r_y}{||\bold r||}$, and $\beta=10^{\circ}~\text{and}~||\bold r||=1$, we see that

$r_y=\cos(10^{\circ})\approx\color{red}\boxed{.985}$

Let's now find the z component,

Since $\cos\gamma=\frac{r_z}{||\bold r||}$, and $\gamma=90^{\circ}~\text{and}~||\bold r||=1$, we see that

$r_z=\cos(90^{\circ})=\color{red}\boxed{0}$

So we now see that the "rotated" vector has the equation $\color{red}\boxed{\bold r_n=.707\bold i+.985\bold j}$

Does this make sense?

--Chris