The distance formula

The length of a line segment between two points P₁(x₁, y₁) and P₂(x₂, y₂) is found using the distance formula, derived from the Pythagorean theorem.

Formula: d = √((x₂ - x₁)² + (y₂ - y₁)²)

For example, the distance between (1, 2) and (4, 6) is √(3² + 4²) = √25 = 5.

Where this is used

  • Computing Euclidean distance in geometry and physics.
  • Navigation and GPS: straight-line distance between waypoints.
  • Computer graphics: calculating distances between vertices.
  • Machine learning: distance metrics in clustering algorithms.