Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: 度、分、秒を10進座標に変換する方法
私は39°07.356"Nと121°02.482"Wを持っており、10 進度に変換する必要があります。ソースは?
次の関数を使用してタスクを実行できます
public decimal DmsToDD(double d, double m = 0, double s = 0) { return Convert.ToDecimal((d + (m/60) + (s/3600))*(d < 0 ? -1 : 1)); }
もちろん、変換を行う前に、分と秒のコンポーネントが負でないことを確認する必要があります。