{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://askcalculators.com/calculator/slope-calculator/schema.json",
  "title": "Slope Calculator inputs",
  "description": "Calculate line slope from two points, or project a second point from a starting point, distance, and slope or angle.",
  "type": "object",
  "properties": {
    "mode": {
      "title": "Known values",
      "type": "string",
      "default": "two-points",
      "enum": [
        "two-points",
        "point-slope",
        "point-angle"
      ],
      "x-optionLabels": {
        "two-points": "Two points",
        "point-slope": "One point, distance, and slope",
        "point-angle": "One point, distance, and angle"
      }
    },
    "x1": {
      "title": "x₁",
      "type": "number",
      "default": 0,
      "x-step": 0.01
    },
    "y1": {
      "title": "y₁",
      "type": "number",
      "default": 0,
      "x-step": 0.01
    },
    "x2": {
      "title": "x₂",
      "type": "number",
      "default": 4,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "mode",
        "equals": "two-points"
      }
    },
    "y2": {
      "title": "y₂",
      "type": "number",
      "default": 8,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "mode",
        "equals": "two-points"
      }
    },
    "distance": {
      "title": "Distance",
      "type": "number",
      "default": 5,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "mode",
        "equals": "point-slope"
      }
    },
    "slopeInput": {
      "title": "Slope (m)",
      "type": "number",
      "default": 2,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "mode",
        "equals": "point-slope"
      }
    },
    "angleDistance": {
      "title": "Distance",
      "type": "number",
      "default": 5,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "mode",
        "equals": "point-angle"
      }
    },
    "angleInput": {
      "title": "Angle of incline",
      "type": "number",
      "default": 45,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "mode",
        "equals": "point-angle"
      }
    }
  },
  "required": [
    "mode",
    "x1",
    "y1"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "mode": {
            "const": "two-points"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "x2"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "const": "two-points"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "y2"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "const": "point-slope"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "distance"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "const": "point-slope"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "slopeInput"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "const": "point-angle"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "angleDistance"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "mode": {
            "const": "point-angle"
          }
        },
        "required": [
          "mode"
        ]
      },
      "then": {
        "required": [
          "angleInput"
        ]
      }
    }
  ],
  "additionalProperties": false,
  "x-askcalculators": {
    "version": "2.0.0",
    "calculatorUrl": "https://askcalculators.com/calculator/slope-calculator/",
    "queryExample": "https://askcalculators.com/calculator/slope-calculator/?mode=two-points&x1=0&y1=0&x2=4&y2=8",
    "migrationStatus": "migrated",
    "reviewStatus": "pending",
    "pageStatus": "live",
    "workStatus": "pending",
    "migratedDate": "2026-08-25",
    "formula": {
      "expression": "m=(y₂−y₁)/(x₂−x₁)=tan(θ); with distance d, Δx=d/√(1+m²) and Δy=mΔx."
    },
    "quality": {
      "availability": "live",
      "technicalReviewRecord": "/reviews/slope-calculator.json",
      "qualifiedReview": "pending",
      "qualifiedReviewer": null,
      "qualifiedReviewDate": null,
      "formulaVersion": "2.0.0",
      "referenceCoverage": "references-listed",
      "releaseTestScope": "Catalog and regression checks are not a professional formula audit; consult release evidence.",
      "historicalMetadataDate": "2026-08-25",
      "historicalMetadataNotice": "The imported date is not evidence of a completed human review."
    },
    "outputs": {
      "slope": {
        "title": "Slope (m)",
        "type": "number",
        "x-format": "number",
        "x-digits": 6,
        "x-primary": true
      },
      "angle": {
        "title": "Angle of incline",
        "type": "number",
        "x-format": "number",
        "x-suffix": "°",
        "x-digits": 6
      },
      "distanceResult": {
        "title": "Distance",
        "type": "number",
        "x-format": "number",
        "x-digits": 6
      },
      "rise": {
        "title": "Rise (Δy)",
        "type": "number",
        "x-format": "number",
        "x-digits": 6
      },
      "run": {
        "title": "Run (Δx)",
        "type": "number",
        "x-format": "number",
        "x-digits": 6
      },
      "secondPoint": {
        "title": "Second point",
        "type": "string",
        "x-format": "text"
      },
      "equation": {
        "title": "Line equation",
        "type": "string",
        "x-format": "text"
      }
    }
  }
}
