Cylindrical coordinates converter
The point (3, 4, 5) becomes a radius of 5, an azimuth of about 0.9273 radians and a height of 5. The angle always lands in the right quadrant, even when x or y is negative. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X
- 3
- Y
- 4
- Z
- 5
- Radius
- 5
- Azimuth
- 0.927295218
- Azimuth unit
- rad
- Height
- 5
The cylindrical coordinates converter takes a point in three-dimensional space given by its Cartesian coordinates x, y and z and returns the same point in cylindrical form: the radius, which is the distance from the vertical z axis to the point; the azimuth, which is the angle in radians measured counterclockwise from the positive x axis in the horizontal plane; and the height, which is simply the z coordinate carried through unchanged. The azimuth is computed with the two-argument arctangent, so it always lands in the correct quadrant. All three inputs must be finite numbers; anything else is rejected with a clear validation error naming the offending field.
From x, y and z to radius, azimuth and height
Cartesian coordinates locate a point in space by walking along three perpendicular axes: x to the right, y forward, and z up. Cylindrical coordinates describe the very same point the way a radar screen would: how far the point sits from the vertical axis, in which compass direction around that axis it lies, and how high it is.
The radius is the hypotenuse of the right triangle that x and y form in the horizontal plane, so for the point (3, 4, 5) the radius is exactly 5, the azimuth is about 0.9273 radians, and the height is 5. The height never changes in the conversion, which is exactly what makes cylindrical coordinates so convenient: they are just polar coordinates in the horizontal plane with the vertical coordinate bolted on untouched. Sending the three coordinates to this cylindrical coordinates converter returns all three values in a single call.
Because the radius comes from a hypotenuse calculation rather than a naive square root of summed squares, the result stays accurate and avoids overflow even when the coordinates themselves are very large finite numbers, which matters in engineering pipelines where magnitudes routinely reach into the millions.
Why the azimuth uses atan2 and lives in radians
A plain arctangent of y divided by x cannot tell a point in the first quadrant from one in the third, because the ratio is identical, and it breaks entirely when x is zero. The two-argument arctangent, atan2, looks at the signs of both coordinates, so the azimuth it returns always points into the correct quadrant and is defined for every point except those exactly on the z axis.
The result lies in the open-closed interval from negative π to positive π: positive values mean the point lies toward positive y, negative values toward negative y, exactly π means due left along the negative x axis, and zero means due right.
Points on the z axis itself, where x and y are both zero, are a special case: the radius is zero and the azimuth is undefined mathematically, so this converter returns an azimuth of zero by convention rather than failing, which keeps pipelines total and predictable while still documenting the choice.
Validation, determinism, and where it fits
Each of the three coordinates must be a finite number. Results are rounded to twelve decimal places so that comparisons stay stable across machines and JavaScript engines. Typical callers are physics and electromagnetics code that prefers cylindrical symmetry around a wire or pipe, robotics and game tooling converting sensor vectors into heading, range and elevation, computer graphics pipelines placing points around an axis of revolution, and geospatial jobs that think in bearing and horizontal distance.
What you can do with it
Physics with cylindrical symmetry
Move a point into radius, azimuth and height form before solving field, flow or wave equations around a wire, pipe or axis of revolution.
Robotics and 3D sensing
Turn a lidar or sensor reading (x, y, z) into horizontal range, heading angle and elevation that controllers and path planners consume directly.
Graphics and CAD pipelines
Convert vertices into cylindrical form to place, rotate or lathe them around a vertical axis without re-deriving the math in every tool.
FAQ
What does it cost?
The same conversion is free to run in your browser on this page.
What exactly is returned?
The radius (distance from the z axis), the azimuth in radians in the interval (-π, π], the unit marker "rad", the height (z unchanged), and the echoed x, y and z inputs.
Why radians and not degrees?
Radians are what trigonometric functions in every major language accept, so the result feeds the next computation without conversion. Multiply by 180/π if you need degrees.
What happens when x and y are both zero?
The point lies on the z axis: the radius is 0 and the azimuth is mathematically undefined, so the converter returns an azimuth of 0 by convention instead of failing.
Which inputs are rejected?
Anything that is not a finite number: missing fields, null, booleans, arrays, empty or non-numeric strings, NaN, and Infinity. Numeric strings like "3.5" are accepted.
Is the azimuth always in the correct quadrant?
Yes. It is computed with the two-argument arctangent atan2(y, x), which uses the signs of both x and y to place the angle in the right quadrant.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/cylindrical-coordinates \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x":3,"y":4,"z":5}'const res = await fetch("https://api.kit.forhosting.com/math/cylindrical-coordinates", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x": 3,
"y": 4,
"z": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/cylindrical-coordinates",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x": 3,
"y": 4,
"z": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/cylindrical-coordinates", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x":3,"y":4,"z":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x":3,"y":4,"z":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/cylindrical-coordinates", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x": 3,
"y": 4,
"z": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.cylindrical_coordinates",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The same conversion runs free in your browser on this page, and the identical code serves the paid API at $0.002 per request.
Why the azimuth uses atan2 and lives in radians
Radians are the natural unit for this API because every programming language's trigonometric functions consume radians directly, so the answer can feed straight into sine, cosine, or a rotation matrix without a conversion step; multiply by 180 over π if you need degrees.
Validation, determinism, and where it fits
The endpoint accepts JSON numbers and numeric strings such as "3.5" or "-2", which is convenient when values arrive as form fields, but it rejects nulls, empty strings, booleans, arrays, the text NaN, and anything infinite, answering with an invalid input error that names the offending field instead of silently producing a meaningless angle. It runs on the edge in milliseconds, keeps nothing after the response, and costs $0.002 per request through the API while remaining free to use interactively in the browser.