N-antiprism calculator
A square antiprism with every edge 1 has a volume of about 0.957 and a surface area of about 5.464 square units. Enter any number of base sides from 3 up and one common edge length, and both results appear together. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 4
- Edge
- 1
- Volume
- 0.9569999818
- Surface area
- 5.4641016151
An n-gonal antiprism is a polyhedron with two parallel regular n-gon bases twisted relative to each other and joined by a belt of 2n triangles. When every edge has the same length, the solid is a uniform antiprism: the bases are regular n-gons and the side faces are equilateral triangles. This calculator takes the integer side count n (at least three) and the common edge length, then returns the enclosed volume and the total surface area of all faces.
How volume and surface area are computed
Label the integer number of sides of each regular base as n and the common edge length of the uniform antiprism as a (the edge field). The solid has two congruent regular n-gon bases rotated by π/n relative to each other and 2n equilateral triangular lateral faces, so every edge equals a.
Volume follows the closed uniform-antiprism formula: V equals n times the square root of four cosine squared of π over 2n minus one, times sine of 3π over 2n, all divided by twelve times sine squared of π over n, then multiplied by a cubed. Surface area is the sum of the two regular n-gon base areas and the 2n equilateral triangles: A equals n over two times the quantity cotangent of π over n plus the square root of three, times a squared.
The base contribution uses the standard regular-polygon area n a squared over four times cotangent of π over n; each equilateral triangle has area a squared times square root of three over four, and there are 2n of them.
Classic checks include n equals three and a equals one, which is the regular octahedron with volume square root of two over three and surface area two square root of three; a square antiprism with n equals four and a equals one yields a larger volume and a surface of roughly five point four six four square units.
Because the path uses only a fixed set of trigonometric evaluations, multiplications, and one square root, it is deterministic, O(1) in n for practical purposes of a single evaluation, and free of iterative solvers.
Where n-antiprism calculations show up in real work
Secondary-school and college solid-geometry courses introduce antiprisms as the twisted cousins of prisms; students are asked for volume and surface when all edges are equal, especially for the triangular case that is the regular octahedron and for square or pentagonal antiprisms used as Archimedean-solid examples. A trusted calculator with a strict n-at-least-three gate and positive-edge check speeds homework grading and removes spreadsheet mistakes where someone applies prism formulas to an antiprism or forgets the 2n triangular faces.
Polyhedron libraries, CAD kernels and mesh tools often store antiprism primitives for collision proxies, decorative columns, and parametric geometry; deterministic volume and surface support property panels and material estimates without meshing every face. Game and real-time graphics pipelines use analytic metrics for debug readouts, physics mass from volume, and UV or paint-area estimates from surface. Architecture, product design and fabrication shops estimate twisted prismatic forms, jewelry, and decorative solids where antiprism-like proportions appear; volume feeds material use while surface informs coating and wrap.
If you later need a right prism, a free-height non-uniform antiprism, star antiprisms, or packing density of multiple solids, treat those as separate search intents rather than overloading this n-antiprism landing.
What you can do with it
Homework and exam checks
Compute uniform n-antiprism volume and total surface area from side count and edge, and reject n below three or non-positive edges with a clear error.
Polyhedron libraries and CAD metrics
From n and edge length, recover volume and surface for antiprism primitives in CAD panels, collision proxies and material estimates.
Game and graphics solid properties
Turn side count and edge into volume and surface for mass, paint area and debug readouts without meshing the solid.
FAQ
What formulas does this calculator use?
For a uniform n-gonal antiprism with edge a: volume V = n·√(4cos²(π/(2n))−1)·sin(3π/(2n))/(12·sin²(π/n))·a³; surface area A = (n/2)·(cot(π/n)+√3)·a².
What if the edge length is zero or negative?
The common edge must be a positive finite number.
What does it cost?
The browser tool is free and runs locally.
Is a triangular antiprism the same as an octahedron?
Yes. With three sides per base and all edges equal, the antiprism is the regular octahedron: an edge of 1 gives a volume of the square root of two over three and a surface of two times the square root of three.
How many faces does an antiprism have?
Two parallel regular bases plus a belt of triangles, twice as many as the sides of one base. A square antiprism therefore has 2 squares and 8 equilateral triangles, all with the same edge length.
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/antiprism \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":4,"edge":1}'const res = await fetch("https://api.kit.forhosting.com/geom/antiprism", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 4,
"edge": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/antiprism",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 4,
"edge": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/antiprism", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":4,"edge":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":4,"edge":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/antiprism", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 4,
"edge": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.antiprism",
"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
Values of n below three are rejected with a clear invalid_input error; non-positive edges fail validation instead of producing silent NaNs. No network calls, no random sampling, and no floating-point surprises beyond ordinary IEEE-754 arithmetic on the numbers you provide.
How volume and surface area are computed
Huge magnitudes can still overflow IEEE-754 double range; when intermediates are non-finite the request fails with a clear overflow message instead of returning Infinity in JSON. That closed form matches solid-geometry references for uniform antiprisms and keeps automated graders aligned with hand computation on the same two inputs.
What you send and what you get back
Provide two required fields: n is the integer side count of each regular polygonal base and must be at least three; edge is the positive finite common edge length shared by the bases and all triangular faces. Example checks: n four and edge one produce a finite volume near zero point nine five seven and surface area near five point four six four; n three and edge one recover the regular octahedron metrics; n two fails naming that n must be at least three; a negative edge fails naming the edge field. Wire the free browser tool for quick sanity checks, then call the identical contract from scripts for bulk evaluation without reimplementing antiprism formulas in every language. Optional zero edge is not accepted because a zero-edge solid collapses and the product gate requires a strictly positive edge; n may be large within an internal upper bound so pathological trig arguments stay well-defined in double precision. Missing fields, empty strings, non-numeric text, NaN, Infinity, non-integer n, n below three, and a non-positive edge are rejected with invalid_input and are not charged. On success the JSON response returns n, edge, volume, surface_area, formula summarizing the closed forms, and method set to uniform_n_antiprism_volume_surface so logs and teaching UIs can document the algorithm. API pricing is the published base of $0.002 per successful item.
Where n-antiprism calculations show up in real work
Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.
Technical questions
What happens if n is below three?
The request fails with invalid_input. An n-gonal antiprism requires at least three sides per base; digonal (n=2) specials are not accepted.
Is n = 3 the regular octahedron?
Yes. A uniform triangular antiprism is the regular octahedron. With edge 1, volume is √2/3 and surface area is 2√3.