{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.pythagorean/1.1.2/input.json",
  "title": "Pythagorean theorem — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "a": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Leg length a (positive; consistent length units)",
      "x-quantity-kind": "length",
      "x-role": "leg",
      "x-dimension": "L",
      "x-unit-policy": "arbitrary_consistent_length"
    },
    "b": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Leg length b (positive; consistent length units)",
      "x-quantity-kind": "length",
      "x-role": "leg",
      "x-dimension": "L",
      "x-unit-policy": "arbitrary_consistent_length"
    },
    "c": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Hypotenuse length c (positive; consistent length units)",
      "x-quantity-kind": "length",
      "x-role": "hypotenuse",
      "x-dimension": "L",
      "x-unit-policy": "arbitrary_consistent_length"
    },
    "solve_for": {
      "type": "string",
      "enum": [
        "a",
        "b",
        "c"
      ],
      "description": "Unknown side. Omit when verifying all three sides."
    },
    "mode": {
      "type": "string",
      "enum": [
        "verify",
        "check"
      ],
      "description": "Set to verify (or check) to test a²+b²=c² with all three sides."
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "solve_for": {
            "const": "c"
          }
        },
        "required": [
          "solve_for"
        ]
      },
      "then": {
        "required": [
          "a",
          "b"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "solve_for": {
            "const": "a"
          }
        },
        "required": [
          "solve_for"
        ]
      },
      "then": {
        "required": [
          "b",
          "c"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "solve_for": {
            "const": "b"
          }
        },
        "required": [
          "solve_for"
        ]
      },
      "then": {
        "required": [
          "a",
          "c"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "verify",
              "check"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "a",
          "b",
          "c"
        ]
      }
    }
  ],
  "anyOf": [
    {
      "required": [
        "a",
        "b"
      ]
    },
    {
      "required": [
        "a",
        "c"
      ]
    },
    {
      "required": [
        "b",
        "c"
      ]
    }
  ],
  "description": "Right-triangle solve a² + b² = c² for a missing side, plus area and perimeter; verify mode when all three sides given. (calculation_version 1.1.2)"
}
