The Distance Formula
The distance formula calculates the straight-line distance between two points in a 2D coordinate plane. Given two points (x1, y1) and (x2, y2), the distance d is:
d = sqrt((x2 - x1)2 + (y2 - y1)2)
This formula is a direct application of the Pythagorean theorem. By treating the horizontal difference as one leg and the vertical difference as the other leg of a right triangle, the distance between the two points is the hypotenuse.
Related Calculations
Distance Formula
The straight-line distance between two points derived from the Pythagorean theorem.
Midpoint Formula
The point exactly halfway between two given points.
Slope Formula
The steepness and direction of the line passing through two points.
Line Equation (Point-Slope)
The equation of the line through two points using point-slope form.
Slope-Intercept Form
The standard form of a line equation showing slope and y-intercept.
3D Distance Formula
Extension of the 2D formula to three-dimensional space.
Derivation from the Pythagorean Theorem
Consider two points P1(x1, y1) and P2(x2, y2). Draw horizontal and vertical lines from each point to form a right triangle. The horizontal leg has length |x2 - x1| and the vertical leg has length |y2 - y1|. By the Pythagorean theorem (a2 + b2 = c2), the hypotenuse c equals sqrt((x2-x1)2 + (y2-y1)2), which is exactly the distance formula.
Understanding the Midpoint
The midpoint of a line segment is the point that divides the segment into two equal halves. It is found by averaging the x-coordinates and y-coordinates separately: M = ((x1+x2)/2, (y1+y2)/2). The midpoint is equidistant from both endpoints.
Understanding Slope
The slope of a line measures its steepness. A positive slope means the line rises from left to right, while a negative slope means it falls. A slope of zero indicates a horizontal line, and an undefined slope (when x1 = x2) indicates a vertical line. The slope is calculated as m = (y2 - y1) / (x2 - x1), often described as "rise over run."
Practical Applications
- Navigation: Finding the straight-line distance between two locations on a map.
- Physics: Calculating displacement, determining distances between objects.
- Computer graphics: Collision detection, determining proximity of objects.
- Engineering: Surveying, structural analysis, circuit board design.
- Data science: Similarity measures, clustering algorithms, nearest-neighbor search.
Common Examples
- (0, 0) to (3, 4): d = sqrt(9 + 16) = sqrt(25) = 5 (a classic 3-4-5 right triangle).
- (1, 1) to (4, 5): d = sqrt(9 + 16) = 5, midpoint (2.5, 3), slope = 4/3.
- (-2, 3) to (4, -1): d = sqrt(36 + 16) = sqrt(52) = 7.211, slope = -2/3.