question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentations mistakes or code issues ?

See original GitHub issue

distance unit

Your documentation say distances are in kilometers. I tried your library but distance seems not to be kilometers. What is it ? Is it meters ?

var nantes = new LatLon(47.238222,-1.5600561);
var saintNazaire = new LatLon(47.2769351, -2.3091714);
nantes.distanceTo(nazaire); // return 56697.95954334959 - distance in kilometer is approximately 50km

function parameters

Further more your readme give latlon.destinationPoint(distance, bearing[, radius])

But your documentation give destinationPoint(brng, dist)

Which one should we trust ?

strange results

(new LatLon(0, 0)).destinationPoint(100000, 0); // return LatLon { lat: 0.8993216059187306, lon: 0 }
(new LatLon(0, 0)).destinationPoint(100000, 90); // return LatLon { lat: 5.506530518221826e-17, lon: 0.8993216059187716 }
(new LatLon(0, 0)).destinationPoint(100000, 180); // return LatLon { lat: -0.8993216059187306, lon: 0 }
(new LatLon(0, 0)).destinationPoint(100000, 270); // return LatLon { lat: -1.6519591554665477e-16, lon: -0.8993216059187716 }

why results give changes on latitude with a bearing of 90° and 270° ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alessandro-gentilinicommented, Sep 30, 2017

@thorinisme About your strange results: in theory I would expect that assuming var p=(new LatLon(0, 0)).destinationPoint(100000, 90) then p.lat should be zero. Assuming var p=(new LatLon(0, 0)).destinationPoint(100000, 270) then p.lat should be zero too.

Now, with https://raw.githubusercontent.com/chrisveness/geodesy/v1.1.2/latlon-spherical.js we have that the absolute value of p.lat is less than 2e-16 degree; since LatLon(0, 0) is a point lying on the Equator that means that the destination point is not on the Equator (as expected) but it lies 22 picometers northern (or southern) of the Equator.

1reaction
JamesLMilnercommented, Sep 22, 2017

Would it be worth getting rid of the documentation in the README and instead just linking directly to the JS Docs? That way you only have to maintain the JS Doc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importance of Documenting Frequently Encountered Errors
How important is it to document some of the frequently encountered errors? Here are some common areas where issues are seen and a...
Read more >
The 10 Most Common Mistakes in Documentation
Here are Fentin's top 10 documentation mistakes: · 1. Using labels without behavioral examples · 2. Using words that could be interpreted as...
Read more >
Common documentation errors - Today's Hospitalist
Here are some common documentation errors “and some tips for fixes. Probably the trickiest area for hospitalists is the history component for both...
Read more >
6 Process Documentation Mistakes Developers Should Avoid
Not following formatting standards · Using code snippets without code syntax highlighter · Not complying with business standards · Failing to ...
Read more >
How to document web errors - The MDN Web Docs project
Step 1 – Determine the error to document · Step 2 – Check the existing error documentation · Step 3 – Create the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found