ForHosting KIT · Math

Rectangular to polar

The point (3, 4) sits 5 units from the origin at an angle of about 53.13°. Enter any x and y and get the radius and the angle in degrees, in the right quadrant even when x is negative or zero. 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
X
3
Y
4
You get
Radius
5
Angle
53.1301023542

Rectangular coordinates describe a point with a horizontal component x and a vertical component y. Polar form describes the same point as a non-negative radial distance from the origin and a directed angle measured from the positive x-axis. This rectangular to polar calculator accepts any pair of finite numbers, computes the radius with hypot(x, y), and computes the angle in degrees with atan2(y, x) so every quadrant and both axes are correct.

What rectangular-to-polar conversion means

In the Cartesian plane a point is an ordered pair (x, y). The same geometric location can be written in polar form as a radius r and an angle θ: r is the straight-line distance from the origin to the point, and θ is the directed angle from the positive x-axis to the ray through the point.

Algebraically r equals the Euclidean length hypot(x, y), which is the non-negative square root of x squared plus y squared but is computed with a scaled hypot that stays finite for a wider range of magnitudes than a naive sqrt of a sum of squares. The angle is not the one-argument arctangent of y divided by x. That classroom shortcut loses the sign of x, fails on the negative x-axis, and is undefined when x is zero.

The two-argument function atan2(y, x) encodes the correct branch for all four open quadrants and both coordinate axes, returning a value in the interval (−π, π] radians, which this capability multiplies by one hundred eighty over π so the published angle is always in degrees in (−180, 180]. A point on the positive x-axis has angle zero. A point on the positive y-axis has angle ninety.

A point on the negative x-axis has angle one hundred eighty. A point on the negative y-axis has angle negative ninety. The classic classroom pair x equals three and y equals four has radius five and angle arctangent of four thirds, about fifty-three point one three degrees, which is the first-quadrant check every textbook uses.

Quadrants, precision, and where the conversion is used

Quadrant two is the case that exposes a one-argument arctangent bug. The point x equals negative one and y equals one has radius sqrt of two and angle one hundred thirty-five degrees; atan of y over x would wrongly report negative forty-five degrees because the quotient is negative one. Quadrant three, for example negative one and negative one, must return negative one hundred thirty-five degrees, not a first-quadrant forty-five.

Quadrant four, for example one and negative one, must return negative forty-five. Those four checks, plus the four axis rays, are enough to prove a converter is using atan2 rather than a patched atan. Classrooms use it to check polar form of a complex number a plus b i.

Engineering scripts turn real and imaginary parts of impedance or FFT bins into magnitude and a degree phase. Game and robotics code converts an offset vector into range and heading without re-implementing hypot and atan2 edge cases.

Homework and complex-number polar form

Convert a classroom pair such as (3, 4) into radius 5 and a degree angle, or check a quadrant-two point such as (−1, 1) where atan2 must return 135 degrees rather than a wrong first-quadrant result.

Engineering magnitude and phase in degrees

Turn the real and imaginary parts of impedance, voltage, or FFT bins into a non-negative magnitude and a phase in degrees for reports, Bode tables, and power-factor checks.

Games, robotics, and heading from an offset

Convert a velocity or offset vector (dx, dy) into range and a degree heading so steering, targeting, and telemetry can use polar form without reinventing hypot and atan2.

How do I convert rectangular coordinates to polar form?

Send finite numbers x and y. The response includes radius = hypot(x, y) and angle in degrees from atan2(y, x).

Are angles returned in degrees or radians?

Degrees. The angle field is atan2(y, x) multiplied by 180/π and lies in (−180, 180]. Convert to radians yourself by multiplying by π/180 if a downstream formula needs radians.

What happens if x or y is not a finite number?

Missing values, empty strings, NaN, and Infinity are rejected and are not billed.

What is the polar form of the origin (0, 0)?

Radius is 0 and the angle is 0 degrees.

Why does the angle sometimes come out negative?

Angles are measured from the positive x-axis and run from −180° to 180°, with 180° itself included. Points below the horizontal axis, in the third and fourth quadrants, therefore get a negative angle instead of a value above 180°.

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/math/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/math/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": "math.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.

Missing fields, empty strings, NaN, and infinities fail with invalid_input and are not billed.

Input contract, response shape, and error behaviour

POST a JSON body with two required finite numbers: x, the horizontal rectangular coordinate, and y, the vertical rectangular coordinate. Each field may arrive as a JSON number or as a decimal numeric string, including scientific notation. Aliases real and cartesian_x are accepted for x; imag and cartesian_y are accepted for y. Missing fields, empty strings, objects, arrays, and non-finite values such as NaN or Infinity fail with invalid_input naming the field, and those failures are not billed. On success the body echoes the parsed x and y, rounded to twelve decimal places for stable goldens across JavaScript engines, plus radius, angle in degrees, and a formula string restating r equals hypot of x and y and angle_deg equals atan2 of y and x times one hundred eighty over π. Unlike tools that refuse the origin, this calculator treats (0, 0) as a valid point: the radius is zero and atan2 of zero and zero is defined as zero degrees, which is the IEEE convention and a deterministic contract you can pin in tests. Pair the numeric fields with your own plot if you need a sketch; this endpoint converts coordinates only and does not emit drawings or step-by-step prose beyond the formula. Successful API calls use the published $0.002 item price.

What does the rectangular to polar calculator cost?

The browser tool is free and uses the same library as the API. Successful API requests use prepaid balance at $0.002 per call; invalid input is not billed.

Read the full KIT documentation →