Coordinate Grid Calculator
Enter two points on the Cartesian plane to get the straight-line distance, midpoint, slope, line equation, angle of inclination, perpendicular bisector equation, and the quadrant each point occupies. All results update as you type, with a step-by-step breakdown of every formula.
Formula
Worked example
Points A(1, 2) and B(4, 6): Dx = 3, Dy = 4, d = sqrt(9 + 16) = 5. Midpoint = (2.5, 4). Slope = 4/3 = 1.3333. Line: y = 1.3333x + 0.6667. Angle = arctan(1.3333) = 53.13 degrees.
What is a coordinate grid?
The coordinate grid (also called the Cartesian plane) is a two-dimensional surface defined by a horizontal x-axis and a vertical y-axis that intersect at the origin (0, 0). Every point on the grid is identified by an ordered pair (x, y), where x is the horizontal position and y is the vertical position. The axes divide the plane into four quadrants: Quadrant I (positive x and y), Quadrant II (negative x, positive y), Quadrant III (negative x and y), and Quadrant IV (positive x, negative y). The coordinate grid is the foundation of analytic geometry, connecting algebra and geometry so that shapes and relationships can be studied numerically.
Distance, midpoint and slope formulas
Given two points A(x1, y1) and B(x2, y2), three core measurements arise immediately. The distance d = sqrt((x2 - x1)^2 + (y2 - y1)^2) comes from the Pythagorean theorem applied to the right triangle formed by the horizontal run and vertical rise. The midpoint M = ((x1 + x2) / 2, (y1 + y2) / 2) is simply the average of each coordinate pair. The slope m = (y2 - y1) / (x2 - x1) measures how steeply the line climbs or falls; it is undefined when x2 = x1 (a vertical line) and zero when y2 = y1 (a horizontal line). Together these three values let you reconstruct the line equation, locate anchor points, and measure lengths without drawing anything by hand.
Line equation and perpendicular bisector
Once you know the slope m and one point (x1, y1), the slope-intercept form y = mx + b is found by solving b = y1 - m * x1. For a vertical line the equation is simply x = x1. The perpendicular bisector is the line that passes through the midpoint of AB at a right angle to it. Because perpendicular lines have slopes that multiply to -1, the perpendicular bisector has slope -1/m (or is horizontal if the original line is vertical). Perpendicular bisectors appear frequently in geometry: every point on the perpendicular bisector of AB is equidistant from A and B, which makes them essential for finding circumcentres of triangles.
Section formula and angle of inclination
The section formula finds the point P that divides the segment AB in a given ratio m:n internally. The coordinates are P = ((m * x2 + n * x1) / (m + n), (m * y2 + n * y1) / (m + n)). When m equals n the formula reduces to the midpoint. The angle of inclination (theta) is the angle the line makes with the positive x-axis, measured counterclockwise. It is computed as arctan(slope) and sits between 0 and 90 degrees for a positive slope, exactly 90 degrees for a vertical line, and between 90 and 180 degrees for a negative slope. The angle and slope carry the same information; theta is simply easier to visualise geometrically.
Slope classification
| Slope value | Line type | Direction |
|---|---|---|
| m > 0 | Positive slope | Rises left to right |
| m = 0 | Zero slope | Horizontal line |
| m < 0 | Negative slope | Falls left to right |
| Undefined | Vertical line | No run (x does not change) |
| m = 1 | Unit slope | 45-degree angle upward |
| m = -1 | Negative unit slope | 45-degree angle downward |
How to interpret the slope value of a line in the Cartesian plane.
Frequently asked questions
What is the distance formula and where does it come from?
The distance formula d = sqrt((x2 - x1)^2 + (y2 - y1)^2) is a direct application of the Pythagorean theorem. If you draw a right triangle with AB as the hypotenuse, the horizontal leg has length |x2 - x1| and the vertical leg has length |y2 - y1|. Squaring both legs, adding them, and taking the square root gives the length of the hypotenuse, which is the straight-line distance between the two points.
How do I find the slope of a line between two points?
Subtract the y-coordinates and divide by the difference of the x-coordinates: m = (y2 - y1) / (x2 - x1). A positive result means the line rises from left to right; a negative result means it falls. If x2 equals x1 the denominator is zero, so the slope is undefined (the line is vertical). If y2 equals y1 the numerator is zero, so the slope is zero (the line is horizontal).
What is the midpoint formula?
The midpoint M between A(x1, y1) and B(x2, y2) is the point exactly halfway along the segment. Its coordinates are simply the arithmetic averages of the two x-values and the two y-values: M = ((x1 + x2) / 2, (y1 + y2) / 2). If you know the midpoint and one endpoint, you can find the other endpoint by rearranging: x1 = 2 * Mx - x2.
What is the perpendicular bisector of a line segment?
The perpendicular bisector passes through the midpoint of the segment and is perpendicular (at 90 degrees) to it. Because perpendicular lines have slopes whose product is -1, the perpendicular bisector of a line with slope m has slope -1/m. Every point on the perpendicular bisector is equidistant from both endpoints, making it essential for finding the circumcenter of a triangle (the center of the circle that passes through all three vertices).
What does the section formula calculate?
The section formula gives the coordinates of a point P that divides the line segment AB in a specified ratio m:n internally. The formula is P = ((m * x2 + n * x1) / (m + n), (m * y2 + n * y1) / (m + n)). When m = n = 1 the result is the midpoint. When m = 2 and n = 1, P lies two-thirds of the way from A to B.
What is the angle of inclination?
The angle of inclination (also called the inclination angle) is the angle theta that a line makes with the positive x-axis, measured counterclockwise. It always falls between 0 and 180 degrees (exclusive). For a horizontal line theta = 0 degrees; for a vertical line theta = 90 degrees. You can compute it as theta = arctan(slope) for non-vertical lines, converting radians to degrees.
How do I identify which quadrant a point is in?
The four quadrants are numbered I through IV counterclockwise starting from the upper-right. Quadrant I has x > 0 and y > 0; Quadrant II has x < 0 and y > 0; Quadrant III has x < 0 and y < 0; Quadrant IV has x > 0 and y < 0. Points on the x-axis have y = 0 and are not in any quadrant; points on the y-axis have x = 0 and are similarly on a boundary. The origin (0, 0) is a special case belonging to no quadrant.