Method Deck / astronomy
Initial bearing between two points
Computes the initial compass bearing (forward azimuth) from one latitude/longitude point toward another along the great circle.
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
- lat1 (number, degrees, required) min -90 max 90 : Latitude of the starting point.
- lon1 (number, degrees, required) min -180 max 180 : Longitude of the starting point.
- lat2 (number, degrees, required) min -90 max 90 : Latitude of the destination point.
- lon2 (number, degrees, required) min -180 max 180 : Longitude of the destination point.
Outputs
- bearing_degrees (degrees from true north, 0-360): Initial great-circle bearing from point 1 to point 2.
Steps
- Convert both points' latitudes and longitudes to radians.
- theta = atan2( sin(dLon)*cos(lat2), cos(lat1)*sin(lat2) - sin(lat1)*cos(lat2)*cos(dLon) ), where dLon = lon2 - lon1.
- Convert theta to degrees and normalize into the range 0 to 360 by adding 360 and taking the result modulo 360.
- Round to 2 decimals.
- This is the initial bearing only; the bearing changes continuously along a great-circle route except along the equator or a meridian.
Constants
None.
Sources
Worked example and test vectors
| Name | Inputs | Answer |
| worked example | {"lat1":0,"lon1":0,"lat2":0,"lon2":90} | 90.00 degrees |
| test vector: London to Paris | {"lat1":51.5074,"lon1":-0.1278,"lat2":48.8566,"lon2":2.3522} | 148.12 degrees |
Published card
- Address:
007fa1b8a433d439095d9ab9e351bea2
- Made at:
2026-09-30T22:39:30.722Z
- Method sha256:
e3b64c85d971f395275b0a0fe8b8a7376170a6e4c9c87a05184c6a6ca420694a