{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.geometry.circle.input.json",
  "title": "Circle — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "anyOf": [
        {
          "const": ""
        },
        {
          "type": "string",
          "pattern": "^\\s*(?:[fF][rR][oO][mM][_-][rR][aA][dD][iI][uU][sS]|[rR][aA][dD][iI][uU][sS]|[rR]|[fF][rR][oO][mM][_-][dD][iI][aA][mM][eE][tT][eE][rR]|[dD][iI][aA][mM][eE][tT][eE][rR]|[fF][rR][oO][mM][_-][cC][iI][rR][cC][uU][mM][fF][eE][rR][eE][nN][cC][eE]|[cC][iI][rR][cC][uU][mM][fF][eE][rR][eE][nN][cC][eE]|[fF][rR][oO][mM][_-][cC]|[fF][rR][oO][mM][_-][aA][rR][eE][aA]|[aA][rR][eE][aA]|[aA][rR][cC]|[aA][rR][cC][_-][lL][eE][nN][gG][tT][hH]|[sS][eE][cC][tT][oO][rR]|[sS][eE][cC][tT][oO][rR][_-][aA][rR][eE][aA])\\s*$"
        }
      ],
      "default": "from_radius"
    },
    "r": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "radius": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "diameter": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "d": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "circumference": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "area": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-quantity-kind": "area",
      "x-dimension": [
        2,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "input_length_unit_squared",
      "x-uuce-role": "scalar"
    },
    "theta_deg": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-unit": "deg",
      "x-unit-id": "cx:deg",
      "x-quantity-kind": "plane_angle",
      "x-role": "scalar",
      "x-dimension": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-uuce-unit": {
        "unit_id": "cx:deg",
        "revision": "1.0.0",
        "content_digest": "ebb31e3abee53f3bf57339c87949e1018d141739fba8a07f54c42ebfd219262b",
        "dependency_digest": "eef386126ec6524884c84bab06f2a96996df913376c0ce5ccdaca0e7faf7b9c3",
        "quantity_kind": "plane_angle",
        "dimension": [
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "registry_version": "0.3.0-preview.3",
        "digest_contract": "calculatorx-unit-definition-digests-v2",
        "registry_status": "preview",
        "definition_lifecycle": "candidate",
        "role": "scalar"
      }
    },
    "theta": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)|(?:[0-9]{1,3}(?:,[0-9]{3})+(?:\\.[0-9]*)?))(?:[eE][+\\-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite JSON number or decimal text. Nonzero-to-zero conversion is NUMERIC_UNDERFLOW; positive length/area is required; normalized numeric values must fit the published normal-output envelope.",
      "x-unit": "deg",
      "x-unit-id": "cx:deg",
      "x-quantity-kind": "plane_angle",
      "x-role": "scalar",
      "x-dimension": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-uuce-unit": {
        "unit_id": "cx:deg",
        "revision": "1.0.0",
        "content_digest": "ebb31e3abee53f3bf57339c87949e1018d141739fba8a07f54c42ebfd219262b",
        "dependency_digest": "eef386126ec6524884c84bab06f2a96996df913376c0ce5ccdaca0e7faf7b9c3",
        "quantity_kind": "plane_angle",
        "dimension": [
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "registry_version": "0.3.0-preview.3",
        "digest_contract": "calculatorx-unit-definition-digests-v2",
        "registry_status": "preview",
        "definition_lifecycle": "candidate",
        "role": "scalar"
      }
    }
  },
  "allOf": [
    {
      "if": {
        "anyOf": [
          {
            "not": {
              "required": [
                "mode"
              ]
            }
          },
          {
            "properties": {
              "mode": {
                "const": ""
              }
            },
            "required": [
              "mode"
            ]
          },
          {
            "properties": {
              "mode": {
                "type": "string",
                "pattern": "^\\s*(?:[fF][rR][oO][mM][_-][rR][aA][dD][iI][uU][sS]|[rR][aA][dD][iI][uU][sS]|[rR])\\s*$"
              }
            },
            "required": [
              "mode"
            ]
          }
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "r"
                ]
              },
              {
                "required": [
                  "radius"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "properties": {
              "mode": {
                "type": "string",
                "pattern": "^\\s*(?:[fF][rR][oO][mM][_-][dD][iI][aA][mM][eE][tT][eE][rR]|[dD][iI][aA][mM][eE][tT][eE][rR])\\s*$"
              }
            },
            "required": [
              "mode"
            ]
          }
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "diameter"
                ]
              },
              {
                "required": [
                  "d"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "properties": {
              "mode": {
                "type": "string",
                "pattern": "^\\s*(?:[fF][rR][oO][mM][_-][cC][iI][rR][cC][uU][mM][fF][eE][rR][eE][nN][cC][eE]|[cC][iI][rR][cC][uU][mM][fF][eE][rR][eE][nN][cC][eE]|[fF][rR][oO][mM][_-][cC])\\s*$"
              }
            },
            "required": [
              "mode"
            ]
          }
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "circumference"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "properties": {
              "mode": {
                "type": "string",
                "pattern": "^\\s*(?:[fF][rR][oO][mM][_-][aA][rR][eE][aA]|[aA][rR][eE][aA])\\s*$"
              }
            },
            "required": [
              "mode"
            ]
          }
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "area"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "properties": {
              "mode": {
                "type": "string",
                "pattern": "^\\s*(?:[aA][rR][cC]|[aA][rR][cC][_-][lL][eE][nN][gG][tT][hH])\\s*$"
              }
            },
            "required": [
              "mode"
            ]
          }
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "r"
                ]
              },
              {
                "required": [
                  "radius"
                ]
              }
            ]
          },
          {
            "anyOf": [
              {
                "required": [
                  "theta_deg"
                ]
              },
              {
                "required": [
                  "theta"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "properties": {
              "mode": {
                "type": "string",
                "pattern": "^\\s*(?:[sS][eE][cC][tT][oO][rR]|[sS][eE][cC][tT][oO][rR][_-][aA][rR][eE][aA])\\s*$"
              }
            },
            "required": [
              "mode"
            ]
          }
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "r"
                ]
              },
              {
                "required": [
                  "radius"
                ]
              }
            ]
          },
          {
            "anyOf": [
              {
                "required": [
                  "theta_deg"
                ]
              },
              {
                "required": [
                  "theta"
                ]
              }
            ]
          }
        ]
      }
    }
  ],
  "$defs": {
    "normalized": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "enum": [
            "from_radius",
            "from_diameter",
            "from_circumference",
            "from_area",
            "arc",
            "sector"
          ]
        },
        "r": {
          "type": "number",
          "exclusiveMinimum": 0,
          "x-quantity-kind": "length",
          "x-dimension": [
            1,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "x-unit-policy": "arbitrary_consistent_length",
          "x-uuce-role": "scalar"
        },
        "diameter": {
          "type": "number",
          "exclusiveMinimum": 0,
          "x-quantity-kind": "length",
          "x-dimension": [
            1,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "x-unit-policy": "arbitrary_consistent_length",
          "x-uuce-role": "scalar"
        },
        "circumference": {
          "type": "number",
          "exclusiveMinimum": 0,
          "x-quantity-kind": "length",
          "x-dimension": [
            1,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "x-unit-policy": "arbitrary_consistent_length",
          "x-uuce-role": "scalar"
        },
        "area": {
          "type": "number",
          "exclusiveMinimum": 0,
          "x-quantity-kind": "area",
          "x-dimension": [
            2,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "x-unit-policy": "input_length_unit_squared",
          "x-uuce-role": "scalar"
        },
        "theta_deg": {
          "type": "number",
          "x-unit": "deg",
          "x-unit-id": "cx:deg",
          "x-quantity-kind": "plane_angle",
          "x-role": "scalar",
          "x-dimension": [
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "x-uuce-unit": {
            "unit_id": "cx:deg",
            "revision": "1.0.0",
            "content_digest": "ebb31e3abee53f3bf57339c87949e1018d141739fba8a07f54c42ebfd219262b",
            "dependency_digest": "eef386126ec6524884c84bab06f2a96996df913376c0ce5ccdaca0e7faf7b9c3",
            "quantity_kind": "plane_angle",
            "dimension": [
              0,
              0,
              0,
              0,
              0,
              0,
              0
            ],
            "registry_version": "0.3.0-preview.3",
            "digest_contract": "calculatorx-unit-definition-digests-v2",
            "registry_status": "preview",
            "definition_lifecycle": "candidate",
            "role": "scalar"
          }
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "mode": {
                "const": "from_radius"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "required": [
              "r"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "from_diameter"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "required": [
              "diameter"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "from_circumference"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "required": [
              "circumference"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "from_area"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "required": [
              "area"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "arc"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "required": [
              "r",
              "theta_deg"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "mode": {
                "const": "sector"
              }
            },
            "required": [
              "mode"
            ]
          },
          "then": {
            "required": [
              "r",
              "theta_deg"
            ]
          }
        }
      ]
    }
  },
  "description": "Raw Circle calculation inputs. Omitted/empty mode defaults to from_radius and requires r or radius. Mode aliases are case-insensitive and accept hyphens. Required active fields depend on mode. Decimal strings normalize to binary64; conversion/domain/range errors are checked after structural Schema validation. Matching r/radius, diameter/d and theta_deg/theta aliases are accepted; conflicting values are AMBIGUOUS_INPUT. Unknown fields are UNKNOWN_INPUT. Other declared numeric fields are validated and then ignored when inactive. Normalized responses contain only canonical mode and active numeric fields (#/$defs/normalized). Arc/sector API discovery routes lock their respective mode. (calculation_version 1.2.0)",
  "x-unit-contract": {
    "protocol": "calculatorx-field-unit-contract-v1",
    "capability_id": "math.geometry.circle",
    "registry_version": "0.3.0-preview.3",
    "declaration_scope": "Field/branch declarations only; inactive fields are not asserted to exist. No conversion-engine migration or new numerical certification.",
    "path_format": "Paths relative to inputs or result_detail.value; dot separates properties, * denotes array items, $ denotes a scalar result.",
    "inputs": {
      "theta_deg": {
        "unit": "deg",
        "reference": {
          "unit_id": "cx:deg",
          "revision": "1.0.0",
          "content_digest": "ebb31e3abee53f3bf57339c87949e1018d141739fba8a07f54c42ebfd219262b",
          "dependency_digest": "eef386126ec6524884c84bab06f2a96996df913376c0ce5ccdaca0e7faf7b9c3",
          "quantity_kind": "plane_angle",
          "dimension": [
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "registry_version": "0.3.0-preview.3",
          "digest_contract": "calculatorx-unit-definition-digests-v2",
          "registry_status": "preview",
          "definition_lifecycle": "candidate",
          "role": "scalar"
        }
      },
      "theta": {
        "unit": "deg",
        "reference": {
          "unit_id": "cx:deg",
          "revision": "1.0.0",
          "content_digest": "ebb31e3abee53f3bf57339c87949e1018d141739fba8a07f54c42ebfd219262b",
          "dependency_digest": "eef386126ec6524884c84bab06f2a96996df913376c0ce5ccdaca0e7faf7b9c3",
          "quantity_kind": "plane_angle",
          "dimension": [
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "registry_version": "0.3.0-preview.3",
          "digest_contract": "calculatorx-unit-definition-digests-v2",
          "registry_status": "preview",
          "definition_lifecycle": "candidate",
          "role": "scalar"
        }
      }
    },
    "outputs": {
      "theta_deg": {
        "unit": "deg",
        "reference": {
          "unit_id": "cx:deg",
          "revision": "1.0.0",
          "content_digest": "ebb31e3abee53f3bf57339c87949e1018d141739fba8a07f54c42ebfd219262b",
          "dependency_digest": "eef386126ec6524884c84bab06f2a96996df913376c0ce5ccdaca0e7faf7b9c3",
          "quantity_kind": "plane_angle",
          "dimension": [
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "registry_version": "0.3.0-preview.3",
          "digest_contract": "calculatorx-unit-definition-digests-v2",
          "registry_status": "preview",
          "definition_lifecycle": "candidate",
          "role": "scalar"
        }
      },
      "theta_rad": {
        "unit": "rad",
        "reference": {
          "unit_id": "cx:rad",
          "revision": "1.0.0",
          "content_digest": "842467a958d28ac79bf34e796043449f6af24819d77b2b67f540dbabdecc8e3e",
          "dependency_digest": "9c07023393c6212aab52719f503df1bdc9456559b5c4719ff1fec47d0623e0ad",
          "quantity_kind": "plane_angle",
          "dimension": [
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "registry_version": "0.3.0-preview.3",
          "digest_contract": "calculatorx-unit-definition-digests-v2",
          "registry_status": "preview",
          "definition_lifecycle": "candidate",
          "role": "scalar"
        }
      }
    },
    "quantity_policy": {
      "physical_unit_id": null,
      "input_policy": "Abstract consistent coordinate/length units; no physical unit is selected by this calculator.",
      "derived_policy": "Lengths inherit the input length unit U; areas U^2; volumes U^3. No implicit conversion or fixed metre binding.",
      "coefficient_policy": "Normalized implicit line/equation coefficients have equation-scale conventions, not universal physical unit IDs."
    }
  }
}
