{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"slope"},"result":{"entity_type":"calculator","id":"slope","calculator_id":"slope","canonical_url":"https://tttkmbb.com/math/slope","name":"Slope Calculator","title":"Slope Calculator – Gradient, Intercepts, Line Equation and Angle from Two Points","category":"math","category_name":"Math","tool_name":"calculate_slope","featured_mcp_tool":false,"description":"Computes the slope of the line through two points (rise over run), its y- and x-intercepts, the slope-intercept equation y = mx + b, the angle of inclination and the distance between the points.","use_when":"You have two points and need the gradient or the equation of the line through them.","do_not_use_when":"You need a best-fit line through many points (use linear-regression) or only the distance between two points (use distance-2d).","inputs":[{"name":"x1","label":"x₁","type":"number","required":true,"description":"x-coordinate of the first point.","example":1},{"name":"y1","label":"y₁","type":"number","required":true,"description":"y-coordinate of the first point.","example":2},{"name":"x2","label":"x₂","type":"number","required":true,"description":"x-coordinate of the second point.","example":3},{"name":"y2","label":"y₂","type":"number","required":true,"description":"y-coordinate of the second point.","example":6}],"outputs":[{"name":"slope","label":"Slope (m)","type":"number","decimals":6,"description":"(y₂ − y₁) / (x₂ − x₁); omitted for a vertical line."},{"name":"slope_type","label":"Slope type","type":"string","decimals":4,"description":"'positive (rising)', 'negative (falling)', 'zero (horizontal line)' or 'undefined (vertical line)'."},{"name":"y_intercept","label":"y-intercept (b)","type":"number","decimals":6,"description":"Value of y where the line crosses the y-axis: y₁ − m·x₁."},{"name":"x_intercept","label":"x-intercept","type":"number","decimals":6,"description":"Value of x where the line crosses the x-axis: −b / m (omitted for a horizontal line)."},{"name":"equation","label":"Line equation","type":"string","decimals":4,"description":"Slope-intercept form y = mx + b (or x = c for a vertical line)."},{"name":"angle_degrees","label":"Angle of inclination","type":"number","unit":"°","decimals":4,"description":"atan(m) in degrees, between −90° and 90°."},{"name":"delta_x","label":"Run (Δx)","type":"number","decimals":6,"description":"x₂ − x₁."},{"name":"delta_y","label":"Rise (Δy)","type":"number","decimals":6,"description":"y₂ − y₁."},{"name":"distance","label":"Distance between points","type":"number","decimals":6,"description":"√(Δx² + Δy²)."}],"input_schema":{"type":"object","properties":{"x1":{"description":"x-coordinate of the first point.","type":"number","examples":[1]},"y1":{"description":"y-coordinate of the first point.","type":"number","examples":[2]},"x2":{"description":"x-coordinate of the second point.","type":"number","examples":[3]},"y2":{"description":"y-coordinate of the second point.","type":"number","examples":[6]}},"additionalProperties":false,"required":["x1","y1","x2","y2"]},"output_schema":{"type":"object","properties":{"slope":{"description":"(y₂ − y₁) / (x₂ − x₁); omitted for a vertical line.","type":"number"},"slope_type":{"description":"'positive (rising)', 'negative (falling)', 'zero (horizontal line)' or 'undefined (vertical line)'.","type":"string"},"y_intercept":{"description":"Value of y where the line crosses the y-axis: y₁ − m·x₁.","type":"number"},"x_intercept":{"description":"Value of x where the line crosses the x-axis: −b / m (omitted for a horizontal line).","type":"number"},"equation":{"description":"Slope-intercept form y = mx + b (or x = c for a vertical line).","type":"string"},"angle_degrees":{"description":"atan(m) in degrees, between −90° and 90°. Unit: °.","type":"number","x-unit":"°"},"delta_x":{"description":"x₂ − x₁.","type":"number"},"delta_y":{"description":"y₂ − y₁.","type":"number"},"distance":{"description":"√(Δx² + Δy²).","type":"number"}}},"formula":"m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − m·x₁; x_intercept = −b / m; angle = atan(m) × 180/π; distance = √(Δx² + Δy²)","sources":[{"name":"Wikipedia – Slope","url":"https://en.wikipedia.org/wiki/Slope","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Linear equation","url":"https://en.wikipedia.org/wiki/Linear_equation","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wolfram MathWorld – Slope","url":"https://mathworld.wolfram.com/Slope.html","type":"reference","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"(1, 2) and (3, 6)","inputs":{"x1":1,"y1":2,"x2":3,"y2":6},"expected":{"slope":2,"slope_type":"positive (rising)","y_intercept":0,"x_intercept":0,"equation":"y = 2x","angle_degrees":63.4349,"delta_x":2,"delta_y":4,"distance":4.472136},"url":"https://tttkmbb.com/api/v1/calculate/slope?x1=1&y1=2&x2=3&y2=6"},{"name":"(0, 3) and (4, 1)","inputs":{"x1":0,"y1":3,"x2":4,"y2":1},"expected":{"slope":-0.5,"slope_type":"negative (falling)","y_intercept":3,"x_intercept":6,"equation":"y = -0.5x + 3","angle_degrees":-26.5651},"url":"https://tttkmbb.com/api/v1/calculate/slope?x1=0&y1=3&x2=4&y2=1"}],"faq":[{"q":"What happens for a vertical line?","a":"Δx = 0, so the slope is undefined and no y-intercept exists. The calculator returns the equation x = constant, an angle of 90° and no slope value."},{"q":"Is slope the same as gradient or grade?","a":"Slope and gradient are the same ratio. A road grade is the slope expressed in percent (slope × 100)."}],"tags":["slope","gradient","rise over run","line equation","y intercept","two points"],"related":[{"calculator_id":"distance-2d","reason":"Distance and midpoint of the same two points."},{"calculator_id":"linear-regression","reason":"Best-fit line through many points."},{"calculator_id":"angle","reason":"Convert the inclination angle between degrees, radians and grades."}],"links":{"html":"https://tttkmbb.com/math/slope","markdown":"https://tttkmbb.com/math/slope.md","json":"https://tttkmbb.com/math/slope.json","api":"https://tttkmbb.com/api/v1/calculate/slope","schema":"https://tttkmbb.com/api/v1/calculators/slope","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:23:05Z"}