%%HEAD_SCRIPTS_E_META%% %%BODY_SCRIPTS_INIZIO%%

Cartesian to Spherical Converter

Enter Cartesian 3D coordinates (x, y, z) and get spherical coordinates using your preferred convention. This tool uses robust atan2 logic so angles are correct in every quadrant.

Convert coordinates

Result (Spherical)

ρ / r:

θ (azimuth):

φ (polar from +z):

Note: for math convention, θ is azimuth in x-y plane and φ is polar from +z; for physics convention, θ is polar from +z and φ is azimuth in x-y plane.

Need the inverse? Try Spherical to Cartesian.

Formulas used

First, compute the radial distance from the origin:

ρ = √(x² + y² + z²)

1. Math / Calculus convention

Coordinates: (ρ, θ, φ)

  • ρ: distance from origin
  • θ: azimuth in x-y plane = atan2(y, x)
  • φ: polar angle from +z = arccos(z / ρ)
ρ = √(x² + y² + z²)
θ = atan2(y, x)
φ = arccos(z / ρ)

2. Physics / Engineering convention

Coordinates: (r, θ, φ)

  • r: distance from origin (same as ρ)
  • θ: polar angle from +z = arccos(z / r)
  • φ: azimuth in x-y plane = atan2(y, x)
r = √(x² + y² + z²)
θ = arccos(z / r)
φ = atan2(y, x)

Degrees vs radians

The internal calculations use radians. If you select degrees, the tool converts using:

degrees = radians × 180 / π

FAQ

What if ρ = 0?

If x = y = z = 0, the point is the origin. Radius is 0 and angles are undefined. We return 0 for both angles for convenience.

Why two different names (ρ vs r, θ vs φ)?

Different textbooks and fields prefer different symbols. This tool lets you switch so you can match your source.

Will this work for negative x, y, or z?

Yes. Thanks to atan2, azimuth is always placed in the correct quadrant.