Skip to content

Coordinate Geometry

Coordinate Geometry Basics

Distance, section, midpoint, area of a triangle, slope, and equations of lines in the coordinate plane.

Coordinate geometry expresses geometric objects algebraically by placing them on a Cartesian grid. Points become ordered pairs, lines become linear equations, and geometric relations (collinearity, perpendicularity, distance, area) become arithmetic identities on coordinates. The formulas below cover the core operations on points and lines in the plane: measuring distances, dividing segments, computing slopes, and writing the equation of a line. Each form is interchangeable, fit to a different set of givens.

Distance Between Two Points

The distance between P(x1,y1) and Q(x2,y2) is the length of the segment joining them. It is the Pythagorean theorem applied to the run x2 − x1 and the rise y2 − y1, the legs of a right triangle whose hypotenuse is the segment. The result is non-negative and symmetric in the two points.

(x2x2)2+(y1y2)2\sqrt{\left(x_{2}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}
xyP(x₁,y₁)Q(x₂,y₂)x₂−x₁y₂−y₁d
The distance formula is the Pythagorean theorem applied to the rise and run between two points.

Section Formula

The section formula gives the coordinates of R(x,y) dividing the segment from P(x1,y1) to Q(x2,y2) in the ratio m1:m2. Each coordinate is a weighted average of the endpoint coordinates with the weights swapped: m1 multiplies the second point’s coordinate and m2 multiplies the first. For internal division both weights are positive; for external division m2 is negative. The formula fails when m1 + m2 = 0, which corresponds to no finite dividing point.

(m1x2+m2x1m1+m2,m1y2+m2y1m1+m2)\left(\frac{m_{1}x_{2}+m_{2}x_{1}}{m_{1}+m_{2}},\frac{m_{1}y_{2}+m_{2}y_{1}}{m_{1}+m_{2}}\right)

Midpoint Formula

The midpoint is the section formula with the ratio fixed at 1:1, so each coordinate is the arithmetic mean of the endpoint coordinates. It is the centre of the segment, equidistant from both endpoints. The formula returns a finite point for any pair of endpoints, distinct or coincident.

(x1+x22,y1+y22)\left(\frac{x_{1}+x_{2}}{2},\frac{y_{1}+y_{2}}{2}\right)

Area of a Triangle

The area of the triangle with vertices (x1,y1), (x2,y2), (x3,y3) is half the absolute value of a signed determinant in the coordinates. The expression inside the bars is twice the signed area; the absolute value drops the sign recording vertex orientation (clockwise vs counter-clockwise). The result is zero exactly when the three points are collinear, giving a direct collinearity test.

=(12)x1(y2y3)+x2(y3y1)+x3(y1y2)\triangle=\left(\frac{1}{2}\right)\left|x_{1}\left(y_{2}-y_{3}\right)+x_{2}\left(y_{3}-y_{1}\right)+x_{3}\left(y_{1}-y_{2}\right)\right|

Vertical Line

A line parallel to the y-axis at horizontal distance a has every point sharing the same x-coordinate, so its equation is x = a. Its slope is undefined (the run is zero), so no slope-intercept form exists. The analogous horizontal line is y = b, with slope zero.

x=ax=a

Slope of a Line

The slope (or gradient) m of a non-vertical line is the tangent of the angle θ the line makes with the positive x-axis, measured counter-clockwise. It gives direction and steepness: positive slope rises left-to-right, negative slope falls, zero slope is horizontal. Slope is undefined when θ = 90°, the vertical case.

m=tanθm=\tan\theta

Parallel Lines

Two non-vertical lines are parallel exactly when they have the same slope. They never meet, or coincide entirely if their intercepts also match. Two vertical lines are parallel by inspection, since slope is undefined for both.

ie m1=m2ie\text{ }m_{1}=m_{2}

Perpendicular Lines

Two non-vertical lines are perpendicular exactly when the product of their slopes is −1. Each slope is the negative reciprocal of the other. The rule fails when one line is vertical and the other horizontal; that pair is perpendicular by direct inspection, since one slope is undefined.

ie. m1×m2=1ie.\text{ }m_{1}\times m_{2}=-1

Line Through the Origin

A line through the origin with slope m = tan θ has zero y-intercept, so the slope-intercept form reduces to y = mx. The slope alone determines the line. This is the building block for the point-slope and two-point forms below.

y=mxy=mx

Point-Slope Form

The point-slope form writes a line from one known point (x1, y1) and slope m. It says the slope between (x, y) and (x1, y1) is constantly m. Vertical lines have undefined slope; use x = x1 in that case.

(yy1)=m(xx1)\left(y-y_{1}\right)=m\left(x-x_{1}\right)

Two-Point Form

The two-point form is point-slope with the slope computed in place from the second point: m = (y2 − y1) / (x2 − x1). Use it when two points are given and neither slope nor intercept is known. The form fails when x1 = x2 (vertical line); use x = x1 there.

(yy1)=(y2y1x2x1)(xx1)\left(y-y_{1}\right)=\left(\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\right)\left(x-x_{1}\right)

Intercept Form

The intercept form uses the x-intercept a and y-intercept b, the points where the line crosses the axes. Substituting (a, 0) or (0, b) verifies the equation. It does not apply to lines through the origin (where a = b = 0) or to lines parallel to either axis (where one intercept is infinite).

xa+yb=1\frac{x}{a}+\frac{y}{b}=1