Skip to content

Search topics

Practise for free Sign in

Calculator Coordinate geometry in the (x, y) plane

Gradient calculator

In one sentence

Finds the gradient and angle of the line through two points.

Last checked Source: uk-dfe-alevel-maths-subject-content Source: Department for Education, GCE AS and A level subject content for mathematics (topics derived; every example and value computed here), uk-dfe-alevel-maths-subject-content www.gov.uk (opens in a new tab)

Key facts

Gradient calculator

Formula ref
m = (y₂ − y₁)/(x₂ − x₁)
Topic
Coordinate geometry in the (x, y) plane

Inputs

  • (x₁, y₁), (x₂, y₂)

Worked input

  • Input (−2, 3) and (4, −9).
  • m = (−9 − 3)/(4 + 2) = −2.
  • Angle with the x-axis = −63.43°.
  • Take (1, 2) and (4, 8), a pair that rises steeply to the right, so the gradient is a positive whole number. The rise is 6 and the run is 3, so m = 2 and the angle with the x-axis is 63.43°. A positive gradient means the line rises from left to right, and the angle it makes with the positive x-axis lies between zero and ninety degrees, which you can estimate before pressing any buttons. Check: a positive gradient always gives a positive angle between 0° and 90°, and tan 63.43° is back to about 2.
  • Take (−3, 5) and (3, 2), a pair that falls as x increases, so the gradient is negative and a fraction in lowest terms. The rise is −3 and the run is 6, so m = −1/2 and the angle is −26.57°, measured below the positive x-axis. A negative gradient gives an angle below the axis, and the usual convention in examinations is to quote it as a negative angle or to add one hundred and eighty degrees, so read the question to see which is wanted. Check: the sign of the angle matches the sign of the gradient, and 3/6 reduces to 1/2.
  • Take (2, 1) and (2, 9), two points directly above one another, so the run is 0 and the gradient cannot be calculated. The tool reports a gradient that is not defined and an angle of 90°, because the line is vertical. Two points with the same x coordinate cannot give a gradient, so the line is vertical, its equation is x equals a constant, and writing y equals mx plus c for it would be a mistake. Check: dividing the rise 8 by zero has no value, and the equation of the line is x = 2 rather than y = mx + c.

How to use it

  • Enter both points.
  • Equal x-values give an not defined gradient.
  • The angle is tan⁻¹ m.

Gradient calculator in your study of A-level maths, set out with its source.

See also Line through two points calculator, Perpendicular line calculator, Perpendicular bisector calculator and Midpoint calculator.

Study brief

  • For those studying the Pearson Edexcel Level 3 Advanced GCE in Mathematics, understanding how to handle derivatives is essential. The derivative of f(x), denoted as dy/dx, represents the rate of change of y with respect to x. This value acts as the gradient of the tangent to the graph of y = f(x) at any general point (x, y). In mathematical notation, f'(x) represents the first derivative, while f''(x) represents the second derivative. When working with curves, students should practice sketching the graph of the gradient function, y = f'(x), using specific axes and scales. This process can be applied to relate concepts such as speed and acceleration. For certain functions, differentiation from first principles involves using the limit as h approaches 0 for expressions like ((x + h)^n - x^n) / h, where n is a positive integer. Regarding exam regulations, students are responsible for their calculator's power supply and working condition. During an examination, calculators must be free of lids, covers, or cases that contain printed instructions, such as symbolic algebra manipulation, symbolic differentiation, or integration formulas. Furthermore, calculators must not have retrievable information like databanks, dictionaries, mathematical formulas, or text stored within them.

Practise for free

Test yourself with exam-style questions and see why each answer is right or wrong.

Start practising
Free practice, no card Start without an account Sources checked Every fact names its official source
Works on any device Phone, tablet or desktop
Contact us Questions or a correction