@saehrimnir/druidjs / haversine
Function: haversine()
ts
function haversine(a: number[] | Float64Array<ArrayBufferLike>, b: number[] | Float64Array<ArrayBufferLike>): number;Defined in: metrics/haversine.js:10
Computes the Haversine distance between two points on a sphere of unit length 1. Multiply the result with the radius of the sphere. (For instance Earth's radius is 6371km)
Parameters
| Parameter | Type | Description |
|---|---|---|
a | number[] | Float64Array<ArrayBufferLike> | Point [lat1, lon1] in radians |
b | number[] | Float64Array<ArrayBufferLike> | Point [lat2, lon2] in radians |
Returns
number
The Haversine distance between a and b.