ForHosting KIT · Math

Rectangular to polar converter

Turn a point on the plane into distance and direction: the point (3, 4) lies 5 units from the origin, with its angle in quadrant I. The angle comes in radians and degrees, always in the right quadrant. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Cartesian X coordinate
3
Cartesian Y coordinate
4
You get
Resistance (Ω)
5
Quadrant
1
Theta
0.927295218
Theta deg
53.1301023542

Rectangular (Cartesian) coordinates describe a point as a horizontal component x and a vertical component y. Polar coordinates describe the same point as a distance r from the origin and an angle theta measured from the positive x-axis. This capacity performs that conversion with a closed-form, deterministic algorithm: the radius is the Euclidean length hypot(x, y), and the angle is atan2(y, x), which automatically places theta in the correct quadrant rather than returning only principal arctangent values from the first and fourth quadrants. Results are stable across engines, suitable for homework checks, engineering scripts, complex-number magnitude-phase work, and offline CI tests.

What rectangular-to-polar conversion means

In the plane, every point except the origin can be written either as a pair (x, y) or as a pair (r, θ). The radius r is always non-negative and equals the straight-line distance from (0, 0) to (x, y). The angle θ is the directed angle from the positive x-axis to the ray that passes through the point; by convention it is reported in the open-closed interval (−π, π] when measured in radians (or (−180°, 180°] in degrees).

A common mistake is to compute θ with the one-argument arctangent atan(y/x) and then try to patch the quadrant by hand. That approach fails on the negative x-axis, confuses signs when x is zero, and is a frequent source of homework and firmware bugs. The two-argument function atan2(y, x) encodes the correct branch for all four quadrants and both axes.

You also receive the original x and y (rounded) and a quadrant label so you can sanity-check which sector of the plane the input occupied.

Engineering phasors and signal phase

Scripts turn real and imaginary parts of impedance, voltage, or FFT bins into magnitude and phase for Bode plots, power-factor checks, and report tables.

Games, robotics, and sensor headings

Developers convert velocity or offset vectors (dx, dy) into range and heading so steering, targeting, and telemetry can use polar form without reinventing atan2 edge cases.

Which angle formula do you use?

r = hypot(x, y) and θ = atan2(y, x). Using atan2 places the angle in the correct quadrant automatically; a plain atan(y/x) does not.

What happens if both x and y are zero?

At the origin the radius is zero and the polar angle is undefined, so the tool refuses to invent a theta.

How do I convert the point (3, 4) to polar coordinates?

The distance is the square root of 3² + 4², which is 5. The angle is measured from the positive horizontal axis toward the point, and since both coordinates are positive it falls in quadrant I.

Why not just use the arctangent of y divided by x?

Because that ratio cannot tell opposite quadrants apart: (3, 4) and (−3, −4) give the same quotient but point in opposite directions. Using both coordinates separately places the angle in the right quadrant every time.

Is the angle given in radians or degrees?

Both. You choose which one is shown first, but each result includes the angle in radians and in degrees, so you can copy whichever your worksheet or calculator expects.

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.

POSThttps://api.kit.forhosting.com/trig/rectangular-to-polar

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.

curl -X POST https://api.kit.forhosting.com/trig/rectangular-to-polar \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x":3,"y":4}'
{
  "x": 3,
  "y": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.rectangular_to_polar",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The origin (0, 0) is rejected with invalid_input because r is zero while the angle is undefined.

How to call the converter and read the result

Send the two Cartesian components as numeric fields x and y (digit strings that parse to finite numbers are also accepted). Typical clients include students verifying textbook polar form, engineers converting complex impedance or phasors, game developers turning offset vectors into heading and range, and data pipelines normalizing sensor readings that arrive in rectangular form but must be stored as magnitude and phase. Optionally set angle_unit to rad (default), deg, or both to control which angle fields are primary in the response; radians and degrees are always both included for convenience so you can copy either form into a calculator, a complex-analysis worksheet, or a graphics pipeline. On success the JSON includes r, theta (radians), theta_deg (degrees), the echoed x and y, a quadrant field (1–4 for open quadrants, or axis labels such as positive_x), and angle_unit. Pricing for a successful API call is a flat $0.002 under the item unit; validation failures are not charged.

The origin, axes, precision, and practical limits

When both x and y are exactly zero—or fall within a tiny epsilon of zero—the radius is zero and every angle is equally valid, so the polar representation is not unique. There is no network lookup, no random sampling, and no dependence on wall-clock time: identical inputs always produce identical output. Related intents such as polar-to-rectangular conversion or converting between degrees and radians alone are separate search problems; this landing is dedicated to turning Cartesian x and y into polar r and θ with correct quadrant handling. This capacity therefore rejects the origin with invalid_input and a message that the polar angle is undefined at the origin, rather than inventing θ = 0. Points that lie on an axis but not at the origin are valid: for example (5, 0) yields r = 5 and θ = 0, while (−2, 0) yields r = 2 and θ = π (180°), and (0, −3) yields r = 3 and θ = −π/2 (−90°). Missing fields, non-finite values (NaN, Infinity), or an unsupported angle_unit fail with invalid_input naming the problem.

Homework and complex-number magnitude-phase

Students convert points such as (3, 4) into r = 5 and θ = arctan(4/3), or check quadrant-two points like (−1, 1) where atan2 returns 3π/4 rather than a wrong first-quadrant angle.

How do I convert rectangular coordinates to polar?

POST numeric x and y to the rectangular-to-polar endpoint (or use the free browser form). The response includes r, theta in radians, theta_deg in degrees, and a quadrant label.

Is the browser tool free?

Yes. The in-browser runner uses the same library as the API and costs nothing. The API charges $0.002 per successful request from your prepaid KIT balance.

Are angles returned in degrees or radians?

Both: theta is radians and theta_deg is degrees. You can set angle_unit to rad, deg, or both; either way the companion unit is included for convenience.

Read the full KIT documentation →