📏 Distance Calculator

Plane-coordinate forward and inverse: find the horizontal distance and azimuth from two points, or the other point from one point, distance and azimuth.

📐 計算公式
座標正反算(本頁程式碼口徑,雙模式):反算(兩點→距離方位)S=√(Δx²+Δy²)、方位角 α=atan2(Δx,Δy)×180÷π,負值加 360 歸 0–360°;正算(一點+距離方位→另一點)x₂=x₁+S×sin(α)、y₂=y₁+S×cos(α)(α 先化弧度代入)。校驗:當前模式對應輸入任一非數值即清空結果(無錯誤提示)。判據:無固定分級,方位名按 16 方位表取 round(α÷22.5)%16(正北、北偏東……北偏西)。

平面座標正算與反算:由兩點座標求距離與方位角,或由一點、距離、方位角求另一點

座標軸約定:x 軸向東、y 軸向北;方位角從正北順時針計,0—360°。反算公式:S=√(Δx²+Δy²),α=atan2(Δx,Δy);正算:x₂=x₁+S·sinα,y₂=y₁+S·cosα。兩點重合(S=0)時方位角未定義,不輸出確定方向;正算距離 S 須 ≥ 0,距離為 0 時終點即起點、方向未定義。

📚 深度解析:距離計算(平面正反算)

💡 常見使用場景

  • 平面兩點反算距離與方位角。
  • 由已知點、平距與方位角正算另一點。
  • 控制網與放樣座標推算。
反算
A(0,0)、B(30,40) → Δx=30、Δy=40,平距 S=√(30²+40²)=50.000 m,方位角 α=atan2(Δx,Δy)=36.870°。
正算互檢
起點 (0,0)、平距 50.000 m、方位角 36.870° → 終點 x=50·sin36.870°=30.000,y=50·cos36.870°=40.000,與反算結果一致。

❓ 常見問題(FAQ)

正反算能否互檢?
正算得到終點後再反算,應還原原距離與方位角;兩點重合(S=0)時方位角未定義,不輸出確定方向。
本頁能算斜距或三維距離嗎?
不能。本頁只做平面座標正反算;斜距改化平距與高差請用全站儀測距換算工具,三維空間距請用三維座標距離工具。

Formula & Standard References

Item Formula / Note Source / Standard
Inverse computation D = sqrt( (x2 - x1)^2 + (y2 - y1)^2 ); alpha = atan2(Δx, Δy) GB 50026-2020, Code for engineering surveying
Forward computation x2 = x1 + D · sin(alpha); y2 = y1 + D · cos(alpha) GB 50026-2020, Code for engineering surveying
Mutual check A forward computation followed by an inverse one must reproduce the input GB 50026-2020, Code for engineering surveying
Units and rounding Round distances to mm or cm and angles to seconds, as the project precision requires GB 50026-2020, Code for engineering surveying
⚠️ 使用說明與注意事項