Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/computeDestinationPoint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('computeDestinationPoint', () => {
180
)
).toEqual({
latitude: 52.383712759112186,
latitude: 52.38386370738208,
longitude: 13.408056,
});

Expand All @@ -20,8 +20,8 @@ describe('computeDestinationPoint', () => {
135
)
).toEqual({
latitude: 52.42312025947117,
longitude: 13.56447370636139,
latitude: 52.42322722672353,
longitude: 13.564299057246112,
});
});

Expand All @@ -33,7 +33,7 @@ describe('computeDestinationPoint', () => {
0
)
).toEqual({
latitude: 71.83167384063478,
latitude: 72.3348347402393,
longitude: -106.19528790000001,
});
});
Expand All @@ -46,7 +46,7 @@ describe('computeDestinationPoint', () => {
0
)
).toEqual({
latitude: 18.512019808029596,
latitude: 18.5120147764206,
longitude: 73.8047121,
});

Expand All @@ -57,7 +57,7 @@ describe('computeDestinationPoint', () => {
180
)
).toEqual({
latitude: 18.50302659197041,
latitude: 18.50303162357941,
longitude: 73.8047121,
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/computeDestinationPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import getLatitude from './getLatitude';
import getLongitude from './getLongitude';
import toRad from './toRad';
import toDeg from './toDeg';
import { MAXLON, MINLON } from './constants';
import { MAXLON, MINLON, earthRadius } from './constants';
import { GeolibInputCoordinates } from './types';

// Computes the destination point given an initial point, a distance and a bearing
Expand All @@ -11,7 +11,7 @@ const computeDestinationPoint = (
start: GeolibInputCoordinates,
distance: number,
bearing: number,
radius: number = 6371000
radius: number = earthRadius
) => {
const lat = getLatitude(start);
const lng = getLongitude(start);
Expand Down