CNAP - Calculate an Assumed Position
Description: Calculates the Assumed Position (AP) for use with sight reduction tables and Saint-Hilaire's method.
Inputs:
| GHA | GHA of the celestial object |
| Lat | DR Latitude of the observer |
| Lon | DR Longitude of the observer |
Outputs:
| AP Lat | Latitude of the Assumed Position |
| AP Lon | Longitude of the Assumed Position |
Sample execution:
GHA? 350,02.2 Lat? 42,32.4 Lon? 18,08.5 AP Lat: 43° 00.0' AP Lon: 17° 57.8'
(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/.
# CNAP - Calculate an Assumed Position for Saint-Hilaire's method
from math import *
from CN_LIB import *
gha = stod("GHA? ")
lat = stod("Lat? ")
lon = stod("Lon? ")
aplat = floor(lat+0.5)
lha = (gha+lon+360)%360
e = lha-floor(lha+0.5)
aplon = lon-e
print("")
print("AP Lat: "+dtos(aplat))
print("AP Lon: "+dtos(aplon))