Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i verify the destination point is right? #113

Closed
linxiaowu66 opened this issue Jul 27, 2023 · 1 comment
Closed

how can i verify the destination point is right? #113

linxiaowu66 opened this issue Jul 27, 2023 · 1 comment

Comments

@linxiaowu66
Copy link

Hi,
I use this repo to calculate the destination point, the process as follow:


const distance = new LatLon(122.028758, 29.789461)
        .distanceTo(new LatLon(122.011392, 29.7752625))
        .toFixed()  // >> print the 2105 m, this is right

// then i cal the initialBearing

const bearing = new LatLon(122.028758, 29.789461)
        .initialBearingTo(new LatLon(122.011392, 29.7752625))
        .toFixed(1) // >> it print the 336.6 degree, but i can not verify it

// than i use the destination method to prove the above two method result is right ?

const destPoint = new LatLon(122.028758, 29.789461)
        .destinationPoint(distance, bearing)
        .toString() 

// it print the '57.9713°N, 029.7895°E', but this result it not equal the `122.011392, 29.7752625`

so something i went wrong ?

@chrisveness
Copy link
Owner

Sorry not to have replied to this in so long.

A latitude of 122.029° has gone over the north pole and headed back down the other side, travelling 122.029-90 = 32.029° south from the north pole, that is latitude 57.971°N.

This could be rejected as an error, but sometimes it can come out as a valid result of calculations, so e.g. 110°N is considered equivalent to 70°N.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants