Vector Coordinate Converter
This vector coordinate converter changes a 3D point or vector between Cartesian (x, y, z), cylindrical (r, θ, z) and spherical (r, θ, φ) coordinates, with angles in radians and degrees. The point (3, 4, 12) is 13 units from the origin.
Sources: OpenStax Calculus Volume 3 Updated
How to use: Select your input and output coordinate systems, enter your vector components, then click Convert.
Angle units: All angles are in radians. Use degrees × π/180 to convert.
Input Values:
Coordinate System Diagrams:
Result:
Coordinate conversion formulas
| From Cartesian (x, y, z) to | Formulas |
|---|---|
| Cylindrical (r, θ, z) | r = √(x² + y²), θ = atan2(y, x), z = z |
| Spherical (r, θ, φ) | r = √(x² + y² + z²), θ = atan2(y, x), φ = arccos(z ÷ r) |
And back from spherical: x = r sin φ cos θ, y = r sin φ sin θ, z = r cos φ. These are the formulas in OpenStax Calculus, where θ goes around the z-axis and φ is measured down from it.
How to convert Cartesian to spherical coordinates: (3, 4, 12)
- Distance from the origin: r = √(3² + 4² + 12²) = √(9 + 16 + 144) = √169 = 13.
- Angle around the z-axis: θ = atan2(4, 3) = 0.9273 radians, or 53.13°.
- Angle down from the z-axis: φ = arccos(12 ÷ 13) = arccos(0.9231) = 0.3948 radians, or 22.62°.
Check by converting back: z = 13 × cos 0.3948 = 12.00 and x = 13 × sin 0.3948 × cos 0.9273 = 13 × 0.3846 × 0.6 = 3.00. The distance r is the magnitude of the vector, which the vector calculator also gives.
Cartesian to cylindrical coordinates
For the same point, r = √(3² + 4²) = 5, θ = 0.9273 radians (53.13°) and z stays 12. The angle θ is the same as in the spherical form, because both measure the turn around the z-axis.
Cylindrical coordinates suit shapes that are round about one axis, such as pipes and spinning parts. Spherical coordinates suit anything measured from a centre, such as positions on a globe. To find the angle between two such vectors, convert both to Cartesian form and use the dot product calculator.
Radians and the rules for r
JavaScript's trig functions work in radians, so the converter keeps radians as the main unit and shows degrees next to them. One radian is about 57.296°.
In both systems r is a distance, so a negative r is rejected instead of being flipped to the other side of the origin. Wikipedia's spherical coordinate system article lists the other conventions in use. The straight-line distance between two points, in any of these systems, is easiest in Cartesian form with the distance between two points calculator.
Questions about coordinate systems
How do you convert Cartesian to spherical coordinates?
r = √(x² + y² + z²), θ = atan2(y, x) and φ = arccos(z ÷ r). For (3, 4, 12): r = 13, θ = 53.13° and φ = 22.62°.
What is the difference between θ and φ?
Here θ is the angle around the z-axis, measured in the x-y plane from the x-axis, and φ is the angle down from the positive z-axis. Some physics books swap the two letters, so check which convention your course uses.
How do you convert cylindrical to Cartesian coordinates?
x = r cos θ, y = r sin θ, and z stays the same. (5, 53.13°, 12) gives x = 5 × 0.6 = 3 and y = 5 × 0.8 = 4.
Sources
- OpenStax Calculus Volume 3, 2.7 Cylindrical and Spherical Coordinates — conversion formulas between rectangular, cylindrical and spherical coordinates (checked October 16, 2026)
- Wikipedia: Spherical coordinate system — the two naming conventions for the azimuthal and polar angles (checked October 16, 2026)