Skip to content

Better way to handle poles? #48

@HansBrende

Description

@HansBrende

Calculating the distance over a pole, e.g., between [0, 89.99] and [180, 89.99] (with 89.99 as the latitude passed into the cheap ruler constructor) gives me a 57% error relative to the Vincenty calculation. (For reference, I used https://github.com/chrisveness/geodesy which seems to be better maintained than the derivative https://github.com/TankofVines/node-vincenty)

I know that this is already documented as a shortcoming, but food for thought: if you can calculate the maximum error that your shortcut formula would give you in advance (which seems likely, given that you have a % error chart in the readme), could you not simply fall back to the Vincenty (or even haversine) formula if the error is too large? That would fix the pole issue... (for comparison, the haversine formula gives only a 0.4% error for those same two coordinates -- and could probably be improved upon by tweaking the earth radius).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions