Free Maths Calculator

Straight Line Graph Calculator

Give two points and get everything a straight line question can ask for: the gradient, the midpoint, the length of the segment and the full equation y = mx + c. Lengths that are not whole come out as exact surds, and vertical lines are handled properly rather than breaking the formula.

Try It: Enter Your Numbers

Your question

Updates as you type

Answer

Method, Step by Step

    Worked Example

    A line passes through (1, 3) and (5, 7). Find its equation.

    1. Gradient:m = (7 − 3) ÷ (5 − 1) = 4 ÷ 4 = 1
    2. Use y = mx + c at (1, 3):3 = 1 × 1 + c, so c = 2
    3. So the equation is y = x + 2

    Answer: y = x + 2

    Try These Yourself

    Find the gradient of the line through (2, 3) and (6, 11).Show answerHide answer

    Answer: 2

    Rise over run: 8 ÷ 4 = 2.

    Find the midpoint of (1, 2) and (7, 10).Show answerHide answer

    Answer: (4, 6)

    Average the x values and the y values.

    How long is the segment from (0, 0) to (3, 4)?Show answerHide answer

    Answer: 5

    √(3² + 4²) = √25 = 5.