Tuesday, November 22, 2011

How do I convert a cartesian vector into spherical coordinates?

Specifically, how do I represent:





r(x,y,z) = xi + yj + zk





As a vector fuction of ro, theta and phi?|||ro^2 = x^2 + y^2 + x^2





ro = sqrt(x^2 + y^2 + x^2)





cos(phi) = z / ro





cos(theta) = x / (ro * sin phi)|||x=p*sin(phi)*cos(theta)


y=p*sin(phi)*sin(theta)


z=p*cos(phi)





So however you want to represent your r(x,y,z), just replace with these conversions.


r(x,y,z)=p*sin(phi)*[i*cos(theta)+j*si鈥?for example.

No comments:

Post a Comment