application
Distance Formula Calculator
Calculate the distance between two points using d = \u221A((x\u2082\u2212x\u2081)\u00B2 + (y\u2082\u2212y\u2081)\u00B2). Based on the Pythagorean theorem applied to coordinate geometry.
Click to show tips
Try an Example
Pick a scenario to see how the calculator works, then adjust the values
Ladder Against Wall
A 10-foot ladder leans against a wall with the base 6 feet away. How high does it reach?
Key values: Leg a = 6 ft · Hypotenuse c = 10 ft · Solve for leg b
TV Screen Diagonal
Find the diagonal of a TV with a 16:9 aspect ratio (width 40", height 22.5").
Key values: Width = 40 in · Height = 22.5 in · Find diagonal
Classic 3-4-5 Triangle
Verify that sides 3, 4, and 5 form a right triangle (the most famous Pythagorean triple).
Key values: Sides: 3, 4, 5 · Right triangle · Primitive triple
The Distance Formula
The distance between two points and in the Cartesian plane is derived directly from the Pythagorean theorem:
Why It Works
Draw a right triangle with the two points as endpoints of the hypotenuse. The horizontal leg has length and the vertical leg has length . By the Pythagorean theorem, the hypotenuse (the distance) is .
Key insight: The distance formula is not a separate concept to memorize—it is the Pythagorean theorem applied to coordinates. Every distance calculation in coordinate geometry is a right triangle in disguise.
Extension to Three Dimensions
The same principle extends naturally to 3D by applying the Pythagorean theorem twice:
First compute the distance in the xy-plane, then treat that result and the z-difference as legs of a second right triangle. This generalizes to any number of dimensions:
This n-dimensional version is called the Euclidean distance and is fundamental to machine learning, statistics, and physics.
Worked Examples
Example 1: Distance Between Two Cities on a Map
On a coordinate grid where 1 unit = 1 mile, City A is at (3, 7) and City B is at (11, 1).
Example 2: Checking If a Point Lies on a Circle
Does the point (5, 12) lie on the circle centered at the origin with radius 13?
Yes—the distance from the origin equals the radius, so the point is on the circle. (This is also the Pythagorean triple (5, 12, 13)!)
Example 3: Midpoint Verification
The midpoint of two points should be equidistant from both. For (2, 4) and (8, 10), the midpoint is (5, 7). Verify:
Applications
- Navigation: GPS distance calculations between waypoints
- Computer graphics: Collision detection, path length, object proximity
- Machine learning: k-Nearest Neighbors (kNN), clustering algorithms (k-means), and dimensionality reduction all use Euclidean distance
- Physics: Calculating displacement, electric field strength (inverse-square law), and gravitational force
Frequently Asked Questions
What is the distance formula?
The distance formula calculates the straight-line distance between two points in a coordinate plane. It is derived directly from the Pythagorean theorem by treating the horizontal and vertical displacements as the legs of a right triangle.
How is the distance formula related to the Pythagorean theorem?
The distance formula is the Pythagorean theorem applied to coordinates. The horizontal displacement and vertical displacement form the two legs of a right triangle, and the distance between the points is the hypotenuse.
Does the distance formula work in three dimensions?
Yes. In 3D, add the z-component: . This generalizes to any number of dimensions as , known as the Euclidean distance.
Can I use the distance formula to check if a point is on a circle?
Yes. A point lies on a circle centered at with radius if the distance from the point to the center equals . Calculate and check if .
What are common applications of the distance formula?
Common applications include GPS navigation between waypoints, collision detection in computer graphics, k-nearest neighbor algorithms in machine learning, calculating displacement in physics, and verifying geometric properties like midpoint equidistance.
Related application Variants
Explore more application options
More Math Calculators
Explore the category