Skip to content

@ue-too/border / index / midPointOnGreatCircle

Function: midPointOnGreatCircle() ​

midPointOnGreatCircle(startCoord, endCoord): GeoCoord

Defined in: greateCircle.ts:86

Calculates the midpoint along a great circle path.

Parameters ​

startCoord ​

GeoCoord

The starting geographic coordinate

endCoord ​

GeoCoord

The ending geographic coordinate

Returns ​

GeoCoord

The midpoint on the great circle path

Remarks ​

This is a specialized, optimized version of intermediatePointOnGreatCircle for finding the exact midpoint (fraction = 0.5).

Example ​

typescript
const start = { latitude: 50.0, longitude: -5.0 };
const end = { latitude: 58.0, longitude: 3.0 };
const mid = midPointOnGreatCircle(start, end);
console.log('Midpoint:', mid);