Distance between two points

LVL: FREE

MODULE: Coordinate Geometry and Vectors

[EXEC: MICRO_CORE]

✖️ 1. Deriving the distance formula directly from the Pythagorean theorem

📐 Deriving the Distance Formula from Pythagorean Theorem

  • Draw two points on a grid and connect them with a right triangle.
  • The horizontal leg length is the difference in x-coordinates.
  • The vertical leg length is the difference in y-coordinates.
  • Apply Pythagorean theorem: c2=a2+b2c^2 = a^2 + b^2 where cc is the distance.
  • The distance formula becomes d=(Δx)2+(Δy)2d = \sqrt{(\Delta x)^2 + (\Delta y)^2}.

Example: Points at (1, 2) and (4, 6) form a triangle with legs 3 and 4, so d=32+42=25=5d = \sqrt{3^2 + 4^2} = \sqrt{25} = 5.

💡 Think: The distance is the hypotenuse of the invisible right triangle between two points.

[EXEC: DEEP_COMPUTE]

1. Deriving the distance formula directly from the Pythagorean theorem

Deriving the Distance Formula from the Pythagorean Theorem

The distance between two points in the coordinate plane is found by constructing a right triangle where the distance is the hypotenuse. Given points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), the horizontal leg has length x2x1|x_2 - x_1| and the vertical leg has length y2y1|y_2 - y_1|.

Visualizing the two points as opposite corners of a rectangle reveals that the straight-line distance forms the diagonal.

Core derivation steps:

  • Identify horizontal separation: Δx=x2x1\Delta x = x_2 - x_1
  • Identify vertical separation: Δy=y2y1\Delta y = y_2 - y_1
  • Apply Pythagorean theorem: d2=(Δx)2+(Δy)2d^2 = (\Delta x)^2 + (\Delta y)^2
  • Solve for distance: d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

The squaring operation eliminates the need for absolute values since (Δx)2=Δx2(\Delta x)^2 = |\Delta x|^2. This formula generalizes the Pythagorean theorem to any pair of points in the plane.

Example: Points (1,2)(1, 2) and (4,6)(4, 6) give d=(41)2+(62)2=9+16=5d = \sqrt{(4-1)^2 + (6-2)^2} = \sqrt{9 + 16} = 5.

TASK_1[0 / 3]
LVL_2
EXEC: FORMULA

Find the distance between the points (0,0)(0, 0) and (6,8)(6, 8).

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 2. Calculating the precise distance between two points

🎯 Calculating Distance Between Two Points

  • Use the formula d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.
  • Subtract coordinates in any order (squaring eliminates negatives).
  • Always take the square root of the sum of squares.
  • The result is always non-negative (distance cannot be negative).
  • Order of points does not matter: d(A,B)=d(B,A)d(A, B) = d(B, A).

Example: Distance from (2, 3) to (5, 7) is d=(52)2+(73)2=9+16=25=5d = \sqrt{(5-2)^2 + (7-3)^2} = \sqrt{9 + 16} = \sqrt{25} = 5.

💡 Remember: Square the differences, add them, then square root the total.

[EXEC: DEEP_COMPUTE]

2. Calculating the precise distance between two points

Calculating Distance Between Two Points

The distance formula d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} computes the exact straight-line separation between points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). This metric is also called the Euclidean distance.

The formula is symmetric: swapping the order of points yields the same result since squaring eliminates sign differences.

Calculation protocol:

  • Subtract corresponding coordinates: x2x1x_2 - x_1 and y2y1y_2 - y_1
  • Square both differences to ensure non-negativity
  • Sum the squared differences
  • Take the principal square root (always non-negative)

The result is always a non-negative real number, with d=0d = 0 if and only if the two points coincide. Order independence means d(P,Q)=d(Q,P)d(P, Q) = d(Q, P) for any points PP and QQ.

Example: Distance from (2,3)(-2, 3) to (1,1)(1, -1) is (1(2))2+(13)2=9+16=5\sqrt{(1-(-2))^2 + (-1-3)^2} = \sqrt{9 + 16} = 5.

TASK_1[0 / 3]
LVL_2
EXEC: FORMULA

Calculate the Euclidean distance between the points (1, 2) and (4, 6).

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 3. Simplifying the distance formula for horizontal and vertical lines

