Cartesian to Cylindrical Coordinates Converter

Cartesian to Cylindrical Coordinates Converter

Growing AI Skill PRO

Enter Calculation

Formula

ρ=x2+y2,z=zθ=atan2(y,x)·180π\begin{gathered} \rho = \sqrt{\text{x}^{2} + \text{y}^{2}}, \quad z = \text{z} \\[1.5em] \theta = \operatorname{atan2}\!\left(\text{y},\ \text{x}\right) \cdot \frac{180}{\pi} \end{gathered}
Usage stats

Advertisement

Results

Cylindrical Coordinates
(5, 53.130102°, 5)
(rho, theta, z) — theta in degrees
rho (radial distance) 5
theta (azimuth) 53.130102°
z (height) 5

Report an error on this page

What This Converter Does

The Cartesian to Cylindrical Coordinates Converter transforms a point given in rectangular coordinates (x, y, z) into cylindrical coordinates (rho, theta, z). Cylindrical coordinates describe a 3D point by its radial distance from the z-axis (rho), the azimuthal angle around that axis (theta), and its height (z). This system is widely used in physics, engineering, and any problem with rotational symmetry about an axis, such as pipes, wires, and electromagnetic fields.

How to Use It

Enter the three Cartesian components x, y, and z. Choose whether you want the output angle theta expressed in degrees or radians. The converter returns rho (always non-negative), theta in your chosen unit, and z passed through unchanged.

The Formula Explained

The conversion uses these relations:

$$\rho = \sqrt{\text{x}^{2} + \text{y}^{2}}, \quad z = \text{z}$$ $$\theta = \operatorname{atan2}\!\left(\text{y},\ \text{x}\right) \cdot \frac{180}{\pi}$$ \(\rho = \sqrt{\text{x}^2 + \text{y}^2}\) is the distance from the z-axis to the point projected onto the xy-plane. \(\theta = \operatorname{atan2}(\text{y}, \text{x})\) is the angle from the positive x-axis. We use the two-argument atan2 function instead of plain arctan(y/x) so the correct quadrant is selected and the case x = 0 is handled without division by zero. The z-coordinate stays the same. When degrees are requested, the radian result is multiplied by \(\frac{180}{\pi}\).

Advertisement
3D diagram showing a point with Cartesian x, y, z axes and cylindrical rho, theta, z components
A point shown in both Cartesian (x, y, z) and cylindrical (ρ, θ, z) coordinates.

Worked Example

For x = 3, y = 4, z = 5 with output in degrees: \(\rho = \sqrt{9 + 16} = \sqrt{25} = 5\). \(\theta = \operatorname{atan2}(4, 3) = 0.927295\ \text{rad} = 53.1301°\). z = 5. So the cylindrical point is (5, 53.1301°, 5). In radians, \(\theta = 0.927295\ \text{rad}\).

More Worked Examples by Quadrant

The calculator uses \(\rho = \sqrt{x^2 + y^2}\), \(z\) unchanged, and \(\theta = \operatorname{atan2}(y, x)\). Because atan2 looks at the signs of both x and y, it returns the correct quadrant. The plain \(\arctan(y/x)\) cannot do this. The principal value lies in \((-180^\circ, 180^\circ]\). To get an angle in the 0–360° range, add 360° to any negative result.

