Skip to content

@ue-too/border / destinationFromOriginOnRhumbLine

Function: destinationFromOriginOnRhumbLine()

destinationFromOriginOnRhumbLine(startCoord, bearing, distance): GeoCoord

Defined in: rhumbLine.ts:131

Calculates the destination point given a start point, constant bearing, and distance on a rhumb line.

Parameters

startCoord

GeoCoord

The starting geographic coordinate

bearing

number

The constant bearing in degrees (0 = north, 90 = east, etc.)

distance

number

The distance to travel in meters

Returns

GeoCoord

The destination coordinate

Remarks

Starting from a given point and traveling at a constant bearing for a given distance, this calculates where you'll end up. The bearing remains constant throughout the journey.

This is the rhumb line equivalent of destinationFromOriginOnGreatCircle.

Example

typescript
const start = { latitude: 40.0, longitude: -74.0 };

// Travel 500km on constant bearing of 45 degrees (northeast)
const destination = destinationFromOriginOnRhumbLine(start, 45, 500000);
console.log('Destination:', destination);