Conversion of a vector from cylindrical to cartesian

1. Sep 19, 2016

Armani

(mentor note: thread moved from general to here hence no template)

Hi,

I need some help with converting this cylindrical vector: $$\vec A = \vec a_r(3*cos(\phi)-\vec a_{\phi}*2r+\vec a_z5$$ into the cartesian:

I have found these:
where

$$A_x =3cos^2(\phi)+2sin(\phi)*r\\ A_y=3sin(\phi)cos(\phi)-2cos(\phi)*r\\ A_z=5$$

Also
$$x=rcos(\phi)=3*cos(\phi)cos(\phi)=3cos^2(\phi)\\ y=rsin(\phi)=3cos(\phi)sin(\phi)\\ z=5$$

I am a bit stuck after this:
I know that i have to use this formula: $$\phi=tan^{-1}\left(\frac{y}{x}\right)$$ but i am not getting the right solution...
Can someone help?

Last edited by a moderator: Sep 19, 2016
2. Sep 19, 2016

You also need $\hat{a_r}=cos(\phi) \hat{i} +\sin(\phi) \hat{j}$ where $cos(\phi)=x/(x^2+y^2)^{1/2}$ and $sin(\phi)=y/(x^2+y^2)^{1/2}$. I let you try to figure out $\hat{a_{\phi}}$. Also, do you see that $r=(x^2+y^2)^{1/2}$?

3. Sep 19, 2016

Armani

are those two expressions for $cos(\phi)$ and $sin(\phi)$ already given? Or did you derive them?
And thanks:)

Last edited by a moderator: Sep 19, 2016
4. Sep 19, 2016

You could probably google them. $cos(\phi)=x/r$. $sin(\phi)=y/r$. That's how cylindrical coordinates work. Meanwhile, the unit vectors $\hat{a_r}$ and $\hat{a_{\phi}}$ are not fixed. They change with $\phi$.

Last edited by a moderator: Sep 19, 2016
5. Sep 19, 2016

Armani

Okay, thanks for your help.

6. Sep 19, 2016

Staff: Mentor

If you apply what @Charles Link suggested, you will find that your first attempt was correct. Your 2nd approach only works for a position vector from the origin.

7. Sep 19, 2016

I think @Chestermiller is pointing out an error in the OP's work that I didn't spot on the first reading: the OP assumed the vector $A$ is of the form $r \hat{a_r}+...$ so that he thought $r=3 \cos(\phi)$ which is not the case. In any case, converting from cylindrical to Cartesian simply involves using vector formulas that can be googled. Anyone who has good command of trigonometry can derive the necessary vector formulas with very little effort. Otherwise, the simplest way to work a problem like this is to look up the coordinate conversion formulas which are often found in the back cover of E&M textbooks and other math books. No doubt a google of the topic would work equally well.

8. Sep 19, 2016

Staff: Mentor

I agree that the method you suggested using the unit vectors will lead to the correct answer, as obtained by the OP with his first method.