Transforming cartesian coordinates to cylindrical coordinates assuming the cylinder is parallel to xy plane

273 Views Asked by At

I have a set of data presented in Cartesian coordinates, ($x$, $y$, $z$). There is a cylinder with its base centered at ($x_0$, $y_0$, $z_0$) and its axis pointing in an arbitrary direction, $\phi_0$ (with respect to +$x$ axis) but otherwise parallel to and above the $xy$ plane.

My question is how to convert the ($x$, $y$, $z$) (that are with respect to the origin of the Cartesian coordinate system) to ($\rho$, $\phi$, $z$) (that are with respect to the the cylinder defined above)?

Thank you for your help

1

There are 1 best solutions below

4
On BEST ANSWER

I suggest you do the transformation in steps:

  1. Change the origin to be $(x_0,y_0,z_0)$ using the transformation $$(x,y,z) \to (x_1,y_1,z_1)=(x-x_0,y-y_0,z-z_0)$$
  2. Account for the rotated reference frame by: $$(x_1, y_1,z_1)\to (x_2,y_2,z_2)=(x_1\cos\phi_0+y_1\sin\phi_0,-x_1\sin\phi_0+y_1\cos\phi_0,z_1)$$
  3. Transform to cylindrical coordinates the usual way in this latest reference frame: $$\rho=\sqrt{y_2^2+z_2^2}\\h=x_2\\\tan\phi=\frac{z_2}{y_2}$$