Regular polygon apothem calculator from circumradius
This regular polygon apothem calculator finds the shortest distance from the center of a regular polygon to any side.
Run — free
Enter the number of sides and the circumradius, which is the distance from the center to a vertex. The calculator applies the cosine relationship directly and returns the apothem as the inradius because those two measurements are identical for every regular polygon. Results can be rounded from zero to twelve decimal places, making the tool useful for quick geometry checks, construction layouts, diagrams, classroom exercises, and repeatable software calculations.
Understand the apothem and circumradius relationship
A regular polygon has equal sides, equal interior angles, and a well-defined center. Draw a line from the center to a vertex and another line from the center perpendicular to the neighboring side. Together with half of that side, these lines form a right triangle. The center-to-vertex line is the circumradius and acts as the hypotenuse. The perpendicular center-to-side line is the apothem. At the center, the angle inside this half-triangle is π divided by the number of sides. Cosine relates the adjacent side to the hypotenuse, so the calculation is apothem = circumradius × cos(π / number_of_sides). The apothem is also the polygon's inradius: it is the radius of the largest circle centered within the polygon that touches every side. This calculator returns both names so results remain clear whether your source material discusses polygon geometry, an inscribed circle, fabrication clearances, or architectural dimensions. No side length, perimeter, or area is required for this particular relationship.
Enter valid measurements and interpret the result
Set number_of_sides to a whole number from 3 through 1,000,000. Three describes an equilateral triangle, four a square, six a regular hexagon, and larger values increasingly resemble a circle. Set circumradius to a finite positive number no greater than 1,000,000,000,000,000. The calculation does not assign a physical unit, so the output uses the same unit as the circumradius: meters in produces meters out, inches in produces inches out, and pixels in produces pixels out. The optional decimals setting controls display rounding from zero through twelve places and defaults to six. Both apothem and inradius contain the same rounded result. The response also repeats number_of_sides and circumradius, which helps automated workflows associate an answer with its inputs. Rounding is applied only after evaluating the cosine formula, preserving the best available precision during calculation. Keep more decimal places for downstream calculations and round more aggressively only for presentation, labeling, or tolerances that genuinely need fewer digits.
Check behavior across different regular polygons
The formula behaves predictably across the supported range. For a square, cos(π/4) is about 0.7071, so the apothem is roughly seventy-one percent of the circumradius. For a regular hexagon, cos(π/6) is about 0.8660, placing each side farther from the center relative to the vertices. As the number of sides increases, π divided by that count becomes smaller and its cosine approaches one. The apothem therefore approaches the circumradius, matching the intuition that a many-sided regular polygon increasingly resembles its circumscribed circle. A valid result is always positive and never greater than the supplied circumradius. If a workflow produces the opposite relationship, check whether the supplied value was actually a diameter, side length, or apothem rather than a circumradius. The algorithm is deterministic, uses no network access, and depends only on the submitted numbers. Identical inputs produce identical JSON results, which makes the capability suitable for test fixtures, spreadsheets, CAD helpers, educational systems, and server-side validation where reproducibility matters.
What you can do with it
Fabrication and layout
Find the center-to-flat distance of a regular plate, nut, sign, or enclosure when the center-to-corner radius is known.
Geometry education
Check exercises that connect right-triangle trigonometry, circumcircles, incircles, and regular polygon measurements.
Graphics and CAD automation
Convert a vertex radius into an inradius for collision bounds, labels, guides, or repeated parametric designs.
FAQ
What formula does the calculator use?
It uses apothem = circumradius × cos(π / number_of_sides).
Are the apothem and inradius different?
Not for a regular polygon. The apothem equals the radius of the centered circle tangent to every side, so both returned fields have the same value.
Which units should I use?
Use any consistent length unit. The apothem and inradius are returned in the same unit as the circumradius.
Can I enter a diameter instead of a circumradius?
No. Divide the diameter by two first, then submit that value as circumradius.
How much does an API calculation cost?
Each API request starts at $0.002. The browser calculator can run the same deterministic calculation locally.
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/trig/regular-polygon-apothem \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"number_of_sides":6,"circumradius":10}'const res = await fetch("https://api.kit.forhosting.com/trig/regular-polygon-apothem", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"number_of_sides": 6,
"circumradius": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/regular-polygon-apothem",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"number_of_sides": 6,
"circumradius": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/regular-polygon-apothem", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"number_of_sides":6,"circumradius":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"number_of_sides":6,"circumradius":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/regular-polygon-apothem", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"number_of_sides": 6,
"circumradius": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.regular_polygon_apothem",
"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. |