Coordinate Geometry Calculator

Distance—
Slope—
Midpoint—
Equation of the line—

How Coordinate Geometry Calculator is calculated: Distance = √((x2−x1)² + (y2−y1)²); Slope = (y2−y1)/(x2−x1); Midpoint = ((x1+x2)/2, (y1+y2)/2)

What is a coordinate geometry calculator?

Coordinate geometry — also called analytic geometry — is the maths of points on a grid. Give it two points, and it can tell you how far apart they are, how steep the line between them is, where the middle of the line sits, and the equation of the line itself. This calculator does all four at once: enter (x1, y1) and (x2, y2), and it returns the distance, the slope, the midpoint, and the line equation.

The four answers cover the four questions that come up most in coordinate geometry. The distance is the length of the line segment between the points. The slope is how steep the line is — rise over run. The midpoint is the point exactly halfway along the segment. The equation is the line written in the form y = mx + b, which is the form every graph question uses.

Coordinate geometry is the meeting point of algebra and geometry, and it is the foundation for everything from map-making to computer graphics. Every line on a screen, every route on a map, and every graph in a textbook is coordinate geometry in action — and it all starts with two points.

How a coordinate geometry calculator works

The distance uses the Pythagorean theorem: d = √((x2 − x1)² + (y2 − y1)²). The gap in x and the gap in y are the two sides of a right triangle, and the distance is the hypotenuse. For the default example, (1, 2) to (4, 6), the gaps are 3 and 4, so the distance is √(9 + 16) = √25 = 5. The 3-4-5 triangle is the most famous right triangle in maths, and it shows up here exactly as it should.

The slope is m = (y2 − y1) ÷ (x2 − x1) — rise over run. For the default, that is (6 − 2) ÷ (4 − 1) = 4 ÷ 3, about 1.33. A positive slope climbs to the right, a negative slope falls, zero is flat, and a vertical line has no slope at all, because the run is zero and division by zero is undefined. The calculator shows a dash for the slope of a vertical line.

The midpoint is the average of the two points: ((x1 + x2) ÷ 2, (y1 + y2) ÷ 2). For the default, that is ((1 + 4) ÷ 2, (2 + 6) ÷ 2) = (2.5, 4). The line equation is y = mx + b, where m is the slope and b is the y-intercept — the value of y where the line crosses the y-axis. For the default, b = 2 − 1.33 × 1 = 0.67, so the equation is y = 1.33x + 0.67.

The slope — the input pair people get wrong

The slope depends on the order of the points, and getting the order mixed up is the most common error in coordinate geometry. The formula is (y2 − y1) ÷ (x2 − x1), with the second point minus the first point in both the top and the bottom. Swap one of them and the sign flips; swap both and the answer is the same, because two flips cancel. The safe rule is to subtract in the same order, top and bottom, every time.

A slope of 1.33 means the line rises 4 units for every 3 it runs — a fairly steep climb. A slope of 1 means 45 degrees, a slope of 0 means flat, and a slope of −1 means falling at 45 degrees. The slope is the same everywhere on a straight line, which is the definition of straight: the steepness never changes. If two lines have the same slope, they are parallel; if their slopes multiply to −1, they are perpendicular.

The y-intercept b is the other half of the equation, and it is where the line crosses the y-axis. For the default, b is 0.67, so the line crosses the y-axis just above zero. A line through the origin has b = 0, and its equation is just y = mx. A slope calculator gives the slope on its own, and a linear equation calculator solves the equation once you have it.

A worked example: three pairs of points

First, the default on this page. Points (1, 2) and (4, 6). Distance: √((4 − 1)² + (6 − 2)²) = √(9 + 16) = 5. Slope: 4 ÷ 3 = 1.33. Midpoint: (2.5, 4). Equation: y = 1.33x + 0.67, because b = 2 − (4/3) × 1 = 0.67. All four answers come from the same two points, and the distance of 5 is a clean check that the arithmetic is right.

Second, the origin and a classic point: (0, 0) and (3, 4). Distance: √(9 + 16) = 5 — another 3-4-5 triangle. Slope: 4 ÷ 3 = 1.33, the same slope as the default, so the two lines are parallel. Midpoint: (1.5, 2). Equation: y = 1.33x + 0.00, because the line passes through the origin and the intercept is zero. Two different pairs of points, the same slope, parallel lines.

Third, a vertical line: (2, 1) and (2, 5). Distance: √(0 + 16) = 4. Slope: the run is 2 − 2 = 0, so the slope is undefined and the calculator shows a dash. Midpoint: (2, 3). Equation: x = 2, because every point on the line has x = 2. Vertical lines have no y = mx + b form — their equation is just x equals a constant, and that is a fact worth remembering.

