🌐 EN

Slope Calculator

Calculate the slope and equation of a line passing through two points.

Results

Inputs and checks

  • Enter x and y for each of two points; the number fields use steps of 0.01 and have no stated bounds.
  • Press Calculate after changing coordinates to refresh the numeric results. Editing alone updates the drawing, not the numbers.
  • Use ordinary numeric coordinates, including negative values. Blank values are treated as zero when calculating.

Reading the result

  • Slope and distance use four decimals, while the angle and midpoint use two; the line equation is also displayed.
  • For a vertical line the slope is Undefined and the equation is x = the shared x-coordinate. The point-slope row is hidden, but the y-intercept row stays visible, showing a dash at first or possibly a value from a previous line calculation. Do not treat that value as the vertical line’s y-intercept.
  • If both points are identical, an error appears. The drawing can misplace a point whose second x or y coordinate is zero, so use numeric outputs rather than the diagram as proof.

Examples

Line through (1, 2) and (4, 6)

Input
First point (1, 2); second point (4, 6); press Calculate.
Result
Slope 1.3333; angle 53.13°; distance 5.0000; midpoint (2.50, 4.00); y-intercept 0.6667; y = 1.3333x + 0.6667; y - 2 = 1.3333(x - 1).
How to check it
The rise is 4 and run is 3, so slope is 4 ÷ 3; distance is √(3² + 4²) = 5.

Vertical line through x = 2

Input
First point (2, 1); second point (2, 5); press Calculate.
Result
Slope Undefined; angle 90.00°; distance 4.0000; midpoint (2.00, 3.00); equation x = 2.
How to check it
Both x values are 2, so the line is vertical; the y difference is 4.

Frequently asked questions

Why did only the diagram change?
Press Calculate. Typing does not refresh the numeric values.
Why does a vertical line have undefined slope?
Its change in x is zero, so rise divided by run is not defined.
Can two identical points define a line here?
No. The calculator shows an error for matching points.