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

__repr__ for VectorSum objects not correct #162

Closed
JoshPaterson opened this issue Mar 1, 2018 · 1 comment
Closed

__repr__ for VectorSum objects not correct #162

JoshPaterson opened this issue Mar 1, 2018 · 1 comment

Comments

@JoshPaterson
Copy link
Contributor

Sorry for so many issues at once, this is the last one for a while.

When I create a vector from the earth to the moon like this:

earth = ephem['earth']
moon = ephem['moon']

earth_to_moon = moon - earth

print(repr(earth_to_moon))

I get this result:

<VectorSum of 4 vectors 301 MOON -> 399 EARTH>

I believe this is backwards, it actually represents a vector from 399 EARTH -> 301 MOON.

Even stranger behavior happens if I do this:

print(repr(moon - earth + earth))

I get this:

<VectorSum of 6 vectors 0 SOLAR SYSTEM BARYCENTER -> 399 EARTH>

Based on looking at the positives and negatives the two earth's do in fact cancel out and the vector is correct, just the __repr__ is incorrect and should be 0 SOLAR SYSTEM BARYCENTER -> 301 MOON:

@brandon-rhodes
Copy link
Member

brandon-rhodes commented Mar 3, 2018

Sorry for so many issues at once, this is the last one for a while.

Don't apologize! 😃 It's very valuable for me to be able to correct these before the next release.

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