Where coordinate geometry is used

Maps and navigation are coordinate geometry at full scale. Every place on Earth has coordinates, every route is a line between two points, and the distance between two places is the distance formula applied to their coordinates — with a correction for the curve of the Earth on long routes. A distance calculator does the same job for travel, and a midpoint calculator finds the halfway point between two places.

Computer graphics is coordinate geometry in real time. Every line, shape, and image on a screen is a set of points, and moving, rotating, or scaling an image is a coordinate calculation. Games use the distance formula dozens of times a second to decide whether two objects have collided, and the midpoint formula to place things between two points. The slope decides the angle of a line on the screen.

In school and exams, coordinate geometry is the chapter where algebra and geometry meet, and it tests both. The distance formula is Pythagoras in disguise, the slope is a ratio, the midpoint is an average, and the equation is a linear relationship — four ideas from four chapters, all in one question. That is why it appears in nearly every maths paper.

Coordinate geometry vs slope calculator

A slope calculator answers one question: how steep is the line between two points? This calculator answers that question too, but it also gives the distance, the midpoint, and the full equation — the four answers that most coordinate geometry questions ask for together. If the question only asks for the slope, the slope tool is quicker; if it asks for more, this one saves you four separate calculations.

The midpoint tool is the same story: it finds the halfway point and nothing else. This calculator includes the midpoint as one of its four results, so it covers the midpoint question as part of a bigger job. The distance tool, likewise, finds the distance between two points and stops there. Each single-purpose tool is faster for its one job; this one is better when the question asks for several answers at once.

The line equation is what sets this calculator apart. Neither the slope tool nor the midpoint tool gives you y = mx + b, and that equation is the answer most graph questions actually want — it is the form you plot, the form you solve, and the form you compare with other lines. A system of equations calculator finds where two such lines cross, which is the next step after having both equations.

Common coordinate geometry mistakes

The most common mistake is the order of subtraction in the slope: (y2 − y1) ÷ (x2 − x1) needs the same order top and bottom. Writing (y2 − y1) ÷ (x1 − x2) flips the sign, and the slope comes out as −1.33 instead of 1.33. Pick an order, stick to it, and the error disappears.

Second: forgetting to square in the distance formula, or forgetting the square root at the end. The distance is √(9 + 16) = 5, not 9 + 16 = 25 and not √9 + √16 = 7. Third: the midpoint is an average, not a difference — it is (x1 + x2) ÷ 2, with a plus, not a minus. Fourth: the intercept b is not the slope, and it is not the y-coordinate of either point — it is the value of y when x is zero, found by b = y1 − m × x1.

Fifth: treating a vertical line as if it had a slope. A vertical line has no slope — the run is zero — and its equation is x = a constant, not y = mx + b. If your slope comes out as a huge number or an error, check whether the two x-coordinates are equal.

How to use this coordinate geometry calculator

Using it takes seconds. Enter the first point, x1 and y1. Enter the second point, x2 and y2. The distance, the slope, the midpoint, and the equation of the line appear at once, updating live as you type. The points can be decimals, negatives, or zeros — the formulas handle all of them.

A good check is the distance: if the gaps in x and y are 3 and 4, the distance should be 5, and if they are 6 and 8, it should be 10. For the slope, check the sign against the picture — if the second point is higher and to the right, the slope is positive. For the equation, plug in x1 and check that you get y1: for the default, 1.33 × 1 + 0.67 = 2, which matches.

Everything runs in your browser. No account, no form, no data sent anywhere. If you need just the slope, the slope calculator is the quicker tool, and if you need just the halfway point, the midpoint calculator is the one — both agree with this calculator to the decimal.

Frequently Asked Questions

Use the distance formula: √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5. The gaps in x and y are 3 and 4, which form a 3-4-5 right triangle, so the distance is the hypotenuse, 5. The slope of the same line is 4 ÷ 3 = 1.33 and the midpoint is (2.5, 4).

The slope is (6 − 2) ÷ (4 − 1) = 4 ÷ 3, about 1.33. It means the line rises 4 units for every 3 it runs to the right. The equation of the line is y = 1.33x + 0.67, where 0.67 is the y-intercept.

Average the coordinates: the midpoint of (x1, y1) and (x2, y2) is ((x1 + x2) ÷ 2, (y1 + y2) ÷ 2). For (1, 2) and (4, 6), that is (2.5, 4). The midpoint is exactly halfway along the line segment, the same distance from both points.

A vertical line has the equation x = a constant, because every point on it shares the same x-coordinate. The line through (2, 1) and (2, 5) is x = 2. It has no slope — the run is zero, so rise over run is a division by zero — and it cannot be written in the form y = mx + b.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.