Superellipse area calculator
Get the exact area inside a superellipse, from diamond to ellipse to squircle: semi-axes 2 and 1 with exponent 2 give the ellipse area 2π, and larger exponents approach the full rectangle 4ab. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 2
- B
- 1
- N
- 2
- Area
- 6.2831853072
- Special case
- ellipse
A superellipse, also called a Lamé curve, generalizes the ordinary ellipse by raising each normalized coordinate to a free positive exponent n. When n equals two you recover the classic elliptical disk of area πab; when n equals one the curve is a diamond with area 2ab; as n grows the outline approaches a rectangle of area 4ab. Designers use superellipses for squircles, furniture profiles, stadium bowls, and typeface ovals; engineers and students need a single closed-form area that stays accurate for every positive n without numerical quadrature. This superellipse area calculator accepts the two positive semi-axes a and b and the positive Lamé exponent n, evaluates the analytic gamma formula for the enclosed region, and returns a rounded area with the formula string.
What a Lamé superellipse is and how its area is derived
The Cartesian equation of a centered axis-aligned superellipse is the absolute-value power sum absolute value of x over a to the n plus absolute value of y over b to the n equals one, where a and b are positive semi-axis lengths and n is a positive real exponent. For n equal to two the equation collapses to the familiar ellipse x squared over a squared plus y squared over b squared equals one. For n equal to one it is a rhombus whose diagonals are 2a and 2b.
Values between one and two produce pinched diamonds; values greater than two produce rounded rectangles often called squircles when a equals b. The enclosed area follows from integrating one quadrant and multiplying by four.
After the substitution that maps the first quadrant onto a unit square, the integral factors into a product of beta or gamma functions and yields the compact closed form A equals four times a times b times the square of the gamma of one plus one over n, all divided by the gamma of one plus two over n. That identity is exact for every positive finite n; no adaptive quadrature is required.
This capability implements that formula with a Lanczos gamma approximation for general n, and short-circuits to the exact textbook specials area equals two a b when n is one and area equals pi a b when n is two so floating-point drift never spoils classroom goldens. As n tends to infinity the gamma ratio tends to one and the area tends to four a b, matching the limiting rectangle. As n tends to zero the area tends to zero, matching a cross of vanishing thickness.
Where superellipse areas are used
Product and industrial designers use a superellipse area calculator when sizing squircles for app icons, speaker grilles, pill-shaped buttons, and table tops so material estimates stay consistent with the true Lamé interior rather than a crude rectangle or ellipse bound. Mathematics classrooms and exam-prep generators need a deterministic oracle that returns πab at n equals two, two a b at n equals one, and a smooth gamma-based area elsewhere, while rejecting non-positive exponents instead of inventing a hollow zero. Failed validation does not consume balance.
Keep requests small, pin the rounded area in tests, and you get reproducible enclosed areas for CAD pre-checks, LMS plugins, and edge workers without standing up a computer-algebra stack of your own.
What you can do with it
Squircle and product design sizing
Compute the true enclosed area of icon squircles, rounded panels, and furniture profiles from semi-axes a, b and exponent n before ordering material.
Architecture and landscape notebooks
Estimate floor or plaza area for stadium bowls and rounded footprints modeled as superellipses without embedding a numerical integrator.
FAQ
How do I calculate the area of a superellipse?
Send positive finite a, b (semi-axes) and positive n (Lamé exponent).
What happens if the exponent n is not positive?
The classical real-area formula requires a positive exponent; zero or negative n is rejected and not billed.
What area do semi-axes 2 and 1 with exponent 2 give?
They give 2π, about 6.28318530718, because exponent 2 is the ordinary ellipse and its area is π times the two semi-axes. The result is marked as the ellipse case.
What does the exponent n change in the shape?
At 1 the curve is a diamond, between 1 and 2 a pinched diamond, at 2 an ellipse, and above 2 a rounded rectangle. As n keeps growing, the area approaches the rectangle 4ab.
How do I get the area of a squircle?
Enter the same value for both semi-axes and an exponent greater than 2. That rounded square is the shape used for app icons, and the result is its exact enclosed area.
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/geom/superellipse-area \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":2,"b":1,"n":2.5}'const res = await fetch("https://api.kit.forhosting.com/geom/superellipse-area", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 2,
"b": 1,
"n": 2.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/superellipse-area",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 2,
"b": 1,
"n": 2.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/superellipse-area", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":2,"b":1,"n":2.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":2,"b":1,"n":2.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/superellipse-area", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 2,
"b": 1,
"n": 2.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.superellipse_area",
"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
Non-positive exponents are rejected as invalid_input because the classical real-area identity requires n greater than zero.
What a Lamé superellipse is and how its area is derived
Those limits explain why the endpoint insists that the exponent be strictly positive: the classical real-area formula is stated for n greater than zero, and non-positive n either leaves the real plane or produces a degenerate set without a finite interior in the usual sense taught in calculus and design geometry.
Input contract, response shape, and error behaviour
On success the body echoes a, b, and n rounded to twelve decimal places for stable goldens across runtimes, returns area as the enclosed real area under the same rounding, and includes formula as the gamma identity string. Example: a equals two, b equals one, n equals two yields area equal to two pi, recovering the ordinary ellipse area πab. Example: a equals two, b equals one, n equals one yields area equal to four, the diamond with diagonals four and two. POST a JSON body with three required finite numbers: a, the positive horizontal semi-axis; b, the positive vertical semi-axis; and n, the positive Lamé exponent. Each field may arrive as a JSON number or as a decimal numeric string; aliases semi_axis_a, semiAxisA, and A are accepted for a, the corresponding family for b, and exponent, p, or power for n. Missing fields, empty strings, non-finite values, and non-numeric types fail with invalid_input naming the field. When n is exactly one the payload also sets special_case to diamond; when n is exactly two it sets special_case to ellipse. Pair the response with your own plotter if you need the boundary curve; this endpoint computes the scalar enclosed area only and does not emit SVG paths, sampling points, or perimeter estimates.
Where a superellipse area API earns its keep
Architecture and landscape notebooks often describe stadium seating bowls, rounded plazas, and furniture footprints with n greater than two; calling a tiny parse API avoids embedding a numerical integrator in every spreadsheet.
Integration use cases
Classroom Lamé-curve checks
Let students verify that n=2 recovers πab, n=1 recovers the diamond 2ab, and other positive n match the gamma formula without hand quadrature.
Technical questions
Does n=2 match the ordinary ellipse area?
Yes. When n is exactly two the handler returns area = π·a·b and special_case = ellipse, matching the standard elliptical disk.
What shape do I get when n=1?
A diamond (rhombus) with diagonals 2a and 2b. The area is exactly 2·a·b, returned with special_case = diamond.
What does the superellipse area calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.