{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.geometry.coordinate/1.8.0/input.json",
  "title": "Coordinate geometry — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "angle",
        "angle-between",
        "angle-between-lines",
        "angle_between",
        "angle_between_lines",
        "dist",
        "dist-to-line",
        "dist_to_line",
        "distance",
        "distance-to-line",
        "distance_to_line",
        "equation",
        "gradient",
        "intersect",
        "intersection",
        "length",
        "line",
        "line-angle",
        "line-equation",
        "line-intersect",
        "line-intersection",
        "line_angle",
        "line_equation",
        "line_intersect",
        "line_intersection",
        "mid",
        "midpoint",
        "point-line",
        "point-line-distance",
        "point-to-line",
        "point_line",
        "point_line_distance",
        "point_to_line",
        "slope",
        "two-line",
        "two-line-angle",
        "two-line-intersection",
        "two-lines",
        "two-point",
        "two-point-line",
        "two_line",
        "two_line_angle",
        "two_line_intersection",
        "two_lines",
        "two_point",
        "two_point_line"
      ]
    },
    "x1": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "y1": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "x2": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "y2": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "x0": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "y0": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "x3": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "y3": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "x4": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "y4": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Finite decimal. Nonzero normalized coordinates must be normal binary64 (abs >= 2^-1022). Text nonzero-to-zero rejects NUMERIC_UNDERFLOW; nonzero subnormal rejects NUMERIC_RANGE. Optional fields are absent, never empty/null.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "px": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Alias of x0; supplied together they must agree.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    },
    "py": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 1024,
          "pattern": "^\\s*[+−–—-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?\\s*$"
        }
      ],
      "description": "Alias of y0; supplied together they must agree.",
      "x-quantity-kind": "length",
      "x-dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "x-unit-policy": "arbitrary_consistent_length",
      "x-uuce-role": "scalar"
    }
  },
  "required": [
    "x1",
    "y1",
    "x2",
    "y2"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "point_line",
              "point-line",
              "point_line_distance",
              "point-line-distance",
              "distance_to_line",
              "distance-to-line",
              "dist_to_line",
              "dist-to-line",
              "point_to_line",
              "point-to-line"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "allOf": [
          {
            "anyOf": [
              {
                "required": [
                  "x0"
                ]
              },
              {
                "required": [
                  "px"
                ]
              }
            ]
          },
          {
            "anyOf": [
              {
                "required": [
                  "y0"
                ]
              },
              {
                "required": [
                  "py"
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "intersect",
              "intersection",
              "line_intersection",
              "line-intersection",
              "line_intersect",
              "line-intersect",
              "two_line",
              "two-line",
              "two_lines",
              "two-lines",
              "two_line_intersection",
              "two-line-intersection"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "x3",
          "y3",
          "x4",
          "y4"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "enum": [
              "angle",
              "line_angle",
              "line-angle",
              "angle_between",
              "angle-between",
              "angle_between_lines",
              "angle-between-lines",
              "two_line_angle",
              "two-line-angle"
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "x3",
          "y3",
          "x4",
          "y4"
        ]
      }
    }
  ],
  "description": "Distance, midpoint, slope, two-point line, point-line distance, line intersection, and angle in the plane. Slope is not share-key m. Discovery /line-equation, /point-line-distance, /line-intersection, /angle-between-lines. Not Pythagorean, not CAS. (calculation_version 1.8.0)",
  "x-unit-contract": {
    "protocol": "calculatorx-field-unit-contract-v1",
    "capability_id": "math.geometry.coordinate",
    "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": {},
    "outputs": {
      "angle_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"
        }
      },
      "supplement_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"
        }
      },
      "angle_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."
    }
  }
}
