Post Reply 
(32S II) Position, Distance & Bearing Calculations
02-06-2023, 12:40 PM
Post: #4
RE: (32S II) Position, Distance & Bearing Calculations
This program is a verbatim translation of those for the HP-42S or HP-15C from (15C) Haversine Navigation:
Code:
D01 LBL D
D02 x<>y
D03 R↓
D04 x<>y
D05 -
D06 x<>y
D07 R↑
D08 1
D09 θ,r→y,x
D10 R↑
D11 x<>y
D12 θ,r→y,x
D13 x<>y
D14 R↓
D15 x<>y
D16 y,x→θ,r
D17 R↓
D18 +
D19 R↑
D20 θ,r→y,x
D21 x<>y
D22 R↓
D23 y,x→θ,r
D24 R↑
D25 y,x→θ,r
D26 R↓
D27 60
D28 ×
D29 RTN

Example

Kotzebue: 66°53′50.7″N 162°35′55.7″W
Noorvik: 66°50′03.3″N 161°02′03.2″W

66.53507 →HR
-162.35557 →HR
66.50033 →HR
-161.02032 →HR
XEQ D

37.07535

x<>y
95.14735

The X-register contains the distance in (old) nautical miles, while the Y-register contains the bearing.

For a final result in kilometers, substitute 60 with 111.19.
For a final result in statute miles, substitute 60 with 69.09.

Thus you will get either 68.70681 km or 42.69227 statute miles.

Caveats
  • coordinates are negative for west
  • only the forward bearing is calculated
  • switch the points to calculate the backward bearing
  • bearings may be negative
  • coordinates are expected to be in HR format

Advantages
  • no registers are needed
  • due to the use of polar/rectangular transformations the program is shorter
  • for the same reason it avoids cancelation and handling special cases


Compared to Gil's program it assumes the Earth is a sphere.
Thus the results are probably not that accurate.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (32S II) Position, Distance & Bearing Calculations - Thomas Klemm - 02-06-2023 12:40 PM



User(s) browsing this thread: 1 Guest(s)