GenerateRandomSearch

Straight Line Graph Question Generator

Two points, and the line through them. The arithmetic here is where the difficulty sits: a gradient is a fraction far more often than practice sheets admit, and rounding it to a decimal quietly makes the intercept wrong. Everything in this generator is held as an exact fraction, so a gradient of two thirds stays two thirds through the substitution and the check.

What this generator does

Draws two distinct points and asks for the equation of the line through them in the form y = mx + c. The gradient and intercept are computed as exact fractions, and the working substitutes the second point back in as a check rather than stopping at the first.

How to use this tool

  1. Choose how many questions you want and how far the coordinates spread.
  2. Work out the gradient, then substitute a point to find the intercept.
  3. Reveal the answers to check the equation.
  4. Show the working to see the substitution and the check against the second point.

Understanding the controls

How many questions
Between 1 and 20. Eight is about a page once the gradient working is written out.
Level
Gentle redraws until both the gradient and the intercept are whole numbers. Standard and stretch let fractions through, which is the realistic case, and widen the coordinate range.
Seed
Reproduces the same points from the same word.
Show the answers / working
The equation, or the gradient calculation, substitution and check.

Common use cases

  • Practice at finding a gradient from two points rather than from a drawn line
  • Questions where the gradient is deliberately fractional
  • Keeping to whole-number answers at the gentle level while the method is new
  • Coordinate geometry homework with the working available for marking
  • Producing the same set of points for a group from one seed

How this generator works

Two points are drawn and any pair sharing an x coordinate is rejected, since a vertical line has no gradient and cannot be written as y = mx + c at all. The gradient is (y₂ − y₁)/(x₂ − x₁) as a fraction in lowest terms, and the intercept follows by substitution. The check requires the finished equation to pass through both original points exactly.

Randomness and fairness

The two points are random; the gradient and intercept follow from them exactly. Seeded question sets reproduce and are therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator supplies the coordinates.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Vertical lines are excluded by design, so the x = k case never appears.
  • Answers are given as y = mx + c. Other forms, such as ax + by + c = 0, are not produced.
  • No graph is drawn — this generates the question and the algebra, not a set of axes.
  • Perpendicular and parallel line questions are not among the forms offered.
  • Sets are not saved; seed one you plan to reuse.

Privacy and your data

Points and equations are computed in your browser and never sent anywhere. Nothing you generate persists after the tab closes.