Saltar al contenido principal
Calculator Tools
MatemáticasGratisSin registro

Distance Calculator - Calculadora online gratis

Calculate the distance between two points in 2D or 3D space using the Euclidean formula. Used for geometry problems, GPS plotting, computer graphics and physics.

  • Fórmula visible en la página
  • Funciona en tu navegador
  • Tus datos son privados

Point 1

Point 2

Euclidean distance

5

√((x₂−x₁)² + (y₂−y₁)²)

Parte del contenido aún se muestra en inglés.

Acerca de

Entender: Distance Calculator

The distance formula is the workhorse of coordinate geometry - used everywhere from school-level analytical geometry to machine learning's nearest-neighbour algorithms. It computes the straight-line (Euclidean) distance between two points in 2D or 3D space, derived directly from the Pythagorean theorem applied to coordinate differences. For Class 9-12 students in India, the formula appears in every coordinate geometry chapter (Class 9 introduces it; Class 10 boards regularly test it; Class 11-12 builds 3D extension; JEE Main and Advanced test challenging applications).

Beyond mathematics, distance calculations underpin GPS navigation (with curvature corrections), computer graphics (collision detection, rendering), computer vision (similarity between feature vectors), machine learning (k-nearest neighbours, clustering), physics (vector magnitudes, displacements), and robotics (path planning). This calculator handles both 2D points (x, y) and 3D points (x, y, z) - extending the formula by simply adding more squared terms under the root. The technique generalises to any number of dimensions, which is how high-dimensional data in machine learning (feature vectors with hundreds of values) is compared.

Cómo usar

Cómo usar Distance Calculator en 3 pasos

  1. Pick 2D or 3D mode.

  2. Enter the coordinates of both points.

  3. Read the straight-line distance.

La fórmula

Cómo funciona Distance Calculator

Distance is the length of the straight line between two points. In 2D it's √((x₂−x₁)² + (y₂−y₁)²) - the Pythagorean theorem applied to the coordinate differences. 3D adds a z-axis term.

Formula

2D: d = √((x₂−x₁)² + (y₂−y₁)²) 3D: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)

  • (x, y, z)Coordinates of a point
  • dEuclidean distance
Las matemáticas

Cómo obtiene Distance Calculator su resultado

2D distance: d = √((x₂−x₁)² + (y₂−y₁)²). Derived from the Pythagorean theorem: form a right triangle with horizontal leg |x₂−x₁|, vertical leg |y₂−y₁|, and hypotenuse equal to the distance. The square root and squaring ensure positivity and symmetry - distance from A to B equals distance from B to A.

3D distance: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²). Same Pythagorean idea extended - first find diagonal across xy-plane, then apply Pythagoras again with the z-component. This generalises further to n dimensions: simply add (xᵢ₂−xᵢ₁)² for each coordinate i and take the square root.

Other distance metrics for special cases: Manhattan (L₁) distance = |x₂−x₁| + |y₂−y₁| - total grid movement, used when only axis-aligned travel is possible (city blocks, chess rook moves). Chebyshev (L∞) distance = max(|x₂−x₁|, |y₂−y₁|) - useful for king moves on chessboard. Haversine distance - for great-circle distance on a sphere (used in GPS to compute distance between latitude/longitude coordinates accounting for Earth's curvature).

Ejemplos

Ejemplos resueltos

2D: Distance between (3, 4) and (0, 0)

d = √(3² + 4²) = √(9 + 16) = √25 = 5. The classic 3-4-5 right triangle in disguise. Most common school problem.

3D: Distance between (1, 2, 3) and (4, 6, 8)

d = √((4-1)² + (6-2)² + (8-3)²) = √(9 + 16 + 25) = √50 = 7.07. Used in computer graphics for 3D modelling and physics for displacement in space.

Coordinate geometry: collinearity check

Points A(1,2), B(3,4), C(5,6). AB = √8 ≈ 2.83. BC = √8 ≈ 2.83. AC = √32 ≈ 5.66. AB + BC = AC, so points are collinear. Distance formula is the standard test.

Casos de uso

Cuándo usar Distance Calculator

  • Class 9-12 coordinate geometry homework and exam prep.
  • JEE Main and Advanced coordinate geometry questions.
  • Computer graphics - collision detection, distance-based effects, animations.
  • Machine learning - k-nearest neighbours, clustering algorithms.
  • Physics - vector magnitude, displacement, velocity calculations.
  • Robotics and game development - pathfinding and proximity checks.
  • GPS coordinate distance (approximate for short distances; use Haversine for accuracy).
  • Civil engineering - survey point distances on construction sites.
Cuidado

Errores y trampas habituales

  • Forgetting to square the differences. The formula uses (x₂-x₁)², not (x₂-x₁).
  • Forgetting the final square root. Without it, you get squared distance.
  • Mixing up which coordinate is x and which is y. Always (x, y) ordering.
  • Using Euclidean for latitude/longitude. Earth's curvature requires Haversine for accurate GPS distances >10 km.
  • Confusing displacement (vector with direction) and distance (scalar, always positive).
Consejos

Saca más partido a esta herramienta

  • For mental estimation, the distance is roughly max(|Δx|, |Δy|) for small differences in one coordinate.
  • For 2D problems, sketch the points on graph paper first to verify your answer is in the right ballpark.
  • Manhattan distance ≥ Euclidean distance ≥ Chebyshev distance - useful inequality to remember.
  • Distance formula extends to any dimension - just add more squared terms.
  • Pair with the Pythagorean theorem, slope and coordinate geometry calculators on this site for related work.
Preguntas frecuentes

Preguntas sobre Distance Calculator

Is this great-circle distance?

No - this is straight-line (Euclidean) distance. For distance between latitude/longitude on Earth, use the Haversine formula which accounts for curvature.

What's Manhattan distance?

|x₂−x₁| + |y₂−y₁| - total of horizontal and vertical movement, like walking on a grid. Used in computer science and ML when only axis-aligned movement is allowed.

Distance is always positive?

Yes - it's a square root of a sum of squares, always ≥ 0. Direction is captured separately by displacement vectors.

How is this used in graphics?

Detecting collisions (objects overlap if distance < sum of radii), nearest-neighbour searches, lighting falloff (intensity ∝ 1/d²).

What's the L_p norm?

Generalisation: ‖x‖_p = (Σ|xᵢ|^p)^(1/p). Euclidean is p=2, Manhattan is p=1, Chebyshev (max coordinate) is p→∞.

Higher-dimensional distance?

Just add more squared terms under the root. The formula works for any number of dimensions - used everywhere in ML for high-dim feature vectors.

Math in your browser

From simple percentages to scientific notation, statistics, geometry and big-number arithmetic - every common math problem you'd reach for a calculator for, runs in your browser with no installs. The fraction calculator preserves exact rationals, the big-number calculator uses BigInt for hundreds of digits without precision loss, and the scientific calculator's expression evaluator is a hand-written shunting-yard parser (no eval) that supports trig, log, factorial and parentheses.

If you're a student, double-check your work without paying for a graphing calculator. If you're a professional, use these tools as a sanity check on spreadsheet formulas. Every result is shown alongside its formula and inputs, so the math is always auditable.

The Distance Calculator is part of the Math suite on Online Calculator Tools, alongside 6 related calculators. All tools share the same UI patterns, the same privacy-first rendering (nothing is sent to a server), and the same commitment to showing the formula and assumptions behind every result.