Catalog/geometry-regular-polygon

Geometry

Regular polygon metrics API

Metrics of a regular n-gon from circumradius or side length: area, perimeter, apothem, interior/exterior angles. Answers 'what is the area of a regular hexagon with side 1?'.

Price$0.01per request
MethodPOST
Route/v1/geometry/regular-polygon
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
regular-polygonngonapothemcircumradiusareainterior-angle2d
API URLhttps://x402.hexl.dev/v1/geometry/regular-polygon
Integration docs
Example request
{
  "sides": 6,
  "sideLength": 1
}
Example response
{
  "sides": 6,
  "sideLength": 1,
  "circumradius": 1,
  "apothem": 0.866025404,
  "perimeter": 6,
  "area": 2.598076211,
  "interiorAngleDeg": 120,
  "exteriorAngleDeg": 60
}
Input schema
{
  "type": "object",
  "required": [
    "sides"
  ],
  "properties": {
    "sides": {
      "type": "integer",
      "minimum": 3,
      "examples": [
        6
      ]
    },
    "circumradius": {
      "type": "number"
    },
    "sideLength": {
      "type": "number",
      "examples": [
        1
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}