Skip to content

Commit

Permalink
fix haversineDistance: add new line
Browse files Browse the repository at this point in the history
Co-authored-by: Rocio Perez-Cano <[email protected]>
  • Loading branch information
nkdengineer and pecanoro authored Jun 3, 2024
1 parent 95591d9 commit 3fe0372
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/MapView/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function haversineDistance(coordinate1: number[], coordinate2: number[]) {
const lat2 = (coordinate2[0] * Math.PI) / 180;
const deltaLat = ((coordinate2[0] - coordinate1[0]) * Math.PI) / 180;
const deltaLon = ((coordinate2[1] - coordinate1[1]) * Math.PI) / 180;

// The square of half the chord length between the points
const halfChordLengthSq = Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(deltaLon / 2) * Math.sin(deltaLon / 2);

Expand Down

0 comments on commit 3fe0372

Please sign in to comment.