↔️ Simplified Distance for Horizontal and Vertical Lines

  • For horizontal lines (same y-coordinate), distance is d=x2x1d = |x_2 - x_1|.
  • For vertical lines (same x-coordinate), distance is d=y2y1d = |y_2 - y_1|.
  • One coordinate difference becomes zero, so one term vanishes.
  • Use absolute value to ensure positive distance.
  • This is just 1D distance on a number line.

Example: Points (2, 5) and (8, 5) are horizontal, so d=82=6d = |8 - 2| = 6.

💡 Shortcut: If points share one coordinate, just subtract the other and take absolute value.

[EXEC: DEEP_COMPUTE]

3. Simplifying the distance formula for horizontal and vertical lines

Distance Formula for Horizontal and Vertical Lines

When two points share a coordinate, the distance formula reduces to a one-dimensional calculation. For horizontal lines (y1=y2y_1 = y_2), the vertical separation is zero, so d=x2x1d = |x_2 - x_1|. For vertical lines (x1=x2x_1 = x_2), the horizontal separation is zero, so d=y2y1d = |y_2 - y_1|.

These cases represent axis-aligned distances where the Pythagorean theorem degenerates to measuring along a single axis.

Simplification rules:

  • Horizontal: If y1=y2y_1 = y_2, then d=x2x1d = |x_2 - x_1|
  • Vertical: If x1=x2x_1 = x_2, then d=y2y1d = |y_2 - y_1|
  • Absolute value ensures distance is non-negative
  • General formula still applies but simplifies algebraically

These special cases are computationally faster and avoid unnecessary square root operations. They correspond to measuring distance along grid lines rather than diagonally.

Example: Points (3,5)(3, 5) and (3,2)(3, -2) lie on a vertical line, so d=25=7d = |-2 - 5| = 7.

TASK_1[0 / 3]
LVL_2
EXEC: FORMULA

Find the exact distance between the points (5,12)(5, 12) and (5,3)(5, 3).

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 4. Applications in aviation and physics

✈️ Real-World Applications in Aviation and Physics

  • Aviation: Calculate straight-line distance between airports on a flat map.
  • Physics grids: Find separation between two objects in 2D space.
  • Use coordinates as positions (e.g., kilometers east and north).
  • The distance formula gives the shortest path between points.
  • Useful for fuel estimates, collision detection, and trajectory planning.

Example: Airport at (10, 20) km and another at (50, 80) km are (5010)2+(8020)2=1600+3600=520072\sqrt{(50-10)^2 + (80-20)^2} = \sqrt{1600 + 3600} = \sqrt{5200} \approx 72 km apart.

💡 Real use: Pilots and game engines use this to compute direct distances instantly.

[EXEC: DEEP_COMPUTE]

4. Applications in aviation and physics

Applications: Aviation and Physics Grids

The distance formula calculates straight-line separations in practical coordinate systems. In aviation, it determines direct flight distances between airports when coordinates represent latitude-longitude projections (ignoring Earth's curvature for short distances). In 2D physics simulations, it measures spatial separation between objects on a grid.

These applications assume a flat Euclidean plane where the shortest path is a straight line.

Application contexts:

  • Aviation: Compute direct routes between waypoints for fuel estimation
  • Physics grids: Calculate separation for collision detection or force computations
  • Coordinates must use consistent units (kilometers, meters, etc.)
  • Result represents as-the-crow-flies distance, not actual travel distance

For large-scale aviation, spherical geometry (great-circle distance) is more accurate, but the Euclidean formula suffices for regional planning. In physics, this distance often appears in inverse-square laws.

Example: Airport at (120,45)(120, 45) km and another at (150,75)(150, 75) km are (150120)2+(7545)2=900+90042.4\sqrt{(150-120)^2 + (75-45)^2} = \sqrt{900 + 900} \approx 42.4 km apart.

TASK_1[0 / 3]
LVL_2
EXEC: FORMULA

In an aviation coordinate system, Airport A is located at (10,20)(10, 20) km and Airport B is located at (40,60)(40, 60) km.

Calculate the direct straight-line distance between the two airports in kilometers.

DEEP_COMPUTE
ULTRA

AWAITING_CONFIRMATION

CONFIRM KNOWLEDGE ACQUISITION TO UPDATE SYSTEM ANALYTICS.