Distance Formula Calculator
Calculate the straight-line distance between two points on a coordinate plane. Ideal for geometry problems, map calculations, and verifying vector lengths.
About this calculator
The distance between two points in a 2D coordinate plane is found using the distance formula, derived directly from the Pythagorean theorem. If the two points are (x₁, y₁) and (x₂, y₂), the formula is: d = √((x₂ − x₁)² + (y₂ − y₁)²). The horizontal difference (x₂ − x₁) and vertical difference (y₂ − y₁) form the two legs of a right triangle, and d is the hypotenuse. Squaring eliminates sign issues — the result is the same regardless of which point is labeled 1 or 2. The formula extends naturally to three dimensions by adding (z₂ − z₁)², and further to n-dimensional Euclidean space. It is foundational in geometry, physics, computer graphics, and geographic distance approximations.
How to use
Find the distance between points (1, 2) and (4, 6). Enter x₁ = 1, y₁ = 2, x₂ = 4, y₂ = 6. The calculator computes: d = √((4 − 1)² + (6 − 2)²) = √(3² + 4²) = √(9 + 16) = √25 = 5. The distance is exactly 5 units. Notice this is a classic 3-4-5 right triangle. You can confirm by checking that the differences (3 and 4) satisfy the Pythagorean theorem: 3² + 4² = 5².
Frequently asked questions
How is the distance formula related to the Pythagorean theorem?
The distance formula is a direct application of the Pythagorean theorem (a² + b² = c²). When you draw a right triangle connecting two points on a coordinate plane, the horizontal leg has length |x₂ − x₁| and the vertical leg has length |y₂ − y₁|. The straight-line distance between the points is the hypotenuse. Substituting into the Pythagorean theorem and solving for c gives exactly d = √((x₂ − x₁)² + (y₂ − y₁)²). This geometric insight explains why the formula works and why squaring the differences removes the need for absolute values.
Can I use the distance formula to calculate real-world distances on a map?
The distance formula works perfectly on a flat (Cartesian) coordinate plane, making it accurate for small-scale maps or grid-based problems. However, for geographic distances on Earth's curved surface, the formula introduces increasing error as distances grow. For real-world latitude/longitude calculations, the Haversine formula accounts for Earth's curvature and gives much more accurate results over long distances. For local distances under a few kilometers where a flat-earth approximation is acceptable, converting coordinates to meters and applying the distance formula is a practical approach.
What is the distance between a point and the origin and why does it matter?
The distance from any point (x, y) to the origin (0, 0) simplifies to d = √(x² + y²). This value is also called the magnitude or norm of the vector (x, y). In physics, it represents the scalar size of a 2D vector — for example, the speed of an object moving with velocity components vₓ and v_y is |v| = √(vₓ² + v_y²). In complex number theory, it gives the modulus of the complex number x + yi. This special case of the distance formula appears constantly across mathematics, physics, and engineering.