omni_regular_polygon
Calculate area, perimeter, apothem, and circumradius for regular polygons with 3 to 1000 sides using side count and length, preventing manual arithmetic and formula errors.
Instructions
Universal Regular N-Sided Polygon Solver (3 to 1000 Sides). Arbitrary n-sided regular polygon solver calculating apothem, circumradius, area, perimeter, and internal angles. Discipline: GEOMETRY. Governing mathematical model / formula: Area = ½ · n · a · r_i | r_i = a / [2 · tan(π/n)] | R = a / [2 · sin(π/n)].
USAGE GUIDELINES:
WHEN TO USE: Invoke for deterministic calculation of area (Polygon Area), perimeter (Perimeter), apothem (Apothem (Inradius r_i)), circumradius (Circumradius (R)) using n (Number of Sides (n) in sides), side (Side Length (a) in units). Guarantees exact machine floating-point precision, eliminating LLM arithmetic mistakes and formula hallucinations.
WHEN NOT TO USE: Do not use for qualitative evaluations or unquantified reasoning. All input parameters must be valid numerical values.
SIBLING ROUTING: Use this dedicated specialist tool for 'Universal Regular N-Sided Polygon Solver (3 to 1000 Sides)' rather than generic dispatchers like omni_universal_query. For cross-discipline dynamic dispatch, see omni_universal_query.
BEHAVIOR & SAFETY:
Pure deterministic computation with machine floating-point precision.
Read-only, idempotent, and stateless. Zero side effects or persistent state mutations.
Input validation: All arguments are validated against physical and domain bounds. Out-of-bounds inputs return a safe diagnostic error status without throwing runtime exceptions.
RETURNS:
Structured JSON object containing:
status (string): "success" on valid execution or "error" if validation fails
calculator (string): "regular-polygon"
category (string): "geometry"
name (string): "Universal Regular N-Sided Polygon Solver (3 to 1000 Sides)"
formula (string): Governing mathematical formula string
inputs (object): Echoed input parameter dictionary with applied defaults
metrics (object): Dictionary of computed outputs:
metrics.area (Polygon Area): Formatted display string (e.g. '482.8427 sq units')
metrics.perimeter (Perimeter): Formatted display string (e.g. '80.0000 units')
metrics.apothem (Apothem (Inradius r_i)): Formatted display string (e.g. '12.0711 units')
metrics.circumradius (Circumradius (R)): Formatted display string (e.g. '13.0656 units')
execution_time_ms (number): Latency in milliseconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "omni_regular_polygon"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of Sides (n) (sides). Number of polygon vertices. Default: 8. Min: 3. Max: 1000. | |
| side | No | Side Length (a) (units). Outer edge length. Default: 10. Min: 0.001. Max: 100000. |