Source: https://guthlabs.ai/docs/instruments/2d-shape-area-perimeter-calculator/implementation/

instrument implementation / implementation-contract

# 2D Shape Area/Perimeter Calculator implementation

A source-bound implementation contract for 2D Shape Area/Perimeter Calculator; deployment and executable qualification remain separate.

Status: **VERIFIED_CLEAN**Lifecycle: **implementation-contract**

## Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

**Record owner**: Guth Instruments

**Lifecycle**: verified-clean

**Evidence ID**: t4-165

**Effect**: Computation or source lookup only

## Input and validation requirements

- Division by zero is not inherent in the listed formulas, but any future formulas using an apothem, height, radius, or other denominator must reject zero denominators.

- Negative radii, negative lengths, invalid polygon vertex lists, fewer than three polygon vertices, and non-finite numeric inputs require validation.

- Self-intersecting polygon vertices can produce an algebraic shoelace result that is not the intended geometric area; this case needs an explicit policy.

- A sector angle outside the valid range for the intended sector representation, such as an angle greater than 360 degrees, needs validation or a defined interpretation.

- Ellipse perimeter requires an approximation or numerical method; labeling it as exact without qualification would be misleading.

## Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

## Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

````
{
  "inputs": {
    "shape": "circle",
    "radius": 5,
    "length_unit": "cm"
  },
  "expected_outputs": {
    "area": 78.53981633974483,
    "perimeter": 31.41592653589793,
    "area_unit": "cm²",
    "perimeter_unit": "cm"
  },
  "working": "Area = πr² = π × 5² = 25π = 78.53981633974483 cm². Perimeter = 2πr = 2 × π × 5 = 10π = 31.41592653589793 cm."
}
````

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/2d-shape-area-perimeter-calculator/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/2d-shape-area-perimeter-calculator/mechanism/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/2d-shape-area-perimeter-calculator/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche4/tranche4-results.json`