Example 1: (-3, 4, 2), quadrant II

  1. Radial distance: \(\rho = \sqrt{(-3)^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = \)5
  2. Angle: \(\theta = \operatorname{atan2}(4, -3) = 180^\circ - \arctan(4/3) = 180^\circ - 53.13^\circ \approx 126.87^\circ\). In radians, \(\pi - 0.9273 \approx 2.2143\). The value is already positive, so no adjustment is needed.
  3. Height: \(z = 2\).

Result: \((\rho, \theta, z) \approx (5,\ 126.87^\circ,\ 2)\), or \((5,\ 2.2143\text{ rad},\ 2)\).

Example 2: (-1, -1, 0), quadrant III

  1. \(\rho = \sqrt{(-1)^2 + (-1)^2} = \sqrt{2} \approx 1.4142\)
  2. \(\theta = \operatorname{atan2}(-1, -1) = -135^\circ\) (\(-3\pi/4 \approx -2.3562\) rad). The 0–360° adjustment is \(-135^\circ + 360^\circ = 225^\circ\) (\(5\pi/4 \approx 3.9270\) rad).
  3. \(z = 0\).

Result: \((1.4142,\ -135^\circ,\ 0)\), equivalently \((1.4142,\ 225^\circ,\ 0)\).

Example 3: (2, -2, -3), quadrant IV

  1. \(\rho = \sqrt{2^2 + (-2)^2} = \sqrt{8} = 2\sqrt{2} \approx 2.8284\)
  2. \(\theta = \operatorname{atan2}(-2, 2) = -45^\circ\) (\(-\pi/4 \approx -0.7854\) rad). The 0–360° adjustment is \(-45^\circ + 360^\circ = 315^\circ\) (\(7\pi/4 \approx 5.4978\) rad).
  3. \(z = -3\). The height keeps its sign.

Result: \((2.8284,\ -45^\circ,\ -3)\), equivalently \((2.8284,\ 315^\circ,\ -3)\).

All of these angle forms describe the same point. Add or subtract 360° (2π rad) to switch between them.

Axis and Quadrant Angle Reference Table

Points on the axes

Location atan2 θ (degrees) atan2 θ (radians)
Positive x-axis (x > 0, y = 0) 0° 0
Positive y-axis (x = 0, y > 0) 90° π/2
Negative x-axis (x < 0, y = 0) 180° π
Negative y-axis (x = 0, y < 0) -90° (or 270°) -π/2 (or 3π/2)
Origin (x = 0, y = 0) 0° by convention (mathematically undefined) 0 by convention

Quadrants of the xy-plane

Quadrant Sign of x Sign of y atan2 θ range Equivalent 0–360° range
I + + 0° to 90° 0° to 90°
II − + 90° to 180° 90° to 180°
III − − -180° to -90° 180° to 270°
IV + − -90° to 0° 270° to 360°

At the origin, \(\rho = 0\) and the angle has no meaning. Most software returns 0 there, and the point is fully described by \(\rho\) and \(z\).

Advertisement

Key Terms and Symbols

  • ρ (rho): the radial distance from the z-axis to the point, measured in the xy-plane. It is never negative: \(\rho = \sqrt{x^2 + y^2} \ge 0\).
  • θ (theta): the azimuthal angle, measured counterclockwise from the positive x-axis in the xy-plane when viewed from above (positive z).
  • z: the height above or below the xy-plane. It is identical in Cartesian and cylindrical coordinates.
  • atan2(y, x): a two-argument arctangent that uses the signs of both y and x to return the angle in the correct quadrant. The ordinary \(\arctan(y/x)\) only returns values between -90° and 90°.
  • Principal value range: the interval of angles a function returns by default. For atan2 it is \((-\pi, \pi]\), or \((-180^\circ, 180^\circ]\). Add 2π (360°) to a negative result to get a value in \([0, 2\pi)\).

Compared with spherical coordinates: in spherical coordinates, r (often also written ρ) is the distance from the origin, \(\sqrt{x^2 + y^2 + z^2}\). In cylindrical coordinates, ρ is the distance from the z-axis only. Notation also varies between texts. Some use r instead of ρ for the cylindrical radius, and some use φ instead of θ for the azimuthal angle. Physics and mathematics texts often swap the roles of θ and φ in spherical coordinates. Check which convention your source uses.

FAQ

What if x and y are both zero? Then \(\rho = 0\) and theta is mathematically undefined; by the atan2 convention the result is reported as 0.

Why might theta be negative? atan2 returns values in (-180°, 180°] (or \((-\pi, \pi]\)). To express theta in a 0–360° range, add 360° (or \(2\pi\)) to any negative result.

Does this change the z value? No. The z-coordinate is identical in both Cartesian and cylindrical systems.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators