HTML/JS: Degree decimal to hour-min-sec

Degree decimal

Formula

To convert degree decimals into hours minutes seconds, we use the following steps,

  1. Divide the given value by $15$ to convert it to its equivalent degree value. Subtract the fractional part from the answer to obtain the degree value.
  2. Multiply the fractional part of the input value by 60 to get the fractional representation of minutes.
    1. Subtract the decimal part from this value to get the minutes.
  3. To get the seconds, multiply the fractional part from step # 2 by 60.

Example

Here we convert 12.203333 from degree decimal to hours minutes seconds using the procedure defined above,

\begin{aligned}
\text{deg\,decimal} &= 12.203333/15 = 0.813555533\\
\text{hour} &= 0.813555533 - 0.813555533 = 0^\text{h}\\
\text{min} &= 0.813555533\times60 = 48.813332 \rightarrow 48.813332 - 0.813332 = 48^\text{m}\\
\text{sec} &= 0.813332 \times 60 = 48.79992^\text{s}
\end{aligned}

So, 12.203333 in degree decimals is equal to $0^\text{h}\ 48^\text{m}\ 48.79992^\text{s}$.

See also

DD & DMS

  1. Degree decimal to deg-min-sec
  2. deg-min-sec to degree decimal

DD & HMS

  1. hour-min-sec to degree decimal

Your thoughts