Line Through Two Points Calculator

Enter two points and see the line that passes through both.

The x-coordinate of the first point.

The y-coordinate of the first point.

The x-coordinate of the second point.

The y-coordinate of the second point.

Try

Result

You enteredm=3, b=−1m = 3,\ b = -1

y=3x−1\displaystyle y = 3x - 1

Slope

3\displaystyle 3

y-intercept

−1\displaystyle -1

x-intercept

13\displaystyle \frac{1}{3}

Slope-intercept form

y=3x−1\displaystyle y = 3x - 1

Point-slope form

y−2=3(x−1)\displaystyle y - 2 = 3\left(x - 1\right)

Standard form

3x−y=1\displaystyle 3x - y = 1

Angle with the x-axis

71.565051∘\displaystyle 71.565051^\circ
Show the work
  1. Slope formula (rise over run)

    The line is y=mx+by = mx + b, so the slope mm comes first: the rise divided by the run. Here (x1,y1)=(1,2)(x_1, y_1) = (1, 2) and (x2,y2)=(3,8)(x_2, y_2) = (3, 8).

    m=y2−y1x2−x1=8−23−1=62=3\begin{aligned} m &= \frac{y_2 - y_1}{x_2 - x_1} \\ &= \frac{8 - 2}{3 - 1} \\ &= \frac{6}{2} \\ &= 3 \end{aligned}
  2. Find the y-intercept

    The intercept bb is where the line meets the yy-axis. Since (x1,y1)(x_1, y_1) is on the line, y1=mx1+by_1 = m x_1 + b, so b=y1−mx1b = y_1 - m x_1. Here m=3m = 3.

    b=y1−mx1=2−3×1=2−3=−1\begin{aligned} b &= y_1 - m x_1 \\ &= 2 - 3 \times 1 \\ &= 2 - 3 \\ &= -1 \end{aligned}
  3. Slope-intercept form

    Put m=3m = 3 and b=−1b = -1 into y=mx+by = mx + b.

    y=mx+b=3x−1\begin{aligned} y &= mx + b \\ &= 3x - 1 \end{aligned}
  4. Result

    So the line through the two points is y=3x−1y = 3x - 1.

Worked examples