Convert Degrees/Minutes/Seconds to Decimal Coordinates
<p>In one part of my code I convert from decimal coordinates to degrees/minutes/seconds and I use this:</p>

<pre><code>double coord = 59.345235;
int sec = (int)Math.Round(coord * 3600);
int deg = sec / 3600;
sec = Math.Abs(sec % 3600);
int min = sec / 60;
sec %= 60;
</code></pre>

<p>How would I convert back from degrees/minutes/seconds to decimal coordinates?</p>
