Notes on Celestial Navigation

CNTARC - Convert an Hour Angle to Degrees

Description: Converts hours to degrees using \(15^\circ\) per hour of time.

Inputs:

HoursThe time in hours to convert
MinutesThe time in minutes to convert
SecondsThe time in seconds to convert

Outputs:

ArcThe arc angle in degrees corresponding to the time

Sample execution:

Hours? 2
Minutes? 31
Seconds? 20

Arc: 37° 50.0'

(For explanation of notation, conventions etc, see python-programs).



Copyright (C) 2024 Ian Staniforth

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.


# CNTARC - Convert a time to degrees

from math import *
from CN_LIB import *

h = int(input("Hours? "))
m = int(input("Minutes? "))
s = int(input("Seconds? "))

t = abs(h)+m/60+s/3600
if (h < 0): t = -t
d = t*15

print("")
print("Arc: "+dtos(d))