CNRUN - Calculate a new latitude and longitude from a course and distance made good
Description: Calculates the new latitude and longitude when position changes during a run.
Inputs:
| Lat | Original Latitude of the observer |
| Lon | Original Longitude of the observer |
| DMG | Distance made good in nautical miles during run |
| CMG | Course made good in degrees and minutes during run |
Outputs:
| Lat | New Latitude after run |
| Lon | New Longitude after run |
Sample execution:
Lat? 49,50 Lon? -4,25 DMG? 50 CMG? 220 Lat = 49° 11.7' Lon = -5° 14.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/.
# CNRUN - Calculate new latitude and longitude from a course and distance made good
from math import *
from CN_LIB import *
lat = stod("Lat? ")
lon = stod("Lon? ")
dmg = float(input("DMG? "))
cmg = stod("CMG? ")
dlat = dmg*Cos(cmg)/60
dlon = dmg*Sin(cmg)/Cos(lat)/60
lat = lat+dlat
lon = lon+dlon
print("")
print("Lat = "+dtos(lat))
print("Lon = "+dtos(lon))