dash–calculator

01 Vectors and Coordinates

Cylindrical Coordinates: Step-by-Step Calculation

Readout 01-0211 · Updated · Standard formula, shown below

Radial distance r 5.00
Angle θ (degrees)
53.1 °
Result, rounded to 1 decimal place
Angle θ (radians)
0.927 rad
Result, rounded to 3 decimal places
z
5.00
Result, rounded to 2 decimal places
You enter
x, y, z
You get
Radial distance r, Angle θ (degrees) (°), Angle θ (radians) (rad), z
Rounding
2 dp · 1 dp · 3 dp

This calculator converts between Cartesian (x, y, z) and cylindrical (r, θ, z) coordinates, and also gives you the distance from the origin. You enter the x, y, and z values (or r, θ, z if you choose the reverse direction) and the calculator returns the equivalent coordinates in the other system, plus the radial distance and the angle in degrees and radians. The formulas are straightforward, but the angle requires attention to the quadrant, which is where most mistakes happen.

Formula

Cylindrical coordinates describe a point in 3D space using a radius, an angle, and a height. The system is an extension of polar coordinates into three dimensions by adding the z-axis, which is the same as the z in Cartesian coordinates.

Given Cartesian coordinates (x, y, z), the cylindrical coordinates (r, θ, z) are:

  • r = √(x² + y²) — the horizontal distance from the z-axis (always non-negative).
  • θ = atan2(y, x) — the angle from the positive x-axis, measured in the xy-plane. In degrees, it ranges from -180° to 180° (or 0° to 360° depending on convention). Here we use the standard atan2 result, which gives -180° to 180°.
  • z = z — the height above the xy-plane, unchanged.

Going the other way, from (r, θ, z) to Cartesian:

  • x = r · cos(θ)
  • y = r · sin(θ)
  • z = z

All angles are in radians for the trigonometric functions unless you convert to degrees first. The calculator uses the atan2 function, which automatically places the angle in the correct quadrant based on the signs of x and y.

Worked Example

Using the default values from the calculator: x = 3, y = 4, z = 5.

  1. Calculate r: r = √(3² + 4²) = √(9 + 16) = √25 = 5.00
  2. Calculate θ: θ = atan2(4, 3). Since both x and y are positive, the angle is in the first quadrant. atan(4/3) ≈ 53.1301°. In radians that is 0.9273 rad.
  3. z stays 5.

So the cylindrical coordinates are (r = 5.00, θ = 53.1°, z = 5). The calculator shows r = 5.00, θ = 53.1°, and z = 5.00, matching the manual calculation.

When to Use Cylindrical Coordinates

Cylindrical coordinates are the natural choice when a problem has symmetry around an axis. Common examples include:

  • Describing points on a cylinder, like the surface of a pipe or a can.
  • Calculating electric or magnetic fields around a wire.
  • Fluid flow in a pipe, where the radial direction matters.
  • Converting between coordinate systems for 3D graphing or CAD software.

If the geometry is mostly flat and uses polar coordinates, adding a z-axis gives you cylindrical. If the symmetry is spherical (around a point), spherical coordinates are better.

How to Read the Result

The radial distance r tells you how far the point is from the z-axis, not from the origin. The distance from the origin would be √(r² + z²). The angle θ is measured from the positive x-axis, counterclockwise in the xy-plane. A negative angle means the point is below the x-axis (if you measure from 0° to 360°, add 360° to a negative result). The z value is simply the height, same as in Cartesian.

Common Mistakes

  • Using the wrong quadrant for θ: If you use arctan(y/x) instead of atan2(y, x), you get the wrong angle when x is negative. For example, x = -3, y = 3 gives θ = 135°, but arctan(3/-3) gives -45°, which is the same line but opposite direction. Always use atan2.
  • Forgetting that r must be non-negative: r is a distance, so it is always ≥ 0. If you ever get a negative r, you have made an error.
  • Mixing degrees and radians: When you manually compute x = r·cos(θ), make sure your calculator is in the correct mode. If θ is in degrees, use degrees; if in radians, use radians.
  • Confusing z with the distance from origin: z is just the height, not the full 3D distance.
  • Using the wrong angle convention: Some fields use φ instead of θ, and sometimes the angle is measured from the y-axis. Always state your convention.

Tips

  • Use atan2(y, x) instead of atan(y/x) in any programming language or calculator that supports it. It handles all quadrants automatically.
  • If you need θ in the range 0° to 360°, add 360° to any negative result: θ = (θ + 360) % 360.
  • When converting from cylindrical to Cartesian, keep r positive. If you ever have a negative r, you can add 180° to θ and make r positive.
  • Check your result by converting back: plug the cylindrical coordinates into the reverse formulas and see if you get the original x, y, z.
  • For 3D plotting, many software packages expect angles in radians. Double-check the default setting.

Troubleshooting

If the angle looks wrong (e.g., you expect 120° but get -60°): The calculator uses atan2, which returns angles from -180° to 180°. If you prefer 0° to 360°, add 360° to negative results. For example, -60° + 360° = 300°.

If the radius is not what you expected: Make sure you are using the horizontal distance, not the 3D distance. For a point (1, 1, 1), r = √(1+1) = 1.414, not √3 = 1.732.

If you entered negative x or y and the angle is still positive: atan2 returns positive angles for points above the x-axis (positive y) and negative for below. For x = -3, y = -4, θ = -126.87°, which is equivalent to 233.13°. That is correct.

If you are converting many points and the results seem inconsistent: Check that you are consistent with the order of coordinates. Cylindrical is usually written (r, θ, z), but some sources use (ρ, φ, z). Make sure you know which is which.

Frequently Asked Questions

Q: What is the difference between cylindrical and polar coordinates?
A: Polar coordinates are 2D (r, θ) in a plane. Cylindrical coordinates add a third coordinate z for height, making it (r, θ, z) in 3D.

Q: Can r be negative in cylindrical coordinates?
A: Mathematically, r is defined as a distance, so it is non-negative. However, some contexts allow negative r by interpreting it as the opposite direction (add 180° to θ). The calculator always returns a non-negative r.

Q: Why do I need atan2 instead of atan?
A: atan(y/x) only returns angles between -90° and 90°, so it cannot distinguish between (x, y) and (-x, -y). atan2(y, x) considers the signs of both x and y, giving the correct angle in the full -180° to 180° range.

Q: How do I convert from cylindrical to Cartesian if I have θ in degrees?
A: Use x = r·cos(θ) and y = r·sin(θ), but make sure your calculator is in degree mode. If you are programming, convert θ to radians first: θ_rad = θ_deg · π / 180.

Q: What is the distance from the origin in cylindrical coordinates?
A: The distance from the origin is √(r² + z²). The r coordinate alone is only the horizontal distance from the z-axis.

Q: Are cylindrical coordinates the same as spherical coordinates?
A: No. Cylindrical uses a radius, an angle, and a height (r, θ, z). Spherical uses a radius from the origin, an angle from the z-axis (polar angle), and an azimuthal angle (ρ, φ, θ). They are different systems.

Related

Formula used
in x | x | - | 3 | - | 100000
in y | y | - | 4 | - | 100000
in z | z | - | 5 | - | 100000
out r | Radial distance r | - | sqrt(x^2 + y^2) | 2
out theta_deg | Angle θ (degrees) | ° | atan2(y, x) * 180 / pi | 1
out theta_rad | Angle θ (radians) | rad | atan2(y, x) | 3
out z_out | z | - | z | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Vectors and Coordinates panel →