ForHosting KIT · Math

General form equation of a circle

A circle with center (3, −2) and radius 5 becomes x² + y² − 6x + 4y − 12 = 0 in general form. Enter the center and radius and get the three coefficients, with no slipped sign or forgotten square. 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
H
3
K
-2
Resistance (Ω)
5
You get
A
-6
B
4
C
-12

One call, three numbers, nothing stored, and the same code runs free in your browser on this page.

From center and radius to a single polynomial

Every circle in the plane is fully described by three numbers: the x and y coordinates of its center and the length of its radius. Written as (x − h)² + (y − k)² = r², that description is called the standard or center-radius form, and it is the form you read geometric information from at a glance. The conversion is pure algebra with no approximation involved, yet doing it by hand is exactly the sort of mechanical step where a sign slips or a square is forgotten.

Because the squared terms always carry coefficient one, three numbers are all the answer needs.

Where the general form is actually used

The standard form is what you want when a human is reading the equation, but the general form is what many systems store and transmit. Conic-section solvers, least-squares circle fits and algebraic geometry libraries all treat a circle as one case of a second-degree polynomial, and they expect the expanded coefficients rather than a center-radius triple. Computer graphics pipelines sometimes keep circles in general form because intersections with lines and other circles reduce to small linear-algebra problems in those coefficients.

Textbooks and exams move between the two forms in both directions, asking students to expand a given circle or to complete the square on given coefficients, so a reliable converter doubles as a checker for hand work. Programmatic users typically call this capability as a normalisation step: whatever form a circle arrives in, they convert it to general form before storing it, so comparisons and deduplication become simple coefficient equality.

Normalise circles before storage

Convert center-radius circle definitions to general-form coefficients so comparisons, deduplication and indexing in a geometry database become simple coefficient equality checks.

Feed a conic-section solver

Pass A, B and C straight into a library that treats circles as second-degree polynomials for intersection, fitting or transformation work.

Check analytic geometry homework

Expand (x − h)² + (y − k)² = r² by hand, then verify the resulting coefficients against the deterministic answer in one call.

What are A, B and C exactly?

For a circle with center (h, k) and radius r they are A = −2h, B = −2k and C = h² + k² − r².

Why does a radius of zero or less fail?

A radius of zero describes a single point, not a circle, and a negative radius is geometrically meaningless.

Can I control the precision of the result?

Yes. The decimals option sets the number of decimal places, from 0 to 12, with half-up rounding. It defaults to 12, which keeps the output byte-stable across platforms.

How do I go back from general form to center and radius?

Complete the square: h = −A/2, k = −B/2 and r = √(h² + k² − C). The reverse direction is covered by the dedicated circle equation capability in the catalogue.

Is anything I send stored?

No. The numbers are validated, the three coefficients are computed and the response is returned; the input is discarded immediately.

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/general-form-equation-circle

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/general-form-equation-circle \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"h":3,"k":-2,"r":5}'
{
  "h": 3,
  "k": -2,
  "r": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.general_form_equation_circle",
  "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 general form equation of a circle, x² + y² + Ax + By + C = 0, is the shape the equation takes once you expand the familiar standard form (x − h)² + (y − k)² = r² and collect every term on one side. This capability does that expansion for you: you send the center coordinates h and k together with the radius r, and you get back the three coefficients A, B and C, computed deterministically and rounded to a fixed number of decimals. It is a small conversion, but one that shows up constantly in analytic geometry homework, CAD tooling, computer graphics code and any system that stores circles in the expanded polynomial form.

From center and radius to a single polynomial

Expanding the two squares gives x² − 2hx + h² + y² − 2ky + k² = r², and moving everything to the left-hand side produces x² + y² + Ax + By + C = 0, the general form, with A = −2h, B = −2k and C = h² + k² − r². This endpoint performs that expansion for any finite center and any positive radius, returning the three coefficients as plain JSON numbers so they can feed a document, a drawing routine or a downstream solver without further parsing.

How the coefficients are computed and rounded

The implementation is deliberately transparent: A is minus twice the center's x-coordinate, B is minus twice the center's y-coordinate, and C is the sum of the squared coordinates minus the squared radius. Inputs are validated before any arithmetic happens: the center coordinates must be finite numbers, and the radius must be strictly positive, because a radius of zero describes a single point and a negative radius describes nothing at all. Supplying a non-positive radius, a missing field or a non-numeric value returns an invalid_input error with a message that names the offending field, and failed requests are not charged.

Where the general form is actually used

At $0.002 per request it is cheap enough to run inline in a pipeline, and the browser version costs nothing at all.

What does it cost?

$0.002 per request via the API. It is also free to run in your browser on this page — the same code executes in both places.

Read the full KIT documentation →