{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.numerical.interpolate/1.1.6/input.json",
  "title": "Numerical interpolation — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "method": {
      "type": "string",
      "description": "linear/lerp/piecewise; lagrange/polynomial; spline/cubic/cubic_spline/natural_spline. Case insensitive; whitespace/hyphens normalize."
    },
    "mode": {
      "type": "string",
      "description": "Alias of method; supplied aliases must agree."
    },
    "x": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
    },
    "points": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "array",
          "minItems": 2,
          "maxItems": 100,
          "items": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  },
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  }
                ],
                "items": false,
                "minItems": 2,
                "maxItems": 2
              },
              {
                "type": "object",
                "properties": {
                  "x": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  },
                  "y": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  }
                },
                "required": [
                  "x",
                  "y"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      ],
      "description": "Exactly two decimal cells per row, unique x, sorted internally. Text separators ; | newline; cells comma colon or whitespace."
    },
    "table": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "array",
          "minItems": 2,
          "maxItems": 100,
          "items": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  },
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  }
                ],
                "items": false,
                "minItems": 2,
                "maxItems": 2
              },
              {
                "type": "object",
                "properties": {
                  "x": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  },
                  "y": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
                      }
                    ],
                    "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
                  }
                },
                "required": [
                  "x",
                  "y"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      ],
      "description": "Exactly two decimal cells per row, unique x, sorted internally. Text separators ; | newline; cells comma colon or whitespace."
    },
    "x0": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
    },
    "y0": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
    },
    "x1": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
    },
    "y1": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; nonzero conversion underflow is rejected at runtime."
    },
    "extrapolate": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "enum": [
            0,
            1
          ]
        },
        {
          "type": "string",
          "pattern": "^\\s*(?:[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]|[Yy][Ee][Ss]|[Nn][Oo]|[Oo][Nn]|[Oo][Ff][Ff]|0|1)\\s*$"
        }
      ],
      "description": "Default false only when absent. Outside-table extension is explicit for linear/spline; Lagrange polynomial is evaluated everywhere."
    }
  },
  "required": [
    "x"
  ],
  "dependentRequired": {
    "x0": [
      "y0",
      "x1",
      "y1"
    ],
    "y0": [
      "x0",
      "x1",
      "y1"
    ],
    "x1": [
      "x0",
      "y0",
      "y1"
    ],
    "y1": [
      "x0",
      "y0",
      "x1"
    ]
  },
  "anyOf": [
    {
      "required": [
        "points"
      ]
    },
    {
      "required": [
        "table"
      ]
    },
    {
      "required": [
        "x0",
        "y0",
        "x1",
        "y1"
      ]
    }
  ],
  "description": "Piecewise-linear, Lagrange, or natural cubic spline of tabulated (x, y). Not regression, not CAS. (calculation_version 1.1.6)"
}
