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

Convert distance() method to full Haversine formula #107

Open
thespacedoctor opened this issue Jan 27, 2023 · 0 comments
Open

Convert distance() method to full Haversine formula #107

thespacedoctor opened this issue Jan 27, 2023 · 0 comments
Assignees

Comments

@thespacedoctor
Copy link
Member

Current implementation is good enough for objects near each other, but best to have the full formula.

def distance(ra1, de1, ra2, de2):
    dra = (ra1 - ra2)*math.cos(de1*math.pi/180)
    dde = (de1 - de2)
    return math.sqrt(dra*dra + dde*dde)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants