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 $\displaystyle -\bold j$. the direction angles for this vector are $\displaystyle \alpha_0=90^{\circ}$, $\displaystyle \beta_0=180^{\circ}$, and $\displaystyle \gamma_0=90^{\circ}$.

What are the three rotation angles ($\displaystyle \alpha=?$, $\displaystyle \beta=?$, $\displaystyle \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:

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

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

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

We want $\displaystyle \bold r$ to be rotated and have the new direction angles $\displaystyle \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 $\displaystyle \cos\alpha=\frac{r_x}{||\bold r||}$, and $\displaystyle \alpha=45^{\circ}~\text{and}~||\bold r||=1$, we see that

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

Let's now find the y component,

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

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

Let's now find the z component,

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

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

So we now see that the "rotated" vector has the equation $\displaystyle \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:

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

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

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

We want $\displaystyle \bold r$ to be rotated and have the new direction angles $\displaystyle \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 $\displaystyle \cos\alpha=\frac{r_x}{||\bold r||}$, and $\displaystyle \alpha=45^{\circ}~\text{and}~||\bold r||=1$, we see that

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

Let's now find the y component,

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

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

Let's now find the z component,

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

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

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

Does this make sense?

--Chris