Calculator Coordinate geometry in the (x, y) plane
Line through two points calculator
In one sentence
Gives y = mx + c and ax + by + c = 0 for 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
Line through two points calculator
- Formula ref
- y − y₁ = m(x − x₁)
- Topic
- Coordinate geometry in the (x, y) plane
Inputs
- (x₁, y₁), (x₂, y₂)
Worked input
- Input (2, 7) and (6, 19).
- m = 12/4 = 3.
- y − 7 = 3(x − 2) gives y = 3x + 1, or 3x − y + 1 = 0.
- Take (0, −1) and (2, 5), where the first point sits on the y-axis, so its y-value is the intercept at once. The gradient is 6/2 = 3 and the intercept is −1, giving y = 3x − 1, or 3x − y − 1 = 0. When one of the points lies on the y-axis its height is the intercept, so only the gradient needs calculating, and this is the quickest way to write the equation down. Check: x = 2 gives y = 5, the second point, so the line really does contain both.
- Take (−4, 3) and (2, 0), a pair with a fractional negative gradient, so the general form needs the fractions cleared. The gradient is −1/2 and the intercept is 1, so y = −x/2 + 1, which becomes x + 2y − 2 = 0. A fractional gradient makes the general form ax plus by plus c equal to zero awkward, so multiply through by the denominator to clear the fractions and then check that both points satisfy the final equation. Check: the point (2, 0) gives 2 + 0 − 2 = 0, and (−4, 3) gives −4 + 6 − 2 = 0.
- Take (3, −2) and (3, 5), two points with the same x-coordinate, so the run is 0 and the form y = mx + c does not exist. The tool reports the vertical line x = 3 instead. Points with the same x coordinate lie on a vertical line, which has no gradient, and the correct answer is x equals that constant, a case that a formula-driven approach can miss. Check: every point on the line has x equal to 3, including both given points, so the vertical-line form is the correct one.
How to use it
- Enter both points.
- The general form clears fractions.
- Check both points satisfy the equation.
Line through two points calculator for your study of A-level maths: where it comes from and what it covers.
See also Perpendicular line calculator, Midpoint calculator, Circle equation builder and Perpendicular bisector calculator.
Study brief
- Students preparing for the Pearson Edexcel Level 3 Advanced GCE in Mathematics must understand coordinate geometry in the (x,y) plane. A key requirement involves using the equation of a straight line passing through two given points. This can be expressed using the form y – y1 = m(x – x1) or the form ax + by + c = 0. Mastery of these equations is necessary for modeling various contexts, such as distance against time at a constant speed or converting degrees Celsius to degrees Fahrenheit. Additionally, learners should be able to find equations for lines that are parallel or perpendicular to a specific line through a given point. For two lines to be parallel, the gradient condition is m′ = m, whereas for perpendicular lines, the condition is m′ = −1/m. Understanding these relationships helps in determining how lines interact within a coordinate system. Furthermore, when data points all lie on a straight line, the correlation coefficient r will equal ±1. While students can use a calculator to find an r value, they do not need to know the specific formula for calculating correlation coefficients.
Practise for free
Test yourself with exam-style questions and see why each answer is right or wrong.
More from Coordinate geometry in the (x, y) plane
-
Circle centre and radius calculator
Reads the centre and radius from x² + y² + 2gx + 2fy + c = 0.
-
Circle equation builder
Writes the equation of a circle from its centre and radius or from a diameter's ends.
-
Distance between two points calculator
Computes the length of a line segment.
-
Gradient calculator
Finds the gradient and angle of the line through two points.
-
Midpoint calculator
Finds the midpoint of a segment and the coordinates of an endpoint given the other end and the midpoint.
-
Parametric curve point and gradient
Evaluates x(t), y(t) and dy/dx at a chosen parameter value.
-
Perpendicular bisector calculator
Finds the perpendicular bisector of the segment AB.
-
Perpendicular line calculator
Finds the line perpendicular to a given line through a given point.