{"action":"created","issue":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5932","repository_url":"https://api.github.com/repos/Leaflet/Leaflet","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5932/labels{/name}","comments_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5932/comments","events_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5932/events","html_url":"https://github.com/Leaflet/Leaflet/issues/5932","id":275687653,"number":5932,"title":"Some points have non-zero distance to themselves","user":{"login":"jussimattas","id":10918844,"avatar_url":"https://avatars2.githubusercontent.com/u/10918844?v=4","gravatar_id":"","url":"https://api.github.com/users/jussimattas","html_url":"https://github.com/jussimattas","followers_url":"https://api.github.com/users/jussimattas/followers","following_url":"https://api.github.com/users/jussimattas/following{/other_user}","gists_url":"https://api.github.com/users/jussimattas/gists{/gist_id}","starred_url":"https://api.github.com/users/jussimattas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jussimattas/subscriptions","organizations_url":"https://api.github.com/users/jussimattas/orgs","repos_url":"https://api.github.com/users/jussimattas/repos","events_url":"https://api.github.com/users/jussimattas/events{/privacy}","received_events_url":"https://api.github.com/users/jussimattas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-21T12:04:10Z","updated_at":"2017-11-21T13:28:50Z","closed_at":null,"author_association":"NONE","body":"If `x` is e.g. `[60.1882535, 24.8300111]`, then `L.latLng(x).distanceTo(x)` -- which is expected to give zero -- gives 0.09493529796600342, i.e. ~10cm. If you change the latitude a bit, say, to 60.1882537, then the formula gives zero. Several other random points have this property, too (this exact same non-zero value for `L.latLng(x).distanceTo(x)`). For some values of `x` the distance is 0.13425878593145293. These are the only two non-zero values I've seen in this context.\r\n\r\nLeaflet version: 1.2.0 stable.\r\n\r\nJSFiddle to check distance of random points to themselves: https://jsfiddle.net/egrqg3qa/4/\r\n\r\nReproduced on Windows 10 with\r\n- Chrome Version 62.0.3202.94 (Official Build) (64-bit)\r\n- Firefox 57.0 (64-bit)\r\n- Microsoft Edge 40.15063.674.0"},"comment":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/comments/346026454","html_url":"https://github.com/Leaflet/Leaflet/issues/5932#issuecomment-346026454","issue_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5932","id":346026454,"user":{"login":"IvanSanchez","id":1125786,"avatar_url":"https://avatars0.githubusercontent.com/u/1125786?v=4","gravatar_id":"","url":"https://api.github.com/users/IvanSanchez","html_url":"https://github.com/IvanSanchez","followers_url":"https://api.github.com/users/IvanSanchez/followers","following_url":"https://api.github.com/users/IvanSanchez/following{/other_user}","gists_url":"https://api.github.com/users/IvanSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanSanchez/subscriptions","organizations_url":"https://api.github.com/users/IvanSanchez/orgs","repos_url":"https://api.github.com/users/IvanSanchez/repos","events_url":"https://api.github.com/users/IvanSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/IvanSanchez/received_events","type":"User","site_admin":false},"created_at":"2017-11-21T13:28:50Z","updated_at":"2017-11-21T13:28:50Z","author_association":"OWNER","body":"This is also reproducible by doing:\r\n\r\n```\r\nlet x = [60.1882535, 24.8300111];\r\nconsole.log( L.CRS.Earth.distance(L.latLng(x), L.latLng(x)) );\r\n```\r\n\r\n(Note that `L.LatLng.prototype.distanceTo()` calls `L.CRS.Earth.distance()` under the hood)\r\n\r\nThis might as well be an artifact of the distance approximation used by the `L.CRS.Earth.distance` method, don't know if it's worth changing that."}}
{"actor":{"display_login":"IvanSanchez"}}