プロフェッショナルな距離計算機

Calculate distances between points in 2D, 3D, Manhattan distance, Minkowski distance, and geographic distance using Haversine formula.

学習と宿題のサポートとして、重要な計算を独立して検証します。

レビュー者 CalculatorDrive Math編集委員会 · 最終更新日

電卓

Enter coordinates for two points to calculate the distance between them.

短い答え

The right distance formula depends on how you're allowed to travel between two points. Straight-line ("as the crow flies") distance uses the Euclidean formula, d = √[(x₂−x₁)² + (y₂−y₁)²]. Grid-based movement, like city blocks, uses Manhattan distance instead: d = |x₂−x₁| + |y₂−y₁|. For places on Earth, geographic distance accounts for the planet's curvature using the Haversine formula.

重要なポイント

  • ユークリッド距離は常に 2 点間の可能な最短経路です。斜めに切ることができないため、マンハッタンの距離は常に等しいかそれ以上になります。
  • Euclidean and Manhattan distance are only equal when the two points share an x or y coordinate — movement along a single axis.
  • ミンコフスキー距離は一般化です。p = 1 はマンハッタンを与え、p = 2 はユークリッドを与え、p = ∞ はチェビシェフ距離 (最大の単一軸の差) を与えます。
  • 地球の表面は湾曲しているため、座標間の地理的距離には平面距離の公式ではなく、ハバーサインの公式が必要です。

適切な距離公式の選択

シナリオ なぜ
平面上の直線距離ユークリッド可能な最短のパス
街区/グリッドに沿った距離マンハッタンブロックを斜めに切ることはできない
2 つの地球座標間の距離地理的 (ハーバーシン)惑星の曲率を考慮する
一般的な調整可能な距離メトリックミンコフスキーユークリッド、マンハッタン、チェビシェフをカバーするファミリー

Worked example: three distances, one pair of points

Take the points (0, 0) and (3, 4). Depending on the metric, "the distance" between them isn't a single number:

メトリック 計算 結果
ユークリッド (p=2)√(3² + 4²) = √255
マンハッタン (p=1)|3| + |4|7
チェビシェフ (p=∞)max(3, 4)4

All three answers are correct — for their own definition of "distance." Euclidean gives the shortest path (a straight line), Manhattan gives the longest (grid-only movement), and Chebyshev gives the shortest of all, since it only counts the larger of the two axis differences.

ミンコフスキー遠隔家族

d = (Σ|xᵢ − yᵢ|ᵖ)^(1/p)

Minkowski distance is a single formula with a tunable parameter p. Setting p = 1 reduces it to Manhattan distance, p = 2 reduces it to Euclidean distance, and as p approaches infinity, it converges to Chebyshev distance — the largest single-axis gap between the two points. This makes Minkowski distance a useful way to sweep between "grid movement" and "straight-line movement" behavior for the same pair of points.

避けるべきよくある間違い

  • ユークリッド距離を使用して都市グリッド内の実際の移動距離を推定します。実際の歩行距離または運転距離が過小評価されますが、マンハッタン距離はより現実的にモデル化されます。
  • 平面距離の公式を緯度/経度の座標に直接適用します。経度の度合いは、緯度に応じて非常に異なる現実世界の距離をカバーするため、代わりにハバーサインの公式が必要になります。
  • 1 未満のミンコフスキー パラメーター p を使用し、通常の距離の動作が期待されます。p = 1 未満では、式は三角不等式を満たさず、真の距離計量のように動作しなくなります。
  • 負の座標が負の距離を生成するのではないかと心配します。二乗法 (ユークリッド) と絶対値 (マンハッタン) は両方とも符号を削除するため、距離が負になることはなく、点の順序は重要ではありません。

よくある質問

2 点間の距離はどのようにして求めますか?

平面では、ピタゴラスの定理から導かれた距離公式 d = √[(x₂ − x₁)² + (y₂ − y₁)²] を使用します。

ポイントの順番は重要ですか?

いいえ。二乗により符号の違いが除去されるため、点 A から B に移動しても、B から A に移動しても、距離は同じです。

2D 距離はピタゴラスの定理とどのように関係しますか?

水平方向と垂直方向の分離は直角三角形の脚を形成します。距離は斜辺です。

これは三次元でも機能しますか?

はい。式 d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²] を空間内の点に拡張します。

この距離計算ツールはどのように使用すればよいですか?

2D または 3D で 2 点の座標を入力し、[計算] をクリックして直線距離と使用されたステップを確認します。

ユークリッド距離とマンハッタン距離の違いは何ですか?

ユークリッド距離は、2 点間の直線経路を測定します。マンハッタン距離は、街区など、斜めに切ることができないグリッドに沿ったパスを測定します。点 (0,0) と (3,4) の場合、ユークリッド距離は 5 ですが、マンハッタン距離は 7 であり、常に直線パスと同じかそれより長くなります。

More math calculators