Two-point coordinate geometry
Enter the x and y coordinates of both endpoints.
About coordinate grid calculations
Coordinate geometry connects algebra with positions and shapes on a plane. Every point is represented by an ordered pair: the horizontal x-coordinate followed by the vertical y-coordinate. With two points, you can calculate several useful properties of the line segment between them. This calculator returns its straight-line distance, midpoint, and slope together so you can compare the related results without repeating data entry.
Distance comes from the Pythagorean theorem. The horizontal change is x2 minus x1, and the vertical change is y2 minus y1. Those changes form the legs of a right triangle, so the segment length is the square root of the sum of their squares. Because each change is squared, distance is never negative and does not depend on which point is entered first.
The midpoint is the point exactly halfway between the endpoints. Its x-coordinate is the average of the two x-values, and its y-coordinate is the average of the two y-values. This formula works with positive, negative, integer, and decimal coordinates. A midpoint can be used to bisect a segment, locate a circle's center from a diameter, or check symmetry on a graph.
Slope measures the segment's rate of vertical change relative to horizontal change. It is calculated as the change in y divided by the change in x. Positive slope rises from left to right, negative slope falls, and zero slope describes a horizontal line. A vertical line has zero horizontal change, which would require division by zero, so its slope is reported as undefined.
These three quantities support many analytic geometry tasks. Equal slopes can identify parallel lines, while slopes whose product is negative one can identify perpendicular nonvertical lines. Equal distances can confirm geometric congruence or locate points on circles. Midpoints help construct medians, perpendicular bisectors, and transformations.
The calculator rounds long decimal displays to six places while retaining the direct formula's practical accuracy. For exact radical answers, keep the squared horizontal and vertical changes from your own work. Always preserve the point order when interpreting signed changes, especially slope, although distance and midpoint remain the same if the endpoints are exchanged.
Frequently asked questions
How is distance between two points calculated?
Subtract corresponding coordinates, square both differences, add them, and take the square root. This is the Pythagorean theorem applied to the coordinate changes.
Why can slope be undefined?
A vertical line has identical x-coordinates, so its horizontal change is zero. Dividing its vertical change by zero is undefined.
Does swapping the points change the answers?
Distance and midpoint stay the same when the points are swapped. Both slope differences reverse sign together, so their quotient also stays the same.
Can the calculator use decimal or negative coordinates?
Yes, every coordinate can be any finite real number entered as a decimal. Negative coordinates correctly represent points left of or below the origin.
What does a zero slope mean?
A zero slope means both points have the same y-coordinate. The segment is horizontal and has no vertical change.