@ue-too/border / midPointOnGreatCircle
Function: midPointOnGreatCircle()
midPointOnGreatCircle(
startCoord,endCoord):GeoCoord
Defined in: greateCircle.ts:86
Calculates the midpoint along a great circle path.
Parameters
startCoord
The starting geographic coordinate
endCoord
The ending geographic coordinate
Returns
